mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-13 21:40:11 +00:00
Improve performance by skipping update if transform is unchanged
This commit is contained in:
parent
4751e0e953
commit
0209c70583
@ -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…
x
Reference in New Issue
Block a user