SHDebugDraw drawing functions now have the colour parameter defaulted to white

This commit is contained in:
Kah Wei 2022-12-16 00:05:03 +08:00
parent 77a164cefb
commit 0a3ff527d9
2 changed files with 39 additions and 39 deletions

View File

@ -63,7 +63,7 @@ namespace SHADE
dbgDrawSys->DrawCircle(mat, color, depthTested);
}
void SHDebugDraw::LineLoop(const SHVec4& color, std::initializer_list<SHVec3> pointList, bool depthTested)
void SHDebugDraw::LineLoop(std::initializer_list<SHVec3> 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<SHVec3> pointList, bool depthTested)
void SHDebugDraw::Persistent::LineLoop(std::initializer_list<SHVec3> pointList, const SHVec4& color, bool depthTested)
{
dbgDrawSys->DrawPersistentLineLoop(pointList, color, depthTested);
}

View File

@ -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
/// <param name="endPt">Second point of the line.</param>
/// <param name="color">Colour of the line.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Renders a triangle indicated by three points in world space.
/// </summary>
@ -65,7 +65,7 @@ namespace SHADE
/// <param name="pt3">Third point of the triangle.</param>
/// <param name="color">Colour of the triangle.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Renders a quadrilateral indicated by four points in world space.
/// </summary>
@ -75,7 +75,7 @@ namespace SHADE
/// <param name="pt4">Third point of the quadrilateral.</param>
/// <param name="color">Colour of the quadrilateral.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a 2-dimensional circle in world space.
/// </summary>
@ -84,14 +84,14 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Renders a polygon indicated by the specified set of points in world space.
/// </summary>
/// <param name="color">Colour of the polygon.</param>
/// <param name="pointList">List of points for the polygon.</param>
/// <param name="color">Colour of the polygon.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
static void LineLoop(const SHVec4& color, std::initializer_list<SHVec3> pointList, bool depthTested = false);
static void LineLoop(std::initializer_list<SHVec3> pointList, const SHVec4& color = SHColour::WHITE, bool depthTested = false);
/// <summary>
/// Draws a filled cube in world space.
/// </summary>
@ -100,7 +100,7 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled cube in world space.
/// </summary>
@ -108,7 +108,7 @@ namespace SHADE
/// <param name="scale">Size of the Cube.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled cube in world space.
/// </summary>
@ -117,7 +117,7 @@ namespace SHADE
/// <param name="scale">Size of the Cube.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled cube in world space.
/// </summary>
@ -126,7 +126,7 @@ namespace SHADE
/// <param name="scale">Size of the Cube.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled sphere in world space.
/// </summary>
@ -135,7 +135,7 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled sphere in world space.
/// </summary>
@ -143,7 +143,7 @@ namespace SHADE
/// <param name="scale">Size of the sphere.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled sphere in world space.
/// </summary>
@ -151,7 +151,7 @@ namespace SHADE
/// <param name="orientation">Orientation of the sphere.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled sphere in world space.
/// </summary>
@ -159,7 +159,7 @@ namespace SHADE
/// <param name="eulerAngles">Euler angle rotation of the sphere in radians.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws the outline of a cube in world space.
/// </summary>
@ -168,7 +168,7 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws the outline of a cube in world space.
/// </summary>
@ -176,7 +176,7 @@ namespace SHADE
/// <param name="scale">Size of the Cube.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws the wireframe of a sphere in world space.
/// </summary>
@ -185,7 +185,7 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws the wireframe of a sphere in world space.
/// </summary>
@ -193,7 +193,7 @@ namespace SHADE
/// <param name="scale">Size of the sphere.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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
/// <param name="endPt">Second point of the line.</param>
/// <param name="color">Colour of the line.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Renders a triangle indicated by three points in world space.
/// This will remain drawn until ClearDraws() is called.
@ -221,7 +221,7 @@ namespace SHADE
/// <param name="pt3">Third point of the triangle.</param>
/// <param name="color">Colour of the triangle.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Renders a quadrilateral indicated by four points in world space.
/// This will remain drawn until ClearDraws() is called.
@ -232,7 +232,7 @@ namespace SHADE
/// <param name="pt4">Third point of the quadrilateral.</param>
/// <param name="color">Colour of the quadrilateral.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a 2-dimensional circle in world space.
/// This will remain drawn until ClearDraws() is called.
@ -242,15 +242,15 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Renders a polygon indicated by the specified set of points in world space.
/// This will remain drawn until ClearDraws() is called.
/// </summary>
/// <param name="color">Colour of the polygon.</param>
/// <param name="pointList">List of points for the polygon.</param>
/// <param name="color">Colour of the polygon.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
static void LineLoop(const SHVec4& color, std::initializer_list<SHVec3> pointList, bool depthTested = false);
static void LineLoop(std::initializer_list<SHVec3> pointList, const SHVec4& color = SHColour::WHITE, bool depthTested = false);
/// <summary>
/// Draws a filled cube in world space.
/// This will remain drawn until ClearDraws() is called.
@ -260,7 +260,7 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled cube in world space.
/// This will remain drawn until ClearDraws() is called.
@ -269,7 +269,7 @@ namespace SHADE
/// <param name="scale">Size of the Cube.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled cube in world space.
/// This will remain drawn until ClearDraws() is called.
@ -279,7 +279,7 @@ namespace SHADE
/// <param name="scale">Size of the Cube.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled cube in world space.
/// This will remain drawn until ClearDraws() is called.
@ -289,7 +289,7 @@ namespace SHADE
/// <param name="scale">Size of the Cube.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled sphere in world space.
/// This will remain drawn until ClearDraws() is called.
@ -299,7 +299,7 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled sphere in world space.
/// This will remain drawn until ClearDraws() is called.
@ -308,7 +308,7 @@ namespace SHADE
/// <param name="scale">Size of the sphere.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled sphere in world space.
/// This will remain drawn until ClearDraws() is called.
@ -317,7 +317,7 @@ namespace SHADE
/// <param name="orientation">Orientation of the sphere.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws a filled sphere in world space.
/// This will remain drawn until ClearDraws() is called.
@ -326,7 +326,7 @@ namespace SHADE
/// <param name="eulerAngles">Euler angle rotation of the sphere in radians.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws the outline of a cube in world space.
/// This will remain drawn until ClearDraws() is called.
@ -336,7 +336,7 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws the outline of a cube in world space.
/// This will remain drawn until ClearDraws() is called.
@ -345,7 +345,7 @@ namespace SHADE
/// <param name="scale">Size of the Cube.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws the wireframe of a sphere in world space.
/// This will remain drawn until ClearDraws() is called.
@ -355,7 +355,7 @@ namespace SHADE
/// </param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Draws the wireframe of a sphere in world space.
/// This will remain drawn until ClearDraws() is called.
@ -364,7 +364,7 @@ namespace SHADE
/// <param name="scale">Size of the sphere.</param>
/// <param name="color">Colour to draw with.</param>
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
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);
/// <summary>
/// Clears any persistent drawn debug primitives.
/// </summary>