mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
Fixed buggy scaling for multi-shape bodies.
This commit is contained in:
parent
61a95917a8
commit
0f22583ba5
@ -288,15 +288,13 @@ transform_changed() {
|
||||
}
|
||||
|
||||
// Rescale all shapes, but only if the new transform state
|
||||
// has a scale
|
||||
// has a scale, and this scale differes from the current scale.
|
||||
if (ts->has_scale()) {
|
||||
LVecBase3 scale = ts->get_scale();
|
||||
if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
|
||||
for (int i=0; i<get_num_shapes(); i++) {
|
||||
PT(BulletShape) shape = _shapes[i];
|
||||
shape->set_local_scale(scale);
|
||||
}
|
||||
btVector3 new_scale = LVecBase3_to_btVector3(ts->get_scale());
|
||||
btVector3 current_scale = _shape->getLocalScaling();
|
||||
|
||||
if (new_scale != current_scale) {
|
||||
_shape->setLocalScaling(new_scale);
|
||||
shape_changed();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user