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.
pull/5056/head
Suhajda Tamás 2023-04-04 00:06:09 +02:00
parent 9915e875bf
commit 9d76493ad8
1 changed files with 1 additions and 1 deletions

View File

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