Convex shape scaling

This commit is contained in:
Lubos Lenco 2017-12-14 12:23:56 +01:00
parent 83d5d9ac6e
commit 0f85786eb0

View file

@ -305,7 +305,8 @@ class RigidBody extends Trait {
currentScaleX = v.x;
currentScaleY = v.y;
currentScaleZ = v.z;
if (!isConvex) _shape.setLocalScaling(BtVector3.create(bodyScaleX * v.x, bodyScaleY * v.y, bodyScaleZ * v.z));
if (isConvex) _shapeConvex.setLocalScaling(BtVector3.create(bodyScaleX * v.x, bodyScaleY * v.y, bodyScaleZ * v.z));
else _shape.setLocalScaling(BtVector3.create(bodyScaleX * v.x, bodyScaleY * v.y, bodyScaleZ * v.z));
physics.world.updateSingleAabb(body);
}