Procházet zdrojové kódy

Fix mLookAt with pretransformed vertices

mLookAt is a position vector inside the nodes reference frame, not a direction vector, so translation should be applied to it.
Suhajda Tamás před 2 roky
rodič
revize
9d76493ad8
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      code/PostProcessing/PretransformVertices.cpp

+ 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;
 	}