Bugfix: Collada animation parser now handles multi-value data types correctly. Or at least I hope so.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@555 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
ulfjorensen
2010-02-26 15:17:19 +00:00
parent b536a22e4e
commit 3e529ac1fc
3 changed files with 20 additions and 4 deletions

View File

@@ -1677,6 +1677,7 @@ void ColladaParser::ReadAccessor( const std::string& pID)
acc.mOffset = offset;
acc.mStride = stride;
acc.mSource = source+1; // ignore the leading '#'
acc.mSize = 0; // gets incremented with every param
// and read the components
while( mReader->read())
@@ -1719,6 +1720,20 @@ void ColladaParser::ReadAccessor( const std::string& pID)
// DefaultLogger::get()->warn( boost::str( boost::format( "Unknown accessor parameter \"%s\". Ignoring data channel.") % name));
}
// read data type
int attrType = TestAttribute( "type");
if( attrType)
{
// for the moment we only distinguish between a 4x4 matrix and anything else.
// TODO: (thom) I don't have a spec here at work. Check if there are other multi-value types
// which should be tested for here.
std::string type = mReader->getAttributeValue( attrType);
if( type == "float4x4")
acc.mSize += 16;
else
acc.mSize += 1;
}
acc.mParams.push_back( name);
// skip remaining stuff of this element, if any