Fix for repeatedly scaling shapes.
This commit is contained in:
parent
5249e8ba4b
commit
4a8e14bfbd
|
|
@ -86,6 +86,7 @@ void BulletRigidBodyNode::
|
|||
shape_changed() {
|
||||
|
||||
set_mass(get_mass());
|
||||
transform_changed();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -292,10 +293,11 @@ transform_changed() {
|
|||
if (ts->has_scale()) {
|
||||
btVector3 new_scale = LVecBase3_to_btVector3(ts->get_scale());
|
||||
btVector3 current_scale = _shape->getLocalScaling();
|
||||
btVector3 current_scale_inv(1.0/current_scale.x(), 1.0/current_scale.y(), 1.0/current_scale.z());
|
||||
|
||||
if (new_scale != current_scale) {
|
||||
_shape->setLocalScaling(current_scale_inv);
|
||||
_shape->setLocalScaling(new_scale);
|
||||
shape_changed();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue