Browse Source

Merge pull request #5056 from sutajo/fix_pretransform_vertices_with_cameras

Fix pretransform vertices with cameras
Kim Kulling 2 years ago
parent
commit
679eb972e6

+ 0 - 5
code/AssetLib/glTF2/glTF2Importer.cpp

@@ -1213,11 +1213,6 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector<unsigned int> &
 
         if (node.camera) {
             pScene->mCameras[node.camera.GetIndex()]->mName = ainode->mName;
-            if (node.translation.isPresent) {
-                aiVector3D trans;
-                CopyValue(node.translation.value, trans);
-                pScene->mCameras[node.camera.GetIndex()]->mPosition = trans;
-            }
         }
 
         if (node.light) {

+ 1 - 1
code/PostProcessing/PretransformVertices.cpp

@@ -577,7 +577,7 @@ void PretransformVertices::Execute(aiScene *pScene) {
 		// multiply all properties of the camera with the absolute
 		// transformation of the corresponding node
 		cam->mPosition = nd->mTransformation * cam->mPosition;
-		cam->mLookAt = aiMatrix3x3(nd->mTransformation) * cam->mLookAt;
+		cam->mLookAt = nd->mTransformation * cam->mLookAt;
 		cam->mUp = aiMatrix3x3(nd->mTransformation) * cam->mUp;
 	}