Refactor Rigidbody automatic mass calculation to include physical material Density

This commit is contained in:
Wojtek Figat
2021-11-01 21:44:09 +01:00
parent e90f06748c
commit 62b0d19866
6 changed files with 77 additions and 73 deletions

View File

@@ -237,7 +237,10 @@ void Collider::Attach(RigidBody* rigidBody)
_cachedLocalPoseRot = _localTransform.Orientation;
_shape->setLocalPose(PxTransform(C2P(_cachedLocalPosePos), C2P(_cachedLocalPoseRot)));
if (rigidBody->IsDuringPlay())
{
rigidBody->UpdateBounds();
rigidBody->UpdateMass();
}
}
void Collider::UpdateLayerBits()