本文整理汇总了C++中CFile::Filename方法的典型用法代码示例。如果您正苦于以下问题:C++ CFile::Filename方法的具体用法?C++ CFile::Filename怎么用?C++ CFile::Filename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFile
的用法示例。
在下文中一共展示了CFile::Filename方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadTexture
TTexturePtr AssimpLoader::LoadTexture(const CFile& file)
{
TTexturePtr texturePtr;
try
{
texturePtr = Texture::LoadFromFile(file.Filename());
} catch (CException e)
{
texturePtr = Texture::LoadFromFile("unknowTexture.tga");
}
return texturePtr;
}
示例2: BuildGroup
//.........这里部分代码省略.........
assimpMesh->AddBuffer(buffer, COLOR_ATTRIBUT);
}
}
// * UV Coords
if (mesh->GetNumUVChannels() > 0)
{
// TODO: Gestion des materiaux multiples
if (mesh->GetNumUVChannels() > 1)
{
throw CException("Too UV Channels");
}
else
{
buffer.size = maxIndice * 2 + 2;
buffer.owner = true;
buffer.dimension = 2;
float * UVArray = new float[maxIndice * 2 + 2];for
( int i = 0; i < maxIndice+1; i++)
{
UVArray[i*2] = mesh->mTextureCoords[0][i].x;
UVArray[i*2+1] = mesh->mTextureCoords[0][i].y;
}
buffer.buffer = UVArray;
assimpMesh->AddBuffer(buffer, TEXCOORD_ATTRIBUT);
// Load diffuse image
const struct aiMaterial* material =
scene->mMaterials[mesh->mMaterialIndex];
if (material->GetTextureCount(aiTextureType_DIFFUSE) > 0)
{
aiString AiPath;
material->GetTexture(aiTextureType_DIFFUSE, 0, &AiPath);
CFile texturePath = std::string(AiPath.data);
Logger::Log() << "[INFO] Diffuse texture : "
<< texturePath.Filename() << "\n";
assimpMesh->AddTextureMap(DIFFUSE_TEXTURE,
LoadTexture(texturePath));
}
if (material->GetTextureCount(aiTextureType_SPECULAR) > 0)
{
aiString AiPath;
material->GetTexture(aiTextureType_SPECULAR, 0, &AiPath);
CFile texturePath = std::string(AiPath.data);
Logger::Log() << "[INFO] Specular Texture : "
<< texturePath.Filename() << "\n";
assimpMesh->AddTextureMap(SPECULAR_TEXTURE,
LoadTexture(texturePath));
}
//TODO: Desactivation du bump mapping
// if(material->GetTextureCount(aiTextureType_HEIGHT)>0)
// {
// aiString AiPath;
// material->GetTexture(aiTextureType_HEIGHT, 0, &AiPath);
// CFile texturePath = std::string(AiPath.data);
// Logger::Log() << "[INFO] Normal texture : " << texturePath.Filename() << "\n";
// assimpMesh->AddTextureMap(NORMAL_TEXTURE, LoadTexture(texturePath));
// }
}
}
// Chargement des materiaux
GetMaterialPropreties(assimpMesh,
scene->mMaterials[mesh->mMaterialIndex]);
// Check if is an Instance
bool foundInstance = false;
//TODO: Reactivativate instance system
// for(CachedAssimpMeshMap::iterator it = m_cached_geom.begin(); it != m_cached_geom.end(); it++)