Skip to content

Commit

Permalink
Merge pull request assimp#5056 from sutajo/fix_pretransform_vertices_…
Browse files Browse the repository at this point in the history
…with_cameras

Fix pretransform vertices with cameras
  • Loading branch information
kimkulling authored Apr 4, 2023
2 parents 8705940 + 89ccc89 commit 679eb97
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions code/AssetLib/glTF2/glTF2Importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion code/PostProcessing/PretransformVertices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 679eb97

Please sign in to comment.