Physics2D: Add DebugDraw method

This commit is contained in:
Jérôme Leclercq
2017-10-13 15:14:37 +02:00
parent b14a9f219a
commit 101783126c
4 changed files with 148 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
#include <Nazara/Math/Rect.hpp>
#include <Nazara/Physics2D/Config.hpp>
#include <Nazara/Physics2D/Collider2D.hpp>
#include <limits>
struct cpBody;
@@ -44,6 +45,7 @@ namespace Nz
float GetMomentOfInertia() const;
Vector2f GetPosition() const;
float GetRotation() const;
std::size_t GetShapeIndex(cpShape* shape) const;
void* GetUserdata() const;
Vector2f GetVelocity() const;
PhysWorld2D* GetWorld() const;
@@ -67,6 +69,8 @@ namespace Nz
NazaraSignal(OnRigidBody2DMove, RigidBody2D* /*oldPointer*/, RigidBody2D* /*newPointer*/);
NazaraSignal(OnRigidBody2DRelease, RigidBody2D* /*rigidBody*/);
static constexpr std::size_t InvalidShapeIndex = std::numeric_limits<std::size_t>::max();
private:
void CopyBodyData(cpBody* body);
cpBody* Create(float mass = 1.f, float moment = 1.f);