|
@@ -196,7 +196,7 @@ template <typename T> void ReadBounds( IOStream * stream, T* /*p*/, unsigned int
|
|
stream->Seek( sizeof(T) * n, aiOrigin_CUR );
|
|
stream->Seek( sizeof(T) * n, aiOrigin_CUR );
|
|
}
|
|
}
|
|
|
|
|
|
-void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
|
|
|
|
|
|
+void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node, aiNode* parent )
|
|
{
|
|
{
|
|
uint32_t chunkID = Read<uint32_t>(stream);
|
|
uint32_t chunkID = Read<uint32_t>(stream);
|
|
ai_assert(chunkID == ASSBIN_CHUNK_AINODE);
|
|
ai_assert(chunkID == ASSBIN_CHUNK_AINODE);
|
|
@@ -208,6 +208,10 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
|
|
(*node)->mTransformation = Read<aiMatrix4x4>(stream);
|
|
(*node)->mTransformation = Read<aiMatrix4x4>(stream);
|
|
(*node)->mNumChildren = Read<unsigned int>(stream);
|
|
(*node)->mNumChildren = Read<unsigned int>(stream);
|
|
(*node)->mNumMeshes = Read<unsigned int>(stream);
|
|
(*node)->mNumMeshes = Read<unsigned int>(stream);
|
|
|
|
+ if(parent)
|
|
|
|
+ {
|
|
|
|
+ (*node)->mParent = parent;
|
|
|
|
+ }
|
|
|
|
|
|
if ((*node)->mNumMeshes)
|
|
if ((*node)->mNumMeshes)
|
|
{
|
|
{
|
|
@@ -221,7 +225,7 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
|
|
{
|
|
{
|
|
(*node)->mChildren = new aiNode*[(*node)->mNumChildren];
|
|
(*node)->mChildren = new aiNode*[(*node)->mNumChildren];
|
|
for (unsigned int i = 0; i < (*node)->mNumChildren; ++i) {
|
|
for (unsigned int i = 0; i < (*node)->mNumChildren; ++i) {
|
|
- ReadBinaryNode( stream, &(*node)->mChildren[i] );
|
|
|
|
|
|
+ ReadBinaryNode( stream, &(*node)->mChildren[i], *node );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -569,7 +573,7 @@ void AssbinImporter::ReadBinaryScene( IOStream * stream, aiScene* scene )
|
|
|
|
|
|
// Read node graph
|
|
// Read node graph
|
|
scene->mRootNode = new aiNode[1];
|
|
scene->mRootNode = new aiNode[1];
|
|
- ReadBinaryNode( stream, &scene->mRootNode );
|
|
|
|
|
|
+ ReadBinaryNode( stream, &scene->mRootNode, (aiNode*)NULL );
|
|
|
|
|
|
// Read all meshes
|
|
// Read all meshes
|
|
if (scene->mNumMeshes)
|
|
if (scene->mNumMeshes)
|