Character controller now uses Add/Remove Simulated Body
This commit is contained in:
@@ -311,7 +311,10 @@ namespace PhysX
|
||||
CreateShadowBody(configuration);
|
||||
SetTag(configuration.m_colliderTag);
|
||||
|
||||
m_simulating = true;
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
sceneInterface->EnableSimulationOfBody(m_sceneOwner, m_bodyHandle);
|
||||
}
|
||||
}
|
||||
|
||||
void CharacterController::DisablePhysics()
|
||||
@@ -323,7 +326,11 @@ namespace PhysX
|
||||
|
||||
DestroyShadowBody();
|
||||
RemoveControllerFromScene();
|
||||
m_simulating = false;
|
||||
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
sceneInterface->DisableSimulationOfBody(m_sceneOwner, m_bodyHandle);
|
||||
}
|
||||
}
|
||||
|
||||
void CharacterController::DestroyShadowBody()
|
||||
|
||||
Reference in New Issue
Block a user