Skip to content

Conversation

@ikpil
Copy link
Owner

@ikpil ikpil commented Jun 29, 2025

…curacy (box2d #955)

I was computing the shape inertia about the body origin and then shifting to the center of mass. But this involves quadratic math with bad cancellation effects.

I'm now buffering the shape inertias about their centroids and then shifting them to the final body center of mass. This removes the quadratic cancellation.

Fixes (box2d #949)

…curacy (box2d #955)

I was computing the shape inertia about the body origin and then
shifting to the center of mass. But this involves quadratic math with
bad cancellation effects.

I'm now buffering the shape inertias about their centroids and then
shifting them to the final body center of mass. This removes the
quadratic cancellation.

Fixes (box2d #949)
@ikpil ikpil merged commit 52c5d78 into main Jun 29, 2025
7 checks passed
@ikpil ikpil deleted the pr/remove-cancellation-from-inertia-calculation-to-improve-accuracy-955 branch June 29, 2025 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants