fix child transforms of a compound

This commit is contained in:
Xinlei Wang 2023-04-11 22:21:21 +08:00 committed by GitHub
parent 0e59474e1c
commit d9a4a7e703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,7 @@ void CompoundBoxesExample::initPhysics()
#else
// recompute the shift to make sure the compound shape is re-aligned
for (int i = 0; i < compoundShape->getNumChildShapes(); i++)
compound2->addChildShape(compoundShape->getChildTransform(i) * principal.inverse(),
compound2->addChildShape(principal.inverse() * compoundShape->getChildTransform(i),
compoundShape->getChildShape(i));
#endif
delete compoundShape;