Should MutableCompoundShape::AdjustCenterOfMass also recalculate subshape bounding boxes? #1168
Closed
bjornbytes
started this conversation in
General
Replies: 1 comment 3 replies
-
Thanks for reporting this! This is a bug and I've created a fix in #1169 (currently going through the build). |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm running into an issue where adjusting the center of mass of a
MutableCompoundShape
leads to incorrect collision detection. It seems likeAdjustCenterOfMass
moves the subshapes around the new COM but doesn't update their bounding boxes.Here's a small program that demonstrates the problem:
After
AdjustCenterOfMass
, Jolt still thinks the bounding box of the second cube is centered around(2, 0, 0)
instead of(1, 0, 0)
.Since AFAIK there's no way to manually update the subshape bounding boxes, the only workarounds I can think of are kind of hacky: add and remove a dummy shape, move an existing shape to the position it's already at, etc. It seems like adjusting the center of mass should take care of updating the subshape bounds since it moves the shapes.
Beta Was this translation helpful? Give feedback.
All reactions