From d411cbfbf4a5f00c7b69d48e9ed1672dd288206d Mon Sep 17 00:00:00 2001 From: Matt Lilley Date: Thu, 23 May 2013 12:15:14 +1200 Subject: [PATCH] Make use of unit tag in asset info to scale the whole model --- code/ColladaLoader.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index dca2b8ed6..52e592b89 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -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,