You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 19:41:11 +00:00
Avoid inertia calculation for empty shape - Bullet
This commit is contained in:
@@ -825,7 +825,8 @@ void RigidBodyBullet::reload_shapes() {
|
||||
// shapes incorrectly do not set the vector in calculateLocalIntertia.
|
||||
// Arbitrary zero is preferable to undefined behaviour.
|
||||
btVector3 inertia(0, 0, 0);
|
||||
mainShape->calculateLocalInertia(mass, inertia);
|
||||
if (EMPTY_SHAPE_PROXYTYPE != mainShape->getShapeType()) // Necessary to avoid assertion of the empty shape
|
||||
mainShape->calculateLocalInertia(mass, inertia);
|
||||
btBody->setMassProps(mass, inertia);
|
||||
}
|
||||
btBody->updateInertiaTensor();
|
||||
|
||||
Reference in New Issue
Block a user