From 232a371fa5889e5354a3795c3981cb22758e77e0 Mon Sep 17 00:00:00 2001 From: HardCPP Date: Mon, 30 Apr 2018 14:49:44 +0200 Subject: [PATCH] Add normalLength parameter to the DebugDrawer::DrawNormals (#163) --- include/Nazara/Renderer/DebugDrawer.hpp | 2 +- src/Nazara/Renderer/DebugDrawer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/Nazara/Renderer/DebugDrawer.hpp b/include/Nazara/Renderer/DebugDrawer.hpp index a001b1bab..e6667e7a9 100644 --- a/include/Nazara/Renderer/DebugDrawer.hpp +++ b/include/Nazara/Renderer/DebugDrawer.hpp @@ -36,7 +36,7 @@ namespace Nz static void DrawCone(const Vector3f& origin, const Quaternionf& rotation, float angle, float length); static void DrawLine(const Vector3f& p1, const Vector3f& p2); static void DrawPoints(const Vector3f* ptr, unsigned int pointCount); - static void DrawNormals(const StaticMesh* subMesh); + static void DrawNormals(const StaticMesh* subMesh, float normalLength = 0.01f); static void DrawTangents(const StaticMesh* subMesh); static void EnableDepthBuffer(bool depthBuffer); diff --git a/src/Nazara/Renderer/DebugDrawer.cpp b/src/Nazara/Renderer/DebugDrawer.cpp index ef6136b31..08dba0d32 100644 --- a/src/Nazara/Renderer/DebugDrawer.cpp +++ b/src/Nazara/Renderer/DebugDrawer.cpp @@ -556,7 +556,7 @@ namespace Nz } } - void DebugDrawer::DrawNormals(const StaticMesh* subMesh) + void DebugDrawer::DrawNormals(const StaticMesh* subMesh, float normalLength) { if (!s_initialized && !Initialize()) { @@ -583,7 +583,7 @@ namespace Nz outputVertex->position = inputVertex->position; outputVertex++; - outputVertex->position = inputVertex->position + inputVertex->normal*0.01f; + outputVertex->position = inputVertex->position + inputVertex->normal*normalLength; outputVertex++; inputVertex++;