Optimize flushing active transform of physically simulated actors

This commit is contained in:
Wojtek Figat
2021-07-07 16:45:35 +02:00
parent d7b47d7d05
commit d1b7b2d26d
4 changed files with 21 additions and 19 deletions

View File

@@ -409,7 +409,9 @@ void CharacterController::OnTransformChanged()
const PxExtendedVec3 pos(_transform.Translation.X, _transform.Translation.Y, _transform.Translation.Z);
_controller->setPosition(pos);
UpdateScale();
const Vector3 scale = GetScale();
if (!Vector3::NearEqual(_cachedScale, scale))
UpdateGeometry();
UpdateBounds();
}
else if (!_controller)