Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Renormalize rotation in 2D integration and clean up renormalize #590

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Dec 12, 2024

Objective

Currently, only 3D rotation is renormalized after position integration. However, 2D rotation can also become denormalized over time, sometimes causing crashes with debug_assertions.

Solution

Add fast_renormalize for 2D Rotation and renormalize 2D rotations after position integration.

I also renamed the 3D Rotation::renormalize method to fast_renormalize, and made it return the value instead of mutating self, to match Bevy 0.15.


Migration Guide

The 3D Rotation::renormalize method has been renamed to fast_renormalize, and it returns the value instead of mutating self. This was changed to match Bevy 0.15.

@Jondolf Jondolf added C-Enhancement New feature or request A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on P-Crash A sudden unexpected crash C-Breaking-Change This change removes or changes behavior or APIs, requiring users to adapt labels Dec 12, 2024
@Jondolf Jondolf merged commit c4840dd into main Dec 12, 2024
5 checks passed
@Jondolf Jondolf deleted the 2d-rotation-normalization branch December 12, 2024 18:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Breaking-Change This change removes or changes behavior or APIs, requiring users to adapt C-Enhancement New feature or request P-Crash A sudden unexpected crash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant