From 0a3ff527d9f2b86cb008d1743b2567cb849238dd Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Fri, 16 Dec 2022 00:05:03 +0800 Subject: [PATCH] SHDebugDraw drawing functions now have the colour parameter defaulted to white --- SHADE_Engine/src/Tools/SHDebugDraw.cpp | 4 +- SHADE_Engine/src/Tools/SHDebugDraw.h | 74 +++++++++++++------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/SHADE_Engine/src/Tools/SHDebugDraw.cpp b/SHADE_Engine/src/Tools/SHDebugDraw.cpp index 598c8aa6..02eca592 100644 --- a/SHADE_Engine/src/Tools/SHDebugDraw.cpp +++ b/SHADE_Engine/src/Tools/SHDebugDraw.cpp @@ -63,7 +63,7 @@ namespace SHADE dbgDrawSys->DrawCircle(mat, color, depthTested); } - void SHDebugDraw::LineLoop(const SHVec4& color, std::initializer_list pointList, bool depthTested) + void SHDebugDraw::LineLoop(std::initializer_list pointList, const SHVec4& color, bool depthTested) { dbgDrawSys->DrawLineLoop(pointList, color, depthTested); } @@ -151,7 +151,7 @@ namespace SHADE dbgDrawSys->DrawPersistentCircle(mat, color, depthTested); } - void SHDebugDraw::Persistent::LineLoop(const SHVec4& color, std::initializer_list pointList, bool depthTested) + void SHDebugDraw::Persistent::LineLoop(std::initializer_list pointList, const SHVec4& color, bool depthTested) { dbgDrawSys->DrawPersistentLineLoop(pointList, color, depthTested); } diff --git a/SHADE_Engine/src/Tools/SHDebugDraw.h b/SHADE_Engine/src/Tools/SHDebugDraw.h index 4b1f44f0..c28b93e6 100644 --- a/SHADE_Engine/src/Tools/SHDebugDraw.h +++ b/SHADE_Engine/src/Tools/SHDebugDraw.h @@ -13,6 +13,7 @@ of DigiPen Institute of Technology is prohibited. // Project Includes #include "SH_API.h" +#include "Math/SHColour.h" namespace SHADE { @@ -24,7 +25,6 @@ namespace SHADE class SHVec3; class SHQuaternion; class SHMatrix; - class SHColour; /*-----------------------------------------------------------------------------------*/ /* Type Definitions */ @@ -56,7 +56,7 @@ namespace SHADE /// Second point of the line. /// Colour of the line. /// Whether or not drawn object will be occluded. - static void Line(const SHVec3& startPt, const SHVec3& endPt, const SHVec4& color, bool depthTested = false); + static void Line(const SHVec3& startPt, const SHVec3& endPt, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Renders a triangle indicated by three points in world space. /// @@ -65,7 +65,7 @@ namespace SHADE /// Third point of the triangle. /// Colour of the triangle. /// Whether or not drawn object will be occluded. - static void Tri(const SHVec3& pt1, const SHVec3& pt2, const SHVec3& pt3, const SHVec4& color, bool depthTested = false); + static void Tri(const SHVec3& pt1, const SHVec3& pt2, const SHVec3& pt3, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Renders a quadrilateral indicated by four points in world space. /// @@ -75,7 +75,7 @@ namespace SHADE /// Third point of the quadrilateral. /// Colour of the quadrilateral. /// Whether or not drawn object will be occluded. - static void Quad(const SHVec3& pt1, const SHVec3& pt2, const SHVec3& pt3, const SHVec3& pt4, const SHVec4& color, bool depthTested = false); + static void Quad(const SHVec3& pt1, const SHVec3& pt2, const SHVec3& pt3, const SHVec3& pt4, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a 2-dimensional circle in world space. /// @@ -84,14 +84,14 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Circle(const SHMatrix& mat,const SHVec4& color, bool depthTested = false); + static void Circle(const SHMatrix& mat,const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Renders a polygon indicated by the specified set of points in world space. /// - /// Colour of the polygon. /// List of points for the polygon. + /// Colour of the polygon. /// Whether or not drawn object will be occluded. - static void LineLoop(const SHVec4& color, std::initializer_list pointList, bool depthTested = false); + static void LineLoop(std::initializer_list pointList, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled cube in world space. /// @@ -100,7 +100,7 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Cube(const SHMatrix& mat, const SHVec4& color, bool depthTested = false); + static void Cube(const SHMatrix& mat, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled cube in world space. /// @@ -108,7 +108,7 @@ namespace SHADE /// Size of the Cube. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Cube(const SHVec3& center, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Cube(const SHVec3& center, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled cube in world space. /// @@ -117,7 +117,7 @@ namespace SHADE /// Size of the Cube. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Cube(const SHVec3& center, const SHQuaternion& orientation, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Cube(const SHVec3& center, const SHQuaternion& orientation, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled cube in world space. /// @@ -126,7 +126,7 @@ namespace SHADE /// Size of the Cube. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Cube(const SHVec3& center, const SHVec3& eulerAngles, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Cube(const SHVec3& center, const SHVec3& eulerAngles, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled sphere in world space. /// @@ -135,7 +135,7 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Sphere(const SHMatrix& mat, const SHVec4& color, bool depthTested = false); + static void Sphere(const SHMatrix& mat, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled sphere in world space. /// @@ -143,7 +143,7 @@ namespace SHADE /// Size of the sphere. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Sphere(const SHVec3& center, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Sphere(const SHVec3& center, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled sphere in world space. /// @@ -151,7 +151,7 @@ namespace SHADE /// Orientation of the sphere. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Sphere(const SHVec3& center, const SHQuaternion& orientation, SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Sphere(const SHVec3& center, const SHQuaternion& orientation, SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled sphere in world space. /// @@ -159,7 +159,7 @@ namespace SHADE /// Euler angle rotation of the sphere in radians. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Sphere(const SHVec3& center, const SHVec3& eulerAngles, SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Sphere(const SHVec3& center, const SHVec3& eulerAngles, SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws the outline of a cube in world space. /// @@ -168,7 +168,7 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void WireCube(const SHMatrix& mat, const SHVec4& color, bool depthTested = false); + static void WireCube(const SHMatrix& mat, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws the outline of a cube in world space. /// @@ -176,7 +176,7 @@ namespace SHADE /// Size of the Cube. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void WireCube(const SHVec3& center, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void WireCube(const SHVec3& center, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws the wireframe of a sphere in world space. /// @@ -185,7 +185,7 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void WireSphere(const SHMatrix& mat, const SHVec4& color, bool depthTested = false); + static void WireSphere(const SHMatrix& mat, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws the wireframe of a sphere in world space. /// @@ -193,7 +193,7 @@ namespace SHADE /// Size of the sphere. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void WireSphere(const SHVec3& center, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void WireSphere(const SHVec3& center, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /*---------------------------------------------------------------------------------*/ /* Persistent Draw Function Class "Folder" */ @@ -211,7 +211,7 @@ namespace SHADE /// Second point of the line. /// Colour of the line. /// Whether or not drawn object will be occluded. - static void Line(const SHVec3& startPt, const SHVec3& endPt, const SHVec4& color, bool depthTested = false); + static void Line(const SHVec3& startPt, const SHVec3& endPt, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Renders a triangle indicated by three points in world space. /// This will remain drawn until ClearDraws() is called. @@ -221,7 +221,7 @@ namespace SHADE /// Third point of the triangle. /// Colour of the triangle. /// Whether or not drawn object will be occluded. - static void Tri(const SHVec3& pt1, const SHVec3& pt2, const SHVec3& pt3, const SHVec4& color, bool depthTested = false); + static void Tri(const SHVec3& pt1, const SHVec3& pt2, const SHVec3& pt3, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Renders a quadrilateral indicated by four points in world space. /// This will remain drawn until ClearDraws() is called. @@ -232,7 +232,7 @@ namespace SHADE /// Third point of the quadrilateral. /// Colour of the quadrilateral. /// Whether or not drawn object will be occluded. - static void Quad(const SHVec3& pt1, const SHVec3& pt2, const SHVec3& pt3, const SHVec3& pt4, const SHVec4& color, bool depthTested = false); + static void Quad(const SHVec3& pt1, const SHVec3& pt2, const SHVec3& pt3, const SHVec3& pt4, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a 2-dimensional circle in world space. /// This will remain drawn until ClearDraws() is called. @@ -242,15 +242,15 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Circle(const SHMatrix& mat,const SHVec4& color, bool depthTested = false); + static void Circle(const SHMatrix& mat,const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Renders a polygon indicated by the specified set of points in world space. /// This will remain drawn until ClearDraws() is called. /// - /// Colour of the polygon. /// List of points for the polygon. + /// Colour of the polygon. /// Whether or not drawn object will be occluded. - static void LineLoop(const SHVec4& color, std::initializer_list pointList, bool depthTested = false); + static void LineLoop(std::initializer_list pointList, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled cube in world space. /// This will remain drawn until ClearDraws() is called. @@ -260,7 +260,7 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Cube(const SHMatrix& mat, const SHVec4& color, bool depthTested = false); + static void Cube(const SHMatrix& mat, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled cube in world space. /// This will remain drawn until ClearDraws() is called. @@ -269,7 +269,7 @@ namespace SHADE /// Size of the Cube. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Cube(const SHVec3& center, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Cube(const SHVec3& center, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled cube in world space. /// This will remain drawn until ClearDraws() is called. @@ -279,7 +279,7 @@ namespace SHADE /// Size of the Cube. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Cube(const SHVec3& center, const SHQuaternion& orientation, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Cube(const SHVec3& center, const SHQuaternion& orientation, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled cube in world space. /// This will remain drawn until ClearDraws() is called. @@ -289,7 +289,7 @@ namespace SHADE /// Size of the Cube. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Cube(const SHVec3& center, const SHVec3& eulerAngles, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Cube(const SHVec3& center, const SHVec3& eulerAngles, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled sphere in world space. /// This will remain drawn until ClearDraws() is called. @@ -299,7 +299,7 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Sphere(const SHMatrix& mat, const SHVec4& color, bool depthTested = false); + static void Sphere(const SHMatrix& mat, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled sphere in world space. /// This will remain drawn until ClearDraws() is called. @@ -308,7 +308,7 @@ namespace SHADE /// Size of the sphere. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Sphere(const SHVec3& center, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Sphere(const SHVec3& center, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled sphere in world space. /// This will remain drawn until ClearDraws() is called. @@ -317,7 +317,7 @@ namespace SHADE /// Orientation of the sphere. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Sphere(const SHVec3& center, const SHQuaternion& orientation, SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Sphere(const SHVec3& center, const SHQuaternion& orientation, SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws a filled sphere in world space. /// This will remain drawn until ClearDraws() is called. @@ -326,7 +326,7 @@ namespace SHADE /// Euler angle rotation of the sphere in radians. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void Sphere(const SHVec3& center, const SHVec3& eulerAngles, SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void Sphere(const SHVec3& center, const SHVec3& eulerAngles, SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws the outline of a cube in world space. /// This will remain drawn until ClearDraws() is called. @@ -336,7 +336,7 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void WireCube(const SHMatrix& mat, const SHVec4& color, bool depthTested = false); + static void WireCube(const SHMatrix& mat, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws the outline of a cube in world space. /// This will remain drawn until ClearDraws() is called. @@ -345,7 +345,7 @@ namespace SHADE /// Size of the Cube. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void WireCube(const SHVec3& center, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void WireCube(const SHVec3& center, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws the wireframe of a sphere in world space. /// This will remain drawn until ClearDraws() is called. @@ -355,7 +355,7 @@ namespace SHADE /// /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void WireSphere(const SHMatrix& mat, const SHVec4& color, bool depthTested = false); + static void WireSphere(const SHMatrix& mat, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Draws the wireframe of a sphere in world space. /// This will remain drawn until ClearDraws() is called. @@ -364,7 +364,7 @@ namespace SHADE /// Size of the sphere. /// Colour to draw with. /// Whether or not drawn object will be occluded. - static void WireSphere(const SHVec3& center, const SHVec3& scale, const SHVec4& color, bool depthTested = false); + static void WireSphere(const SHVec3& center, const SHVec3& scale, const SHVec4& color = SHColour::WHITE, bool depthTested = false); /// /// Clears any persistent drawn debug primitives. ///