-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Fix the calculation of the angular velocity #63190
Fix the calculation of the angular velocity #63190
Conversation
looks ok to me, @aaronfranke what do you think? |
I assume this might be needed for |
@akien-mga indeed, the bug is also present in 3.x. |
Thanks! |
Cherry-picked for 3.5. |
Is what we see in the "after_fix" video expected behavior? The cube doesn't rotate with the platform and is always facing the same world-space direction. |
@and-rad Yes, currently only rotation velocity (displacement) is taken into account. I proposed to add the rotation (angle) as well in the near future. |
Fix #63004
before this patch:
before.fix.mp4
after this patch:
after_fix.mp4
Description
The angular speed calculation was wrong when the rotation speed was not enough.
In
Basis::get_axis_angle
, the first condition tested an epsilon of0.01
.For example, by rotating on
Y
by0.005
radians per frame (which is not that slow as you can see in the video) which correspond to an angular velocity of(0, 0.600408, 0)
, you end up with a difference forMath::abs(rows[2][0] + rows[0][2]
of00999993085861
(and sometime0019999993965
which explain with in this speed, the cube is moving a bit), so when the value is lower than the epsilon, the function don't return an angular velocity.test project: bug-rotation.zip