From 596f407a7978a1e4da8c29f3bbcf8621e5cb7bf4 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 3 Jan 2015 22:32:56 +0100 Subject: [PATCH] Added DebugDrawer::Draw(position, size) Draws a "size"-sized box centered on "position" Former-commit-id: 9385762a4118fe76364faa5819fd9a94efceefbf --- include/Nazara/Renderer/DebugDrawer.hpp | 1 + src/Nazara/Renderer/DebugDrawer.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/Nazara/Renderer/DebugDrawer.hpp b/include/Nazara/Renderer/DebugDrawer.hpp index fc632765a..1bb055c37 100644 --- a/include/Nazara/Renderer/DebugDrawer.hpp +++ b/include/Nazara/Renderer/DebugDrawer.hpp @@ -27,6 +27,7 @@ class NAZARA_API NzDebugDrawer static void Draw(const NzFrustumf& frustum); static void Draw(const NzOrientedBoxf& orientedBox); static void Draw(const NzSkeleton* skeleton); + static void Draw(const NzVector3f& position, float size = 0.1f); static void DrawBinormals(const NzStaticMesh* subMesh); static void DrawCone(const NzVector3f& origin, const NzQuaternionf& rotation, float angle, float length); static void DrawLine(const NzVector3f& p1, const NzVector3f& p2); diff --git a/src/Nazara/Renderer/DebugDrawer.cpp b/src/Nazara/Renderer/DebugDrawer.cpp index f0ee2e133..47c4388ef 100644 --- a/src/Nazara/Renderer/DebugDrawer.cpp +++ b/src/Nazara/Renderer/DebugDrawer.cpp @@ -363,6 +363,11 @@ void NzDebugDrawer::Draw(const NzSkeleton* skeleton) } } +void NzDebugDrawer::Draw(const NzVector3f& position, float size) +{ + Draw(NzBoxf(position.x - size*0.5f, position.y - size*0.5f, position.z - size*0.5f, size, size, size)); +} + void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh) { if (!Initialize())