mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:15:32 +00:00
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)
|
for (int j=0; j<3; ++j)
|
||||||
transform.getBasis()[i][j] = matrix(j,i); // NB column/row major difference
|
transform.getBasis()[i][j] = matrix(j,i); // NB column/row major difference
|
||||||
|
|
||||||
compound->getChildShape(shapeIndex)->setLocalScaling(compound->getLocalScaling() * toBullet(scale));
|
if (compound->getLocalScaling() * toBullet(scale) != compound->getChildShape(shapeIndex)->getLocalScaling())
|
||||||
compound->updateChildTransform(shapeIndex, transform);
|
compound->getChildShape(shapeIndex)->setLocalScaling(compound->getLocalScaling() * toBullet(scale));
|
||||||
|
if (!(transform == compound->getChildTransform(shapeIndex)))
|
||||||
|
compound->updateChildTransform(shapeIndex, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
collisionWorld->updateSingleAabb(mCollisionObject.get());
|
collisionWorld->updateSingleAabb(mCollisionObject.get());
|
||||||
|
|
Loading…
Reference in a new issue