From 4875e63950f0026e6813c458557556014ecaf8d8 Mon Sep 17 00:00:00 2001 From: Martin Felis Date: Tue, 23 Apr 2019 11:43:57 +0200 Subject: [PATCH] Using Vector4fs for debug draw calls. --- src/modules/RenderUtils.cc | 8 ++++---- src/modules/RenderUtils.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/RenderUtils.cc b/src/modules/RenderUtils.cc index 89f4e1c..b229bc6 100644 --- a/src/modules/RenderUtils.cc +++ b/src/modules/RenderUtils.cc @@ -1350,14 +1350,14 @@ void DebugDrawFrame(RenderProgram &program, const Matrix44f& mat) { sCoordinateFrameMesh.Draw(GL_LINES); } -void DebugDrawSphere(RenderProgram &program, const Matrix44f& mat, const Vector3f& color) { +void DebugDrawSphere(RenderProgram &program, const Matrix44f& mat, const Vector4f& color) { sVertexArray.Bind(); program.SetMat44("uModelMatrix", mat); - program.SetVec4("uColor", Vector4f (color[0], color[1], color[2], 1.0f)); + program.SetVec4("uColor", Vector4f (color[0], color[1], color[2], color[3])); sIcoSphere.Draw(GL_TRIANGLES); } -void DebugDrawBone(RenderProgram &program, const Matrix44f& mat, const Vector3f& color) { +void DebugDrawBone(RenderProgram &program, const Matrix44f& mat, const Vector4f& color) { sVertexArray.Bind(); const float sphere_size = 0.035f; @@ -1370,7 +1370,7 @@ void DebugDrawBone(RenderProgram &program, const Matrix44f& mat, const Vector3f& ); program.SetMat44("uModelMatrix", mat); - program.SetVec4("uColor", Vector4f (color[0], color[1], color[2], 1.0f)); + program.SetVec4("uColor", Vector4f (color[0], color[1], color[2], color[3])); sBoneBody.Draw(GL_TRIANGLES); DebugDrawSphere( diff --git a/src/modules/RenderUtils.h b/src/modules/RenderUtils.h index 5341c82..7d56dd4 100644 --- a/src/modules/RenderUtils.h +++ b/src/modules/RenderUtils.h @@ -614,7 +614,7 @@ void DebugDrawInitialize(); void DebugDrawShutdown(); void DebugDrawCube(RenderProgram &program, const Matrix44f& mat); void DebugDrawFrame(RenderProgram &program, const Matrix44f& mat); -void DebugDrawSphere(RenderProgram &program, const Matrix44f& mat, const Vector3f& color = Vector3f (1.0f, 1.0f, 1.0f)); -void DebugDrawBone(RenderProgram &program, const Matrix44f& mat, const Vector3f& color = Vector3f (0.1f, 0.8f, 0.4f)); +void DebugDrawSphere(RenderProgram &program, const Matrix44f& mat, const Vector4f& color = Vector4f (1.0f, 1.0f, 1.0f, 1.0f)); +void DebugDrawBone(RenderProgram &program, const Matrix44f& mat, const Vector4f& color = Vector4f (0.1f, 0.8f, 0.4f, 1.0f)); #endif