Merge pull request #5056 from sutajo/fix_pretransform_vertices_with_cameras

Fix pretransform vertices with cameras
pull/5064/head
Kim Kulling 2023-04-04 17:35:50 +02:00 committed by GitHub
commit 679eb972e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -1213,11 +1213,6 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector<unsigned int> &
if (node.camera) { if (node.camera) {
pScene->mCameras[node.camera.GetIndex()]->mName = ainode->mName; 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) { if (node.light) {

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