Make use of unit tag in asset info to scale the whole model

pull/44/head
Matt Lilley 2013-05-23 12:15:14 +12:00
parent be457757a5
commit d411cbfbf4
1 changed files with 7 additions and 1 deletions

View File

@ -155,7 +155,13 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
// ... then fill the materials with the now adjusted settings
FillMaterials(parser, pScene);
// Convert to Y_UP, if different orientation
// Apply unitsize scale calculation
pScene->mRootNode->mTransformation *= aiMatrix4x4(parser.mUnitSize, 0, 0, 0,
0, parser.mUnitSize, 0, 0,
0, 0, parser.mUnitSize, 0,
0, 0, 0, 1);
// Convert to Y_UP, if different orientation
if( parser.mUpDirection == ColladaParser::UP_X)
pScene->mRootNode->mTransformation *= aiMatrix4x4(
0, -1, 0, 0,