Physics3D/RigidBody3D: Add simulation property

This commit is contained in:
Lynix
2017-12-10 13:35:58 +01:00
parent b8e447e4fe
commit 33b3b2feaf
3 changed files with 13 additions and 0 deletions

View File

@@ -133,6 +133,11 @@ namespace Nz
NewtonBodySetAutoSleep(m_body, autoSleep);
}
void RigidBody3D::EnableSimulation(bool simulation)
{
NewtonBodySetSimulationState(m_body, simulation);
}
Boxf RigidBody3D::GetAABB() const
{
Vector3f min, max;
@@ -238,6 +243,11 @@ namespace Nz
return m_mass > 0.f;
}
bool RigidBody3D::IsSimulationEnabled() const
{
return NewtonBodyGetSimulationState(m_body) != 0;
}
bool RigidBody3D::IsSleeping() const
{
return NewtonBodyGetSleepState(m_body) != 0;