add imported meshes from OpenGEX-importer to scene.
Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>pull/521/head
parent
8857f26efb
commit
754897d1aa
|
@ -238,6 +238,7 @@ void OpenGEXImporter::InternReadFile( const std::string &filename, aiScene *pSce
|
|||
handleNodes( m_ctx->m_root, pScene );
|
||||
}
|
||||
|
||||
copyMeshes( pScene );
|
||||
resolveReferences();
|
||||
}
|
||||
|
||||
|
@ -678,6 +679,20 @@ void OpenGEXImporter::handleMaterialNode( ODDLParser::DDLNode *node, aiScene *pS
|
|||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
void OpenGEXImporter::copyMeshes( aiScene *pScene ) {
|
||||
if( m_meshCache.empty() ) {
|
||||
return;
|
||||
}
|
||||
pScene->mNumMeshes = m_meshCache.size();
|
||||
pScene->mMeshes = new aiMesh*[ pScene->mNumMeshes ];
|
||||
size_t i( 0 );
|
||||
for( std::vector<aiMesh*>::iterator it = m_meshCache.begin(); it != m_meshCache.end(); it++ ) {
|
||||
pScene->mMeshes[ i ] = *it;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
void OpenGEXImporter::resolveReferences() {
|
||||
if( m_unresolvedRefStack.empty() ) {
|
||||
|
|
|
@ -114,6 +114,7 @@ protected:
|
|||
void handleMaterialNode( ODDLParser::DDLNode *node, aiScene *pScene );
|
||||
void handleColorNode( ODDLParser::DDLNode *node, aiScene *pScene );
|
||||
void handleTextureNode( ODDLParser::DDLNode *node, aiScene *pScene );
|
||||
void copyMeshes( aiScene *pScene );
|
||||
void resolveReferences();
|
||||
void pushNode( aiNode *node, aiScene *pScene );
|
||||
aiNode *popNode();
|
||||
|
|
Loading…
Reference in New Issue