Physics/PhysObject: Added Set(Angular)Velocity methods

Former-commit-id: cd506b93ad3be1f2c5972b784bef53e02a9211ef
This commit is contained in:
Lynix 2015-04-23 14:22:58 +02:00
parent a71c86c0ca
commit 22f8c1b0a3
2 changed files with 12 additions and 0 deletions

View File

@ -49,12 +49,14 @@ class NAZARA_API NzPhysObject : NzNonCopyable
bool IsMoveable() const;
bool IsSleeping() const;
void SetAngularVelocity(const NzVector3f& angularVelocity);
void SetGeom(NzPhysGeomRef geom);
void SetGravityFactor(float gravityFactor);
void SetMass(float mass);
void SetMassCenter(const NzVector3f& center);
void SetPosition(const NzVector3f& position);
void SetRotation(const NzQuaternionf& rotation);
void SetVelocity(const NzVector3f& velocity);
NzPhysObject& operator=(const NzPhysObject& object);
NzPhysObject& operator=(NzPhysObject&& object);

View File

@ -217,6 +217,11 @@ bool NzPhysObject::IsSleeping() const
return NewtonBodyGetSleepState(m_body) != 0;
}
void NzPhysObject::SetAngularVelocity(const NzVector3f& angularVelocity)
{
NewtonBodySetOmega(m_body, angularVelocity);
}
void NzPhysObject::SetGeom(NzPhysGeomRef geom)
{
if (m_geom != geom)
@ -276,6 +281,11 @@ void NzPhysObject::SetRotation(const NzQuaternionf& rotation)
UpdateBody();
}
void NzPhysObject::SetVelocity(const NzVector3f& velocity)
{
NewtonBodySetVelocity(m_body, velocity);
}
NzPhysObject& NzPhysObject::operator=(const NzPhysObject& object)
{
NzPhysObject physObj(object);