-
-
Notifications
You must be signed in to change notification settings - Fork 22.5k
jolt physics: to_jolt to use get_rotation_quaternion #103426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The orthanormalized basis transform from set_transform sometimes has a negative determinant, so instead of calling orthonormalize within that routine, it's called within get_rotation_quaternion.
There may be other places to reduce calculation repetition, best to get an expert to review before any merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tend to use get_rotation_quaternion for basis to quaternion conversion. So this seems correct.
Part of the animation team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely opposed to merging the changes to the conversion function, since it is technically safer this way, but #103440 still seems like a more holistic approach to me, so let's resolve the discussion there first.
However, as hinted at by @vmbaillie already, there are more places than JoltBody3D::set_transform
where redundant orthonormalization should be removed in this case, so this is not ready to be merged either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With #103440 having been merged, I would consider this PR to be superseded, as the additional work being done in Basis::get_rotation_quaternion
compared to Basis::get_quaternion
, meaning orthonormalization and ensuring correct handedness, is entirely redundant.
The orthanormalized basis transform from set_transform sometimes has a negative determinant, so instead of calling orthonormalize within that routine, it's called within get_rotation_quaternion.
Fixes #103408