Skip to content
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 3D rotation update in transform_to_position #520

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Sep 22, 2024

Objective

Fixes #516.

Rotation is currently updated incorrectly in 3D by transform_to_position. It uses addition and subtraction instead of multiplication for quaternions. This causes clear desync between Transform rotation and Rotation when SyncConfig::position_to_transform is false and the Transform is changed:

2024-09-23.00-58-47.mp4

Solution

Fix the rotation update. We can also remove the normalization, because individual quaternion multiplications should remain normalized, assuming the inputs are normalized (and there aren't too many successive rotations).

Now, the desync is fixed:

2024-09-23.00-57-12.mp4

@Jondolf Jondolf added C-Bug Something isn't working A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on labels Sep 22, 2024
@Jondolf Jondolf merged commit d79bb13 into main Sep 22, 2024
4 checks passed
@Jondolf Jondolf deleted the fix-3d-rotation-update branch September 22, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect sync between Transform::rotation and Rotation
1 participant