瀏覽代碼

Merge pull request #3841 from Garux/mdcOrient

orient mdc correctly
Kim Kulling 4 年之前
父節點
當前提交
76ccaeb42f
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      code/AssetLib/MDC/MDCLoader.cpp

+ 7 - 0
code/AssetLib/MDC/MDCLoader.cpp

@@ -465,6 +465,13 @@ void MDCImporter::InternReadFile(
             pcMat->AddProperty(&path, AI_MATKEY_TEXTURE_DIFFUSE(0));
         }
     }
+
+    // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
+    pScene->mRootNode->mTransformation = aiMatrix4x4(
+            1.f, 0.f, 0.f, 0.f,
+            0.f, 0.f, 1.f, 0.f,
+            0.f, -1.f, 0.f, 0.f,
+            0.f, 0.f, 0.f, 1.f);
 }
 
 #endif // !! ASSIMP_BUILD_NO_MDC_IMPORTER