forked from mirror/openmw-tes3mp
Improve performance by skipping update if transform is unchanged
This commit is contained in:
parent
4751e0e953
commit
0209c70583
1 changed files with 4 additions and 2 deletions
|
@ -622,8 +622,10 @@ namespace MWPhysics
|
|||
for (int j=0; j<3; ++j)
|
||||
transform.getBasis()[i][j] = matrix(j,i); // NB column/row major difference
|
||||
|
||||
compound->getChildShape(shapeIndex)->setLocalScaling(compound->getLocalScaling() * toBullet(scale));
|
||||
compound->updateChildTransform(shapeIndex, transform);
|
||||
if (compound->getLocalScaling() * toBullet(scale) != compound->getChildShape(shapeIndex)->getLocalScaling())
|
||||
compound->getChildShape(shapeIndex)->setLocalScaling(compound->getLocalScaling() * toBullet(scale));
|
||||
if (!(transform == compound->getChildTransform(shapeIndex)))
|
||||
compound->updateChildTransform(shapeIndex, transform);
|
||||
}
|
||||
|
||||
collisionWorld->updateSingleAabb(mCollisionObject.get());
|
||||
|
|
Loading…
Reference in a new issue