mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
Fix which allows setting scale on a Bullet rigid body before any shape is added.
This commit is contained in:
parent
4a8e14bfbd
commit
468ddb3528
@ -178,6 +178,12 @@ add_shape(BulletShape *shape, CPT(TransformState) ts) {
|
|||||||
trans = TransformState_to_btTrans(ts);
|
trans = TransformState_to_btTrans(ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset the shape scaling before we add a shape, and remember the current
|
||||||
|
// Scale so we can restore it later...
|
||||||
|
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||||
|
LVector3 scale = np.get_scale();
|
||||||
|
np.set_scale(1.0);
|
||||||
|
|
||||||
// Root shape
|
// Root shape
|
||||||
btCollisionShape *previous = get_object()->getCollisionShape();
|
btCollisionShape *previous = get_object()->getCollisionShape();
|
||||||
btCollisionShape *next;
|
btCollisionShape *next;
|
||||||
@ -227,6 +233,9 @@ add_shape(BulletShape *shape, CPT(TransformState) ts) {
|
|||||||
_shapes.push_back(shape);
|
_shapes.push_back(shape);
|
||||||
|
|
||||||
shape_changed();
|
shape_changed();
|
||||||
|
|
||||||
|
// Restore the local scaling again
|
||||||
|
np.set_scale(scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user