From a53360aa4df0877a4ae4665fb2cc4c61b2f52e3e Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 24 Apr 2010 00:18:34 +0000 Subject: [PATCH] FIX: Change quaternion orientation for B3D loader (this format was forgotten with r502). FIX: MS3D loader assigns group names to mesh nodes, possibly leading to two nodes with the same name if a group name is the name of a bone as well. This prevents animations from working properly. These changes are merged with the 1.1 branch as well. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@705 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/B3DImporter.cpp | 3 ++- code/MS3DLoader.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/B3DImporter.cpp b/code/B3DImporter.cpp index 98b030417..dbde8769c 100644 --- a/code/B3DImporter.cpp +++ b/code/B3DImporter.cpp @@ -170,7 +170,8 @@ aiVector3D B3DImporter::ReadVec3(){ // ------------------------------------------------------------------------------------------------ aiQuaternion B3DImporter::ReadQuat(){ - float w=ReadFloat(); + // (aramis_acg) Fix to adapt the loader to changed quat orientation + float w=-ReadFloat(); float x=ReadFloat(); float y=ReadFloat(); float z=ReadFloat(); diff --git a/code/MS3DLoader.cpp b/code/MS3DLoader.cpp index cd846e0d0..6fad24f41 100644 --- a/code/MS3DLoader.cpp +++ b/code/MS3DLoader.cpp @@ -552,7 +552,12 @@ void MS3DImporter::InternReadFile( const std::string& pFile, aiNode* nd = rt->mChildren[i] = new aiNode(); const TempGroup& g = groups[i]; - nd->mName = aiString(g.name); + + // we need to generate an unique name for all mesh nodes. + // since we want to keep the group name, a prefix is + // prepended. + nd->mName = aiString("_"); + nd->mName.Append(g.name); nd->mParent = rt; nd->mMeshes = new unsigned int[nd->mNumMeshes = 1];