Avoid inertia calculation for empty shape - Bullet
This commit is contained in:
parent
35bb52011a
commit
5a26c7e0e5
1 changed files with 2 additions and 1 deletions
|
@ -825,6 +825,7 @@ void RigidBodyBullet::reload_shapes() {
|
||||||
// shapes incorrectly do not set the vector in calculateLocalIntertia.
|
// shapes incorrectly do not set the vector in calculateLocalIntertia.
|
||||||
// Arbitrary zero is preferable to undefined behaviour.
|
// Arbitrary zero is preferable to undefined behaviour.
|
||||||
btVector3 inertia(0, 0, 0);
|
btVector3 inertia(0, 0, 0);
|
||||||
|
if (EMPTY_SHAPE_PROXYTYPE != mainShape->getShapeType()) // Necessary to avoid assertion of the empty shape
|
||||||
mainShape->calculateLocalInertia(mass, inertia);
|
mainShape->calculateLocalInertia(mass, inertia);
|
||||||
btBody->setMassProps(mass, inertia);
|
btBody->setMassProps(mass, inertia);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue