From 3bfa37019e2be364d5eff59ba891135832ca8726 Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Tue, 12 Sep 2023 10:59:07 +0200 Subject: [PATCH 01/10] DebugDraw extra fixes ray direction was dictating the length of ray now ray is normalized and multiplied by length added default vaule for Color& color to be Color::White [info] c# because Color color = Color.White is not valid think to do on c# side the default value is not genereted [to do] generate extra overload binding in c# --- Source/Engine/Debug/DebugDraw.cpp | 9 +++++++-- Source/Engine/Debug/DebugDraw.h | 13 ++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.cpp b/Source/Engine/Debug/DebugDraw.cpp index e8489f5b5..ccd247674 100644 --- a/Source/Engine/Debug/DebugDraw.cpp +++ b/Source/Engine/Debug/DebugDraw.cpp @@ -920,9 +920,14 @@ void DebugDraw::DrawActors(Actor** selectedActors, int32 selectedActorsCount, bo } } -void DebugDraw::DrawRay(const Vector3& origin, const Vector3& direction, const Color& color, float duration, bool depthTest) +void DebugDraw::DrawRay(const Vector3& origin, const Vector3& direction, Color& color, float length, float duration, bool depthTest) { - DrawLine(origin, origin + direction, color, duration, depthTest); + DrawLine(origin, origin + (direction.GetNormalized() * length), color, duration, depthTest); +} + +void DebugDraw::DrawRay(const Ray& ray, Color& color, float length, float duration, bool depthTest) +{ + DrawLine(ray.Position, ray.Position + (ray.Direction.GetNormalized() * length), color, duration, depthTest); } void DebugDraw::DrawLine(const Vector3& start, const Vector3& end, const Color& color, float duration, bool depthTest) diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index a4f69678a..5a811be7e 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -75,9 +75,20 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The origin of the line. /// The direction of the line. /// The color. + /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawRay(const Vector3& origin, const Vector3& direction, Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); + + /// + /// Draws the line in a direction. + /// + /// The ray. + /// The color. + /// The length of the ray. + /// The duration (in seconds). Use 0 to draw it only once. + /// If set to true depth test will be performed, otherwise depth will be ignored. + API_FUNCTION() static void DrawRay(const Ray& ray, Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); /// /// Draws the line. From 78ffcc8ae5781d1b6171fbfd2921dc8a844f8a0f Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:06:46 +0200 Subject: [PATCH 02/10] added other defaults --- Source/Engine/Debug/DebugDraw.h | 104 ++++++++++++++++---------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index 5a811be7e..5bd51a578 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -98,7 +98,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawLine(const Vector3& start, const Vector3& end, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawLine(const Vector3& start, const Vector3& end, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). @@ -108,7 +108,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawLines(const Span& lines, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawLines(const Span& lines, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). @@ -118,7 +118,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawLines(const Array& lines, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawLines(const Array& lines, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). @@ -128,7 +128,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawLines(const Span& lines, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawLines(const Span& lines, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). @@ -138,7 +138,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawLines(const Array& lines, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawLines(const Array& lines, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws a Bezier curve. @@ -150,7 +150,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The line color /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawBezier(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawBezier(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the circle. @@ -161,7 +161,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawCircle(const Vector3& position, const Float3& normal, float radius, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawCircle(const Vector3& position, const Float3& normal, float radius, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangle. @@ -172,7 +172,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangle(const Vector3& v0, const Vector3& v1, const Vector3& v2, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangle(const Vector3& v0, const Vector3& v1, const Vector3& v2, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangle. @@ -183,7 +183,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangle(const Vector3& v0, const Vector3& v1, const Vector3& v2, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangle(const Vector3& v0, const Vector3& v1, const Vector3& v2, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -192,7 +192,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -202,7 +202,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -211,7 +211,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -221,7 +221,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -231,7 +231,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -242,7 +242,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -252,7 +252,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Array& indices, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Array& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -263,7 +263,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Array& indices, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Array& indices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -272,7 +272,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -282,7 +282,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -291,7 +291,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -301,7 +301,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -311,7 +311,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -322,7 +322,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -332,7 +332,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Array& indices, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Array& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -343,7 +343,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Array& indices, const Matrix& transform, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Array& indices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles. @@ -352,7 +352,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangles(const Span& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles. @@ -361,7 +361,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawWireTriangles(const Array& vertices, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawWireTriangles(const Array& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles using the given index buffer. @@ -371,7 +371,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Span& indices, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Span& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles using the given index buffer. @@ -381,7 +381,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawWireTriangles(const Array& vertices, const Array& indices, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawWireTriangles(const Array& vertices, const Array& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles. @@ -390,7 +390,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangles(const Span& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles. @@ -399,7 +399,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawWireTriangles(const Array& vertices, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawWireTriangles(const Array& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles using the given index buffer. @@ -409,7 +409,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Span& indices, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Span& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles using the given index buffer. @@ -419,7 +419,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawWireTriangles(const Array& vertices, const Array& indices, const Color& color, float duration = 0.0f, bool depthTest = true); + static void DrawWireTriangles(const Array& vertices, const Array& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe box. @@ -428,7 +428,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireBox(const BoundingBox& box, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireBox(const BoundingBox& box, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe frustum. @@ -437,7 +437,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireFrustum(const BoundingFrustum& frustum, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireFrustum(const BoundingFrustum& frustum, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe box. @@ -446,7 +446,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireBox(const OrientedBoundingBox& box, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireBox(const OrientedBoundingBox& box, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe sphere. @@ -455,7 +455,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireSphere(const BoundingSphere& sphere, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireSphere(const BoundingSphere& sphere, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the sphere. @@ -464,7 +464,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawSphere(const BoundingSphere& sphere, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawSphere(const BoundingSphere& sphere, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the tube. @@ -476,7 +476,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTube(const Vector3& position, const Quaternion& orientation, float radius, float length, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTube(const Vector3& position, const Quaternion& orientation, float radius, float length, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe tube. @@ -488,7 +488,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTube(const Vector3& position, const Quaternion& orientation, float radius, float length, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTube(const Vector3& position, const Quaternion& orientation, float radius, float length, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the cylinder. @@ -500,7 +500,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawCylinder(const Vector3& position, const Quaternion& orientation, float radius, float height, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawCylinder(const Vector3& position, const Quaternion& orientation, float radius, float height, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe cylinder. @@ -512,7 +512,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireCylinder(const Vector3& position, const Quaternion& orientation, float radius, float height, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireCylinder(const Vector3& position, const Quaternion& orientation, float radius, float height, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the cone. @@ -525,7 +525,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawCone(const Vector3& position, const Quaternion& orientation, float radius, float angleXY, float angleXZ, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawCone(const Vector3& position, const Quaternion& orientation, float radius, float angleXY, float angleXZ, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe cone. @@ -538,7 +538,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireCone(const Vector3& position, const Quaternion& orientation, float radius, float angleXY, float angleXZ, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireCone(const Vector3& position, const Quaternion& orientation, float radius, float angleXY, float angleXZ, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the arc. @@ -550,7 +550,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawArc(const Vector3& position, const Quaternion& orientation, float radius, float angle, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawArc(const Vector3& position, const Quaternion& orientation, float radius, float angle, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe arc. @@ -562,7 +562,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireArc(const Vector3& position, const Quaternion& orientation, float radius, float angle, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireArc(const Vector3& position, const Quaternion& orientation, float radius, float angle, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe arrow. @@ -573,7 +573,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireArrow(const Vector3& position, const Quaternion& orientation, float scale, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireArrow(const Vector3& position, const Quaternion& orientation, float scale, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the box. @@ -582,7 +582,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawBox(const BoundingBox& box, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawBox(const BoundingBox& box, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the box. @@ -591,7 +591,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawBox(const OrientedBoundingBox& box, const Color& color, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawBox(const OrientedBoundingBox& box, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the text on a screen (2D). @@ -601,7 +601,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The font size. /// The duration (in seconds). Use 0 to draw it only once. - API_FUNCTION() static void DrawText(const StringView& text, const Float2& position, const Color& color, int32 size = 20, float duration = 0.0f); + API_FUNCTION() static void DrawText(const StringView& text, const Float2& position, Color& color = Color::White, int32 size = 20, float duration = 0.0f); /// /// Draws the text (3D) that automatically faces the camera. @@ -612,7 +612,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The font size. /// The duration (in seconds). Use 0 to draw it only once. /// The text scale. - API_FUNCTION() static void DrawText(const StringView& text, const Vector3& position, const Color& color, int32 size = 32, float duration = 0.0f, float scale = 1.0f); + API_FUNCTION() static void DrawText(const StringView& text, const Vector3& position, Color& color = Color::White, int32 size = 32, float duration = 0.0f, float scale = 1.0f); /// /// Draws the text (3D). @@ -622,7 +622,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The font size. /// The duration (in seconds). Use 0 to draw it only once. - API_FUNCTION() static void DrawText(const StringView& text, const Transform& transform, const Color& color, int32 size = 32, float duration = 0.0f); + API_FUNCTION() static void DrawText(const StringView& text, const Transform& transform, Color& color = Color::White, int32 size = 32, float duration = 0.0f); }; #define DEBUG_DRAW_RAY(origin, direction, color, duration, depthTest) DebugDraw::DrawRay(origin, direction, color, duration, depthTest) From f11ea025506967f0dacd05e9ded8daac16a39ba6 Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:08:47 +0200 Subject: [PATCH 03/10] forgot about const :sweat_smile: --- Source/Engine/Debug/DebugDraw.h | 108 ++++++++++++++++---------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index 5bd51a578..b5af321c7 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -78,7 +78,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawRay(const Vector3& origin, const Vector3& direction, Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); /// /// Draws the line in a direction. @@ -88,7 +88,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawRay(const Ray& ray, Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawRay(const Ray& ray,const Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); /// /// Draws the line. @@ -98,7 +98,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawLine(const Vector3& start, const Vector3& end, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawLine(const Vector3& start, const Vector3& end, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). @@ -108,7 +108,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawLines(const Span& lines, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawLines(const Span& lines, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). @@ -118,7 +118,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawLines(const Array& lines, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawLines(const Array& lines, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). @@ -128,7 +128,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawLines(const Span& lines, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawLines(const Span& lines, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). @@ -138,7 +138,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawLines(const Array& lines, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawLines(const Array& lines, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws a Bezier curve. @@ -150,7 +150,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The line color /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawBezier(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawBezier(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the circle. @@ -161,7 +161,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawCircle(const Vector3& position, const Float3& normal, float radius, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawCircle(const Vector3& position, const Float3& normal, float radius, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangle. @@ -172,7 +172,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangle(const Vector3& v0, const Vector3& v1, const Vector3& v2, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangle(const Vector3& v0, const Vector3& v1, const Vector3& v2, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangle. @@ -183,7 +183,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangle(const Vector3& v0, const Vector3& v1, const Vector3& v2, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangle(const Vector3& v0, const Vector3& v1, const Vector3& v2, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -192,7 +192,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -202,7 +202,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -211,7 +211,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -221,7 +221,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -231,7 +231,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -242,7 +242,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -252,7 +252,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Array& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Array& indices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -263,7 +263,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Array& indices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Array& indices, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -272,7 +272,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -282,7 +282,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -291,7 +291,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles. @@ -301,7 +301,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -311,7 +311,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -322,7 +322,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTriangles(const Span& vertices, const Span& indices, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -332,7 +332,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Array& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Array& indices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the triangles using the given index buffer. @@ -343,7 +343,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawTriangles(const Array& vertices, const Array& indices, const Matrix& transform, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawTriangles(const Array& vertices, const Array& indices, const Matrix& transform, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles. @@ -352,7 +352,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangles(const Span& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles. @@ -361,7 +361,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawWireTriangles(const Array& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawWireTriangles(const Array& vertices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles using the given index buffer. @@ -371,7 +371,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Span& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Span& indices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles using the given index buffer. @@ -381,7 +381,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawWireTriangles(const Array& vertices, const Array& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawWireTriangles(const Array& vertices, const Array& indices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles. @@ -390,7 +390,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangles(const Span& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles. @@ -399,7 +399,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawWireTriangles(const Array& vertices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawWireTriangles(const Array& vertices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles using the given index buffer. @@ -409,7 +409,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Span& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTriangles(const Span& vertices, const Span& indices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe triangles using the given index buffer. @@ -419,7 +419,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawWireTriangles(const Array& vertices, const Array& indices, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + static void DrawWireTriangles(const Array& vertices, const Array& indices, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe box. @@ -428,7 +428,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireBox(const BoundingBox& box, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireBox(const BoundingBox& box, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe frustum. @@ -437,7 +437,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireFrustum(const BoundingFrustum& frustum, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireFrustum(const BoundingFrustum& frustum, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe box. @@ -446,7 +446,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireBox(const OrientedBoundingBox& box, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireBox(const OrientedBoundingBox& box, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe sphere. @@ -455,7 +455,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireSphere(const BoundingSphere& sphere, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireSphere(const BoundingSphere& sphere, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the sphere. @@ -464,7 +464,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawSphere(const BoundingSphere& sphere, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawSphere(const BoundingSphere& sphere, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the tube. @@ -476,7 +476,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawTube(const Vector3& position, const Quaternion& orientation, float radius, float length, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawTube(const Vector3& position, const Quaternion& orientation, float radius, float length, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe tube. @@ -488,7 +488,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireTube(const Vector3& position, const Quaternion& orientation, float radius, float length, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireTube(const Vector3& position, const Quaternion& orientation, float radius, float length, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the cylinder. @@ -500,7 +500,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawCylinder(const Vector3& position, const Quaternion& orientation, float radius, float height, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawCylinder(const Vector3& position, const Quaternion& orientation, float radius, float height, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe cylinder. @@ -512,7 +512,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireCylinder(const Vector3& position, const Quaternion& orientation, float radius, float height, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireCylinder(const Vector3& position, const Quaternion& orientation, float radius, float height, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the cone. @@ -525,7 +525,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawCone(const Vector3& position, const Quaternion& orientation, float radius, float angleXY, float angleXZ, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawCone(const Vector3& position, const Quaternion& orientation, float radius, float angleXY, float angleXZ, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe cone. @@ -538,7 +538,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireCone(const Vector3& position, const Quaternion& orientation, float radius, float angleXY, float angleXZ, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireCone(const Vector3& position, const Quaternion& orientation, float radius, float angleXY, float angleXZ, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the arc. @@ -550,7 +550,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawArc(const Vector3& position, const Quaternion& orientation, float radius, float angle, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawArc(const Vector3& position, const Quaternion& orientation, float radius, float angle, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe arc. @@ -562,7 +562,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireArc(const Vector3& position, const Quaternion& orientation, float radius, float angle, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireArc(const Vector3& position, const Quaternion& orientation, float radius, float angle, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the wireframe arrow. @@ -573,7 +573,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawWireArrow(const Vector3& position, const Quaternion& orientation, float scale, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawWireArrow(const Vector3& position, const Quaternion& orientation, float scale, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the box. @@ -582,7 +582,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawBox(const BoundingBox& box, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawBox(const BoundingBox& box, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the box. @@ -591,7 +591,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawBox(const OrientedBoundingBox& box, Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawBox(const OrientedBoundingBox& box, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); /// /// Draws the text on a screen (2D). @@ -601,7 +601,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The font size. /// The duration (in seconds). Use 0 to draw it only once. - API_FUNCTION() static void DrawText(const StringView& text, const Float2& position, Color& color = Color::White, int32 size = 20, float duration = 0.0f); + API_FUNCTION() static void DrawText(const StringView& text, const Float2& position, const Color& color = Color::White, int32 size = 20, float duration = 0.0f); /// /// Draws the text (3D) that automatically faces the camera. @@ -612,7 +612,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The font size. /// The duration (in seconds). Use 0 to draw it only once. /// The text scale. - API_FUNCTION() static void DrawText(const StringView& text, const Vector3& position, Color& color = Color::White, int32 size = 32, float duration = 0.0f, float scale = 1.0f); + API_FUNCTION() static void DrawText(const StringView& text, const Vector3& position, const Color& color = Color::White, int32 size = 32, float duration = 0.0f, float scale = 1.0f); /// /// Draws the text (3D). @@ -622,7 +622,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The font size. /// The duration (in seconds). Use 0 to draw it only once. - API_FUNCTION() static void DrawText(const StringView& text, const Transform& transform, Color& color = Color::White, int32 size = 32, float duration = 0.0f); + API_FUNCTION() static void DrawText(const StringView& text, const Transform& transform, const Color& color = Color::White, int32 size = 32, float duration = 0.0f); }; #define DEBUG_DRAW_RAY(origin, direction, color, duration, depthTest) DebugDraw::DrawRay(origin, direction, color, duration, depthTest) From d107947ba9c40a851756db8ac6ca1085aea0d171 Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:19:19 +0200 Subject: [PATCH 04/10] Update DebugDraw.cpp --- Source/Engine/Debug/DebugDraw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.cpp b/Source/Engine/Debug/DebugDraw.cpp index ccd247674..2afc9d047 100644 --- a/Source/Engine/Debug/DebugDraw.cpp +++ b/Source/Engine/Debug/DebugDraw.cpp @@ -920,12 +920,12 @@ void DebugDraw::DrawActors(Actor** selectedActors, int32 selectedActorsCount, bo } } -void DebugDraw::DrawRay(const Vector3& origin, const Vector3& direction, Color& color, float length, float duration, bool depthTest) +void DebugDraw::DrawRay(const Vector3& origin, const Vector3& direction,const Color& color, float length, float duration, bool depthTest) { DrawLine(origin, origin + (direction.GetNormalized() * length), color, duration, depthTest); } -void DebugDraw::DrawRay(const Ray& ray, Color& color, float length, float duration, bool depthTest) +void DebugDraw::DrawRay(const Ray& ray,const Color& color, float length, float duration, bool depthTest) { DrawLine(ray.Position, ray.Position + (ray.Direction.GetNormalized() * length), color, duration, depthTest); } From f71f214f36c0960a820c2be35d0e547ed9a52d54 Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Wed, 13 Sep 2023 02:53:20 +0200 Subject: [PATCH 05/10] bug fix macro added extra macros --- Source/Engine/Debug/DebugDraw.cpp | 16 ++++ Source/Engine/Debug/DebugDraw.cs | 36 +++++++- Source/Engine/Debug/DebugDraw.h | 135 ++++++++++++++++++------------ 3 files changed, 132 insertions(+), 55 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.cpp b/Source/Engine/Debug/DebugDraw.cpp index 2afc9d047..733c4a643 100644 --- a/Source/Engine/Debug/DebugDraw.cpp +++ b/Source/Engine/Debug/DebugDraw.cpp @@ -920,6 +920,22 @@ void DebugDraw::DrawActors(Actor** selectedActors, int32 selectedActorsCount, bo } } +void DebugDraw::DrawAxisFromDirection(const Vector3& origin, const Vector3& direction, const Color& color , float Size, float duration, bool depthTest) +{ + auto rot = Quaternion::FromDirection(direction.GetNormalized()); + Vector3 Up = (rot * Vector3::Up ); + Vector3 Forward = (rot * Vector3::Forward); + Vector3 Right = (rot * Vector3::Right ); + + DrawLine(origin, origin + (Up * (Size * 0.5f)) + Up , Color::Green ,duration, depthTest); + DrawLine(origin, origin + (Forward * (Size * 0.5f)) + Forward, Color::Blue ,duration, depthTest); + DrawLine(origin, origin + (Right * (Size * 0.5f)) + Right , Color::Red ,duration, depthTest); +} + +void DebugDraw::DrawDirection(const Vector3& origin, const Vector3& direction, const Color& color, float duration, bool depthTest) +{ + DrawLine(origin, origin + direction, color, duration, depthTest); +} void DebugDraw::DrawRay(const Vector3& origin, const Vector3& direction,const Color& color, float length, float duration, bool depthTest) { DrawLine(origin, origin + (direction.GetNormalized() * length), color, duration, depthTest); diff --git a/Source/Engine/Debug/DebugDraw.cs b/Source/Engine/Debug/DebugDraw.cs index bc000e03d..f6a8a19f4 100644 --- a/Source/Engine/Debug/DebugDraw.cs +++ b/Source/Engine/Debug/DebugDraw.cs @@ -31,6 +31,17 @@ namespace FlaxEngine { } + /// + /// Draws the lines axis from direction. + /// + /// The origin of the line. + /// The direction of the line. + /// The color. + /// The size of the axis. + /// The duration (in seconds). Use 0 to draw it only once. + /// If set to true depth test will be performed, otherwise depth will be ignored. + static void DrawAxisFromDirection(Vector3 origin, Vector3 direction, Color color ,float Size = 100.0f, float duration = 0.0f, bool depthTest = true); + /// /// Draws the line in a direction. /// @@ -39,9 +50,28 @@ namespace FlaxEngine /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - public static void DrawRay(Vector3 origin, Vector3 direction, Color color, float duration = 0.0f, bool depthTest = true) - { - } + static void DrawDirection(Vector3 origin, Vector3 direction, Color color, float duration = 0.0f, bool depthTest = true); + + /// + /// Draws the line in a direction. + /// + /// The origin of the line. + /// The direction of the line. + /// The color. + /// The length of the ray. + /// The duration (in seconds). Use 0 to draw it only once. + /// If set to true depth test will be performed, otherwise depth will be ignored. + static void DrawRay(Vector3 origin, Vector3 direction, Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); + + /// + /// Draws the line in a direction. + /// + /// The ray. + /// The color. + /// The length of the ray. + /// The duration (in seconds). Use 0 to draw it only once. + /// If set to true depth test will be performed, otherwise depth will be ignored. + static void DrawRay(Ray ray,Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); /// /// Draws the line. diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index b5af321c7..5df31d831 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -69,6 +69,27 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// True if draw all debug shapes from scenes too or false if draw just from specified actor list. API_FUNCTION() static void DrawActors(Actor** selectedActors, int32 selectedActorsCount, bool drawScenes); + /// + /// Draws the lines axis from direction. + /// + /// The origin of the line. + /// The direction of the line. + /// The color. + /// The size of the axis. + /// The duration (in seconds). Use 0 to draw it only once. + /// If set to true depth test will be performed, otherwise depth will be ignored. + API_FUNCTION() static void DrawAxisFromDirection(const Vector3& origin, const Vector3& direction, const Color& color = Color::White ,float Size = 100.0f, float duration = 0.0f, bool depthTest = true); + + /// + /// Draws the line in a direction. + /// + /// The origin of the line. + /// The direction of the line. + /// The color. + /// The duration (in seconds). Use 0 to draw it only once. + /// If set to true depth test will be performed, otherwise depth will be ignored. + API_FUNCTION() static void DrawDirection(const Vector3& origin, const Vector3& direction, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + /// /// Draws the line in a direction. /// @@ -625,61 +646,71 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw API_FUNCTION() static void DrawText(const StringView& text, const Transform& transform, const Color& color = Color::White, int32 size = 32, float duration = 0.0f); }; -#define DEBUG_DRAW_RAY(origin, direction, color, duration, depthTest) DebugDraw::DrawRay(origin, direction, color, duration, depthTest) -#define DEBUG_DRAW_LINE(start, end, color, duration, depthTest) DebugDraw::DrawLine(start, end, color, duration, depthTest) -#define DEBUG_DRAW_LINES(lines, transform, color, duration, depthTest) DebugDraw::DrawLines(lines, transform, color, duration, depthTest) -#define DEBUG_DRAW_BEZIER(p1, p2, p3, p4, color, duration, depthTest) DebugDraw::DrawBezier(p1, p2, p3, p4, color, duration, depthTest) -#define DEBUG_DRAW_CIRCLE(position, normal, radius, color, duration, depthTest) DebugDraw::DrawCircle(position, normal, radius, color, duration, depthTest) -#define DEBUG_DRAW_TRIANGLE(v0, v1, v2, color, duration, depthTest) DebugDraw::DrawTriangle(v0, v1, v2, color, duration, depthTest) -#define DEBUG_DRAW_TRIANGLES(vertices, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, color, duration, depthTest) -#define DEBUG_DRAW_TRIANGLES_EX(vertices, indices, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, indices, color, duration, depthTest) -#define DEBUG_DRAW_TRIANGLES_EX2(vertices, indices, transform, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, indices, transform, color, duration, depthTest) -#define DEBUG_DRAW_SPHERE(sphere, color, duration, depthTest) DebugDraw::DrawSphere(sphere, color, duration, depthTest) -#define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawTube(position, orientation, radius, length, color, duration, depthTest) -#define DEBUG_DRAW_BOX(box, color, duration, depthTest) DebugDraw::DrawBox(box, color, duration, depthTest) -#define DEBUG_DRAW_CYLINDER(position, orientation, radius, height, color, duration, depthTest) DebugDraw::DrawCylinder(position, orientation, radius, height, color, duration, depthTest) -#define DEBUG_DRAW_CONE(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) DebugDraw::DrawCone(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) -#define DEBUG_DRAW_ARC(position, orientation, radius, angle, color, duration, depthTest) DebugDraw::DrawArc(position, orientation, radius, angle, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_TRIANGLE(v0, v1, v2, color, duration, depthTest) DebugDraw::DrawWireTriangle(v0, v1, v2, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_TRIANGLES(vertices, color, duration, depthTest) DebugDraw::DrawWireTriangles(vertices, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_TRIANGLES_EX(vertices, indices, color, duration, depthTest) DebugDraw::DrawWireTriangles(vertices, indices, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_BOX(box, color, duration, depthTest) DebugDraw::DrawWireBox(box, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_FRUSTUM(frustum, color, duration, depthTest) DebugDraw::DrawWireFrustum(frustum, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_SPHERE(sphere, color, duration, depthTest) DebugDraw::DrawWireSphere(sphere, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_TUBE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawWireTube(position, orientation, radius, length, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_CYLINDER(position, orientation, radius, height, color, duration, depthTest) DebugDraw::DrawWireCylinder(position, orientation, radius, height, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_CONE(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) DebugDraw::DrawWireCone(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_ARC(position, orientation, radius, angle, color, duration, depthTest) DebugDraw::DrawWireArc(position, orientation, radius, angle, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_ARROW(position, orientation, scale, color, duration, depthTest) DebugDraw::DrawWireArrow(position, orientation, scale, color, duration, depthTest) -#define DEBUG_DRAW_TEXT(text, position, color, size, duration) DebugDraw::DrawText(text, position, color, size, duration) + +#define DEBUG_DRAW_AXIS_FROM_DIRECTION(origin,direction,color,Size,duration,depthTest) DebugDraw::DrawAxisFromDirection(origin,direction,color,Size,duration,depthTest); +#define DEBUG_DRAW_DIRECTION (origin,direction,color,duration,depthTest) DebugDraw::DrawDirection(origin,direction,color,duration,depthTest); +#define DEBUG_DRAW_RAY (origin,direction,color,length,duration,depthTest) DebugDraw::DrawRay(origin,direction,color,length,duration,depthTest); +#define DEBUG_DRAW_RAY (ray,color,length,duration,depthTest) DebugDraw::DrawRay(ray,color,length,duration,depthTest); + +#define DEBUG_DRAW_LINE(start, end, color, duration, depthTest) DebugDraw::DrawLine(start, end, color, duration, depthTest) +#define DEBUG_DRAW_LINES(lines, transform, color, duration, depthTest) DebugDraw::DrawLines(lines, transform, color, duration, depthTest) +#define DEBUG_DRAW_BEZIER(p1, p2, p3, p4, color, duration, depthTest) DebugDraw::DrawBezier(p1, p2, p3, p4, color, duration, depthTest) +#define DEBUG_DRAW_CIRCLE(position, normal, radius, color, duration, depthTest) DebugDraw::DrawCircle(position, normal, radius, color, duration, depthTest) +#define DEBUG_DRAW_TRIANGLE(v0, v1, v2, color, duration, depthTest) DebugDraw::DrawTriangle(v0, v1, v2, color, duration, depthTest) +#define DEBUG_DRAW_TRIANGLES(vertices, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, color, duration, depthTest) +#define DEBUG_DRAW_TRIANGLES_EX(vertices, indices, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, indices, color, duration, depthTest) +#define DEBUG_DRAW_TRIANGLES_EX2(vertices, indices, transform, color, duration, depthTest) DebugDraw::DrawTriangles(vertices, indices, transform, color, duration, depthTest) +#define DEBUG_DRAW_SPHERE(sphere, color, duration, depthTest) DebugDraw::DrawSphere(sphere, color, duration, depthTest) +#define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawTube(position, orientation, radius, length, color, duration, depthTest) +#define DEBUG_DRAW_BOX(box, color, duration, depthTest) DebugDraw::DrawBox(box, color, duration, depthTest) +#define DEBUG_DRAW_CYLINDER(position, orientation, radius, height, color, duration, depthTest) DebugDraw::DrawCylinder(position, orientation, radius, height, color, duration, depthTest) +#define DEBUG_DRAW_CONE(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) DebugDraw::DrawCone(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) +#define DEBUG_DRAW_ARC(position, orientation, radius, angle, color, duration, depthTest) DebugDraw::DrawArc(position, orientation, radius, angle, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_TRIANGLE(v0, v1, v2, color, duration, depthTest) DebugDraw::DrawWireTriangle(v0, v1, v2, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_TRIANGLES(vertices, color, duration, depthTest) DebugDraw::DrawWireTriangles(vertices, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_TRIANGLES_EX(vertices, indices, color, duration, depthTest) DebugDraw::DrawWireTriangles(vertices, indices, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_BOX(box, color, duration, depthTest) DebugDraw::DrawWireBox(box, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_FRUSTUM(frustum, color, duration, depthTest) DebugDraw::DrawWireFrustum(frustum, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_SPHERE(sphere, color, duration, depthTest) DebugDraw::DrawWireSphere(sphere, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_TUBE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawWireTube(position, orientation, radius, length, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_CYLINDER(position, orientation, radius, height, color, duration, depthTest) DebugDraw::DrawWireCylinder(position, orientation, radius, height, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_CONE(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) DebugDraw::DrawWireCone(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_ARC(position, orientation, radius, angle, color, duration, depthTest) DebugDraw::DrawWireArc(position, orientation, radius, angle, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_ARROW(position, orientation, scale, color, duration, depthTest) DebugDraw::DrawWireArrow(position, orientation, scale, color, duration, depthTest) +#define DEBUG_DRAW_TEXT(text, position, color, size, duration) DebugDraw::DrawText(text, position, color, size, duration) #else +#define DEBUG_DRAW_AXIS_FROM_DIRECTION(origin,direction,color,Size,duration,depthTest) +#define DEBUG_DRAW_DIRECTION (origin,direction,color,duration,depthTest) +#define DEBUG_DRAW_RAY (origin,direction,color,length,duration,depthTest) +#define DEBUG_DRAW_RAY (ray,color,length,duration,depthTest) -#define DEBUG_DRAW_LINE(start, end, color, duration, depthTest) -#define DEBUG_DRAW_LINES(lines, transform, color, duration, depthTest) -#define DEBUG_DRAW_BEZIER(p1, p2, p3, p4, color, duration, depthTest) -#define DEBUG_DRAW_CIRCLE(position, normal, radius, color, duration, depthTest) -#define DEBUG_DRAW_TRIANGLE(v0, v1, v2, color, duration, depthTest) -#define DEBUG_DRAW_TRIANGLES(vertices, color, duration, depthTest) -#define DEBUG_DRAW_TRIANGLES_EX(vertices, indices, color, duration, depthTest) -#define DEBUG_DRAW_TRIANGLES_EX2(vertices, indices, transform, color, duration, depthTest) -#define DEBUG_DRAW_SPHERE(sphere, color, duration, depthTest) -#define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest) -#define DEBUG_DRAW_BOX(box, color, duration, depthTest) -#define DEBUG_DRAW_CYLINDER(position, orientation, radius, height, color, duration, depthTest) -#define DEBUG_DRAW_CONE(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) -#define DEBUG_DRAW_ARC(position, orientation, radius, angle, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_TRIANGLE(v0, v1, v2, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_TRIANGLES(vertices, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_TRIANGLES_EX(vertices, indices, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_BOX(box, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_FRUSTUM(frustum, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_SPHERE(sphere, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_TUBE(position, orientation, radius, length, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_CYLINDER(position, orientation, radius, height, color, duration, depthTest) +#define DEBUG_DRAW_RAY(origin, direction, color, duration, depthTest) +#define DEBUG_DRAW_LINE(start, end, color, duration, depthTest) +#define DEBUG_DRAW_LINES(lines, transform, color, duration, depthTest) +#define DEBUG_DRAW_BEZIER(p1, p2, p3, p4, color, duration, depthTest) +#define DEBUG_DRAW_CIRCLE(position, normal, radius, color, duration, depthTest) +#define DEBUG_DRAW_TRIANGLE(v0, v1, v2, color, duration, depthTest) +#define DEBUG_DRAW_TRIANGLES(vertices, color, duration, depthTest) +#define DEBUG_DRAW_TRIANGLES_EX(vertices, indices, color, duration, depthTest) +#define DEBUG_DRAW_TRIANGLES_EX2(vertices, indices, transform, color, duration, depthTest) +#define DEBUG_DRAW_SPHERE(sphere, color, duration, depthTest) +#define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest) +#define DEBUG_DRAW_BOX(box, color, duration, depthTest) +#define DEBUG_DRAW_CYLINDER(position, orientation, radius, height, color, duration, depthTest) +#define DEBUG_DRAW_CONE(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) +#define DEBUG_DRAW_ARC(position, orientation, radius, angle, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_TRIANGLE(v0, v1, v2, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_TRIANGLES(vertices, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_TRIANGLES_EX(vertices, indices, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_BOX(box, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_FRUSTUM(frustum, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_SPHERE(sphere, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_TUBE(position, orientation, radius, length, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_CYLINDER(position, orientation, radius, height, color, duration, depthTest) #define DEBUG_DRAW_WIRE_CONE(position, orientation, radius, angleXY, angleXZ, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_ARC(position, orientation, radius, angle, color, duration, depthTest) -#define DEBUG_DRAW_WIRE_ARROW(position, orientation, scale, color, duration, depthTest) -#define DEBUG_DRAW_TEXT(text, position, color, size, duration) +#define DEBUG_DRAW_WIRE_ARC(position, orientation, radius, angle, color, duration, depthTest) +#define DEBUG_DRAW_WIRE_ARROW(position, orientation, scale, color, duration, depthTest) +#define DEBUG_DRAW_TEXT(text, position, color, size, duration) #endif From 394a3696af4d4b040296b94de783791564faf77e Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Wed, 13 Sep 2023 02:54:17 +0200 Subject: [PATCH 06/10] removed coppy --- Source/Engine/Debug/DebugDraw.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index 5df31d831..c557fa57c 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -684,8 +684,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw #define DEBUG_DRAW_DIRECTION (origin,direction,color,duration,depthTest) #define DEBUG_DRAW_RAY (origin,direction,color,length,duration,depthTest) #define DEBUG_DRAW_RAY (ray,color,length,duration,depthTest) - -#define DEBUG_DRAW_RAY(origin, direction, color, duration, depthTest) + #define DEBUG_DRAW_LINE(start, end, color, duration, depthTest) #define DEBUG_DRAW_LINES(lines, transform, color, duration, depthTest) #define DEBUG_DRAW_BEZIER(p1, p2, p3, p4, color, duration, depthTest) From 0b3b32195abc889a334eca24cc9abf106f194126 Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:17:17 +0200 Subject: [PATCH 07/10] Update DebugDraw.cs --- Source/Engine/Debug/DebugDraw.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.cs b/Source/Engine/Debug/DebugDraw.cs index f6a8a19f4..5884fc4fa 100644 --- a/Source/Engine/Debug/DebugDraw.cs +++ b/Source/Engine/Debug/DebugDraw.cs @@ -40,7 +40,7 @@ namespace FlaxEngine /// The size of the axis. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawAxisFromDirection(Vector3 origin, Vector3 direction, Color color ,float Size = 100.0f, float duration = 0.0f, bool depthTest = true); + static void DrawAxisFromDirection(Vector3 origin, Vector3 direction, Color color ,float Size = 100.0f, float duration = 0.0f, bool depthTest = true){} /// /// Draws the line in a direction. @@ -50,7 +50,7 @@ namespace FlaxEngine /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawDirection(Vector3 origin, Vector3 direction, Color color, float duration = 0.0f, bool depthTest = true); + static void DrawDirection(Vector3 origin, Vector3 direction, Color color, float duration = 0.0f, bool depthTest = true){} /// /// Draws the line in a direction. @@ -61,7 +61,7 @@ namespace FlaxEngine /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawRay(Vector3 origin, Vector3 direction, Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); + static void DrawRay(Vector3 origin, Vector3 direction, Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true){} /// /// Draws the line in a direction. @@ -71,7 +71,9 @@ namespace FlaxEngine /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawRay(Ray ray,Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); + static void DrawRay(Ray ray,Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true) + { + } /// /// Draws the line. From 809b9e3a7ae5aef0d4a196a482cec3e641429836 Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Sun, 1 Oct 2023 16:47:33 +0200 Subject: [PATCH 08/10] added safeguards --- Source/Engine/Debug/DebugDraw.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Engine/Debug/DebugDraw.cpp b/Source/Engine/Debug/DebugDraw.cpp index 733c4a643..1e50a74be 100644 --- a/Source/Engine/Debug/DebugDraw.cpp +++ b/Source/Engine/Debug/DebugDraw.cpp @@ -934,15 +934,22 @@ void DebugDraw::DrawAxisFromDirection(const Vector3& origin, const Vector3& dire void DebugDraw::DrawDirection(const Vector3& origin, const Vector3& direction, const Color& color, float duration, bool depthTest) { + auto dir = origin + direction; + if (dir.IsNanOrInfinity()) + return; DrawLine(origin, origin + direction, color, duration, depthTest); } void DebugDraw::DrawRay(const Vector3& origin, const Vector3& direction,const Color& color, float length, float duration, bool depthTest) { + if (isnan(length) || isinf(length)) + return; DrawLine(origin, origin + (direction.GetNormalized() * length), color, duration, depthTest); } void DebugDraw::DrawRay(const Ray& ray,const Color& color, float length, float duration, bool depthTest) { + if (isnan(length) || isinf(length)) + return; DrawLine(ray.Position, ray.Position + (ray.Direction.GetNormalized() * length), color, duration, depthTest); } From 0a127249743917f5a15b86142cc0a4469fea8532 Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:04:30 +0000 Subject: [PATCH 09/10] changed the 3.402823466e+38f to MAX_float --- Source/Engine/Debug/DebugDraw.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index c557fa57c..140a11013 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -99,7 +99,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color = Color::White, float length = MAX_float, float duration = 0.0f, bool depthTest = true); /// /// Draws the line in a direction. @@ -109,7 +109,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() static void DrawRay(const Ray& ray,const Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() static void DrawRay(const Ray& ray,const Color& color = Color::White, float length = MAX_float, float duration = 0.0f, bool depthTest = true); /// /// Draws the line. From 4f67d142612410fc57a01e99835774bf93eb0c25 Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:15:31 +0000 Subject: [PATCH 10/10] forgotten the public keyword in engine/debug/debugdraw.cs --- Source/Engine/Debug/DebugDraw.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Debug/DebugDraw.cs b/Source/Engine/Debug/DebugDraw.cs index 5884fc4fa..a6fc7b3b2 100644 --- a/Source/Engine/Debug/DebugDraw.cs +++ b/Source/Engine/Debug/DebugDraw.cs @@ -40,7 +40,7 @@ namespace FlaxEngine /// The size of the axis. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawAxisFromDirection(Vector3 origin, Vector3 direction, Color color ,float Size = 100.0f, float duration = 0.0f, bool depthTest = true){} + public static void DrawAxisFromDirection(Vector3 origin, Vector3 direction, Color color ,float Size = 100.0f, float duration = 0.0f, bool depthTest = true){} /// /// Draws the line in a direction. @@ -50,7 +50,7 @@ namespace FlaxEngine /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawDirection(Vector3 origin, Vector3 direction, Color color, float duration = 0.0f, bool depthTest = true){} + public static void DrawDirection(Vector3 origin, Vector3 direction, Color color, float duration = 0.0f, bool depthTest = true){} /// /// Draws the line in a direction. @@ -61,7 +61,7 @@ namespace FlaxEngine /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawRay(Vector3 origin, Vector3 direction, Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true){} + public static void DrawRay(Vector3 origin, Vector3 direction, Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true){} /// /// Draws the line in a direction. @@ -71,7 +71,7 @@ namespace FlaxEngine /// The length of the ray. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - static void DrawRay(Ray ray,Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true) + public static void DrawRay(Ray ray,Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true) { }