PhysicsID/RigidBody: Add GetWorld() accessor
This commit is contained in:
parent
28e8377708
commit
b00487c88c
|
|
@ -48,6 +48,7 @@ namespace Nz
|
||||||
float GetRotation() const;
|
float GetRotation() const;
|
||||||
void* GetUserdata() const;
|
void* GetUserdata() const;
|
||||||
Vector2f GetVelocity() const;
|
Vector2f GetVelocity() const;
|
||||||
|
PhysWorld2D* GetWorld() const;
|
||||||
|
|
||||||
bool IsMoveable() const;
|
bool IsMoveable() const;
|
||||||
bool IsSleeping() const;
|
bool IsSleeping() const;
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ namespace Nz
|
||||||
Vector3f GetPosition() const;
|
Vector3f GetPosition() const;
|
||||||
Quaternionf GetRotation() const;
|
Quaternionf GetRotation() const;
|
||||||
Vector3f GetVelocity() const;
|
Vector3f GetVelocity() const;
|
||||||
|
PhysWorld3D* GetWorld() const;
|
||||||
|
|
||||||
bool IsAutoSleepEnabled() const;
|
bool IsAutoSleepEnabled() const;
|
||||||
bool IsMoveable() const;
|
bool IsMoveable() const;
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,11 @@ namespace Nz
|
||||||
return Vector2f(static_cast<float>(vel.x), static_cast<float>(vel.y));
|
return Vector2f(static_cast<float>(vel.x), static_cast<float>(vel.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PhysWorld2D* RigidBody2D::GetWorld() const
|
||||||
|
{
|
||||||
|
return m_world;
|
||||||
|
}
|
||||||
|
|
||||||
bool RigidBody2D::IsMoveable() const
|
bool RigidBody2D::IsMoveable() const
|
||||||
{
|
{
|
||||||
return m_mass > 0.f;
|
return m_mass > 0.f;
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,11 @@ namespace Nz
|
||||||
return velocity;
|
return velocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PhysWorld3D* RigidBody3D::GetWorld() const
|
||||||
|
{
|
||||||
|
return m_world;
|
||||||
|
}
|
||||||
|
|
||||||
bool RigidBody3D::IsAutoSleepEnabled() const
|
bool RigidBody3D::IsAutoSleepEnabled() const
|
||||||
{
|
{
|
||||||
return NewtonBodyGetAutoSleep(m_body) != 0;
|
return NewtonBodyGetAutoSleep(m_body) != 0;
|
||||||
|
|
@ -314,7 +319,7 @@ namespace Nz
|
||||||
NazaraUnused(userData);
|
NazaraUnused(userData);
|
||||||
NewtonBodySetSleepState(body, 0);
|
NewtonBodySetSleepState(body, 0);
|
||||||
return 1;
|
return 1;
|
||||||
},
|
},
|
||||||
nullptr);
|
nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue