From 98e53f976eeee07c27c31cd60d797c29d2c7bc93 Mon Sep 17 00:00:00 2001 From: ulfjorensen Date: Sat, 1 Aug 2009 20:20:22 +0000 Subject: [PATCH] - Bugfix: IrrXML loader ignores trailing whitespace on closing tags now - Bugfix: Collada loader now filters bone vertex weights with weight zero - blame XSI collada export. - Bugfix: Collada animation resolver now also considers IDs when searching for nodes by name git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@460 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/ColladaLoader.cpp | 14 +++++++++----- contrib/irrXML/CXMLReaderImpl.h | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index b6bafd2ab..50e20ee9c 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -644,10 +644,14 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: float weight = ReadFloat( weightsAcc, weights, vertexIndex, 0); - aiVertexWeight w; - w.mVertexId = a - pStartVertex; - w.mWeight = weight; - dstBones[jointIndex].push_back( w); + // one day I gonna kill that XSI Collada exporter + if( weight > 0.0f) + { + aiVertexWeight w; + w.mVertexId = a - pStartVertex; + w.mWeight = weight; + dstBones[jointIndex].push_back( w); + } } } @@ -1364,7 +1368,7 @@ void ColladaLoader::CollectNodes( const aiNode* pNode, std::vectormName == pName) + if( pNode->mName == pName || pNode->mID == pName) return pNode; for( size_t a = 0; a < pNode->mChildren.size(); ++a) diff --git a/contrib/irrXML/CXMLReaderImpl.h b/contrib/irrXML/CXMLReaderImpl.h index 87dce7698..def3cc858 100644 --- a/contrib/irrXML/CXMLReaderImpl.h +++ b/contrib/irrXML/CXMLReaderImpl.h @@ -425,6 +425,10 @@ private: while(*P != L'>') ++P; + // remove trailing whitespace, if any + while( isspace( P[-1])) + --P; + NodeName = core::string(pBeginClose, (int)(P - pBeginClose)); ++P; }