本文整理汇总了C++中FileSystem::GetModelsFolderS方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSystem::GetModelsFolderS方法的具体用法?C++ FileSystem::GetModelsFolderS怎么用?C++ FileSystem::GetModelsFolderS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem
的用法示例。
在下文中一共展示了FileSystem::GetModelsFolderS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AxisSystem
void GeometryLoaderDX11::loadFBXFile( std::string szFilename, std::vector<GeometryPtr>& vGeomVector, std::vector<std::string>& vNames )
{
FileSystem fs;
szFilename = fs.GetModelsFolderS() + szFilename;
pFBXManager = FbxManager::Create();
if( !pFBXManager )
Log::Get().Write( L"CGeometryLoader11.cpp: Error creating FBX Manager!" );
FbxIOSettings* pIOS = FbxIOSettings::Create( pFBXManager, IOSROOT );
pFBXManager->SetIOSettings( pIOS );
FbxString lPath = FbxGetApplicationDirectory();
pFBXManager->LoadPluginsDirectory( lPath.Buffer() );
FbxScene* pScene = FbxScene::Create( pFBXManager, "" );
int /*nFileMajor,*/ nFileMinor, nFileRevision;
int nSDKMajor, nSDKMinor, nSDKRevision;
int i, /*nAnimationStack,*/ lFileFormat;
// bool bStatus;
// char szPassword[1024];
FbxManager::GetFileFormatVersion( nSDKMajor, nSDKMinor, nSDKRevision );
FbxImporter* pImporter = FbxImporter::Create( pFBXManager, "" );
if (!pFBXManager->GetIOPluginRegistry()->DetectReaderFileFormat(szFilename.c_str(), lFileFormat) )
{
// Unrecognizable file format. Try to fall back to FbxImporter::eFBX_BINARY
lFileFormat = pFBXManager->GetIOPluginRegistry()->FindReaderIDByDescription( "FBX binary (*.fbx)" );;
}
bool ImportStatus = pImporter->Initialize( szFilename.c_str(), lFileFormat, pFBXManager->GetIOSettings() );
pImporter->GetFileVersion( nFileMinor, nFileMinor, nFileRevision );
if( !ImportStatus )
{
Log::Get().Write( L"CGeometryLoader11.cpp: FbxImporter Initialize failed!" );
return;
}
ImportStatus = pImporter->Import( pScene );
if( !ImportStatus )
{
Log::Get().Write( L"CGeometryLoader11.cpp: FbxImporter failed to import the file to the scene!" );
return;
}
FbxAxisSystem SceneAxisSystem = pScene->GetGlobalSettings().GetAxisSystem();
FbxAxisSystem AxisSystem( FbxAxisSystem::eYAxis, FbxAxisSystem::eParityOdd, FbxAxisSystem::eLeftHanded );
if( SceneAxisSystem != AxisSystem )
{
AxisSystem.ConvertScene( pScene );
}
//FbxSystemUnit SceneSystemUnit = pScene->GetGlobalSettings().GetSystemUnit();
//if( SceneSystemUnit.GetScaleFactor() != 1.0f )
// FbxSystemUnit::cm.ConvertScene( pScene );
FBXTriangulateRecursive( pScene->GetRootNode() );
FbxArray<FbxMesh*> vMeshs;
FBXFillMeshArray( pScene, vMeshs );
unsigned short usVertexCount = 0;
unsigned short usTriangleCount = 0;
unsigned short usGroupCount = 0;
unsigned short usMaterialCount = 0;
unsigned short usIndicesCount = 0;
for( i = 0; i < vMeshs.GetCount(); i++ )
{
Log::Get().Write( L"CGeometryLoader11.cpp: Loading File!" );
std::string name = vMeshs[i]->GetNode()->GetName();
vNames.push_back( name );
usVertexCount = vMeshs[i]->GetControlPointsCount();
if( usVertexCount == 0 )
continue;
usTriangleCount = vMeshs[i]->GetPolygonVertexCount() / 3;
usIndicesCount = vMeshs[i]->GetPolygonVertexCount();
VertexElementDX11* pPositions = new VertexElementDX11( 3, usTriangleCount * 3 );
pPositions->m_SemanticName = VertexElementDX11::PositionSemantic;
pPositions->m_uiSemanticIndex = 0;
pPositions->m_Format = DXGI_FORMAT_R32G32B32_FLOAT;
pPositions->m_uiInputSlot = 0;
pPositions->m_uiAlignedByteOffset = 0;
pPositions->m_InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
pPositions->m_uiInstanceDataStepRate = 0;
VertexElementDX11* pTexCoords = new VertexElementDX11( 2, usTriangleCount * 3 );
pTexCoords->m_SemanticName = VertexElementDX11::TexCoordSemantic;
pTexCoords->m_uiSemanticIndex = 0;
pTexCoords->m_Format = DXGI_FORMAT_R32G32_FLOAT;
pTexCoords->m_uiInputSlot = 0;
pTexCoords->m_uiAlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
pTexCoords->m_InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
//.........这里部分代码省略.........