From 9d76493ad846256ac3d6126c109380e332eb0066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suhajda=20Tam=C3=A1s?= Date: Tue, 4 Apr 2023 00:06:09 +0200 Subject: [PATCH] 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. --- code/PostProcessing/PretransformVertices.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/PostProcessing/PretransformVertices.cpp b/code/PostProcessing/PretransformVertices.cpp index b6bb6155e..16548f09c 100644 --- a/code/PostProcessing/PretransformVertices.cpp +++ b/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; }