浏览代码

Merge pull request #44 from thetrime/master

Collada importer should respect units in file
Alexander Gessler 12 年之前
父节点
当前提交
08e078e20d
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      code/ColladaLoader.cpp

+ 7 - 1
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,