diff --git a/include/Nazara/Renderer/DebugDrawer.hpp b/include/Nazara/Renderer/DebugDrawer.hpp index 795d56076..ac4ec906e 100644 --- a/include/Nazara/Renderer/DebugDrawer.hpp +++ b/include/Nazara/Renderer/DebugDrawer.hpp @@ -41,6 +41,7 @@ namespace Nz void Draw(CommandBufferBuilder& builder); inline void DrawBox(const Boxf& box, const Color& color); + inline void DrawBoxCorners(const EnumArray& boxCorners, const Color& color); inline void DrawFrustum(const Frustumf& frustum, const Color& color); inline void DrawLine(const Vector3f& start, const Vector3f& end, const Color& color); inline void DrawLine(const Vector3f& start, const Vector3f& end, const Color& startColor, const Color& endColor); diff --git a/include/Nazara/Renderer/DebugDrawer.inl b/include/Nazara/Renderer/DebugDrawer.inl index 934723e08..1b33e9261 100644 --- a/include/Nazara/Renderer/DebugDrawer.inl +++ b/include/Nazara/Renderer/DebugDrawer.inl @@ -26,10 +26,8 @@ namespace Nz DrawLine({ max.x, min.y, min.z }, { max.x, min.y, max.z }, color); } - inline void DebugDrawer::DrawFrustum(const Frustumf& frustum, const Color& color) + inline void DebugDrawer::DrawBoxCorners(const EnumArray& corners, const Color& color) { - EnumArray corners = frustum.ComputeCorners(); - DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearRightBottom], color); DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearLeftTop], color); DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::FarLeftBottom], color); @@ -44,6 +42,11 @@ namespace Nz DrawLine(corners[BoxCorner::NearRightBottom], corners[BoxCorner::FarRightBottom], color); } + inline void DebugDrawer::DrawFrustum(const Frustumf& frustum, const Color& color) + { + DrawBoxCorners(frustum.ComputeCorners(), color); + } + inline void DebugDrawer::DrawLine(const Vector3f& start, const Vector3f& end, const Color& color) { return DrawLine(start, end, color, color);