Skip to content

Commit

Permalink
Fixed the LookAt handling of offset and origin.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Nov 15, 2024
1 parent 807b191 commit 7e6c315
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vsg/app/ViewMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ void LookAt::set(const dmat4& matrix)

dmat4 LookAt::transform(const vsg::dvec3& offset) const
{
return lookAt(eye, center, up) * vsg::translate(offset-origin);
dvec3 delta = origin - offset;
return lookAt(eye + delta, center + delta, up);
}

dmat4 RelativeViewMatrix::transform(const vsg::dvec3& offset) const
Expand Down

0 comments on commit 7e6c315

Please sign in to comment.