Physics3D/RigidBody3D: Add [Get|Set][Angular|Linear]Damping
This commit is contained in:
@@ -133,6 +133,14 @@ namespace Nz
|
||||
return Boxf(min, max);
|
||||
}
|
||||
|
||||
Vector3f RigidBody3D::GetAngularDamping() const
|
||||
{
|
||||
Vector3f angularDamping;
|
||||
NewtonBodyGetAngularDamping(m_body, angularDamping);
|
||||
|
||||
return angularDamping;
|
||||
}
|
||||
|
||||
Vector3f RigidBody3D::GetAngularVelocity() const
|
||||
{
|
||||
Vector3f angularVelocity;
|
||||
@@ -156,6 +164,11 @@ namespace Nz
|
||||
return m_body;
|
||||
}
|
||||
|
||||
float RigidBody3D::GetLinearDamping() const
|
||||
{
|
||||
return NewtonBodyGetLinearDamping(m_body);
|
||||
}
|
||||
|
||||
float RigidBody3D::GetMass() const
|
||||
{
|
||||
return m_mass;
|
||||
@@ -222,6 +235,11 @@ namespace Nz
|
||||
return NewtonBodyGetSleepState(m_body) != 0;
|
||||
}
|
||||
|
||||
void RigidBody3D::SetAngularDamping(const Nz::Vector3f& angularDamping)
|
||||
{
|
||||
NewtonBodySetAngularDamping(m_body, angularDamping);
|
||||
}
|
||||
|
||||
void RigidBody3D::SetAngularVelocity(const Vector3f& angularVelocity)
|
||||
{
|
||||
NewtonBodySetOmega(m_body, angularVelocity);
|
||||
@@ -245,6 +263,11 @@ namespace Nz
|
||||
m_gravityFactor = gravityFactor;
|
||||
}
|
||||
|
||||
void RigidBody3D::SetLinearDamping(float damping)
|
||||
{
|
||||
NewtonBodySetLinearDamping(m_body, damping);
|
||||
}
|
||||
|
||||
void RigidBody3D::SetMass(float mass)
|
||||
{
|
||||
if (m_mass > 0.f)
|
||||
|
||||
Reference in New Issue
Block a user