mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
bullet: fix assert when setting mass before shape (#571)
Requires compiling Bullet in debug mode to reproduce.
This commit is contained in:
parent
fa6c066b2f
commit
92993fe889
@ -120,7 +120,7 @@ do_set_mass(PN_stdfloat mass) {
|
|||||||
btScalar bt_mass = mass;
|
btScalar bt_mass = mass;
|
||||||
btVector3 bt_inertia(0.0, 0.0, 0.0);
|
btVector3 bt_inertia(0.0, 0.0, 0.0);
|
||||||
|
|
||||||
if (bt_mass > 0.0) {
|
if (bt_mass > 0.0 && !_shapes.empty()) {
|
||||||
_rigid->getCollisionShape()->calculateLocalInertia(bt_mass, bt_inertia);
|
_rigid->getCollisionShape()->calculateLocalInertia(bt_mass, bt_inertia);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user