diff --git a/Source/Engine/Debug/DebugDraw.cs b/Source/Engine/Debug/DebugDraw.cs index 62843428f..2387600c7 100644 --- a/Source/Engine/Debug/DebugDraw.cs +++ b/Source/Engine/Debug/DebugDraw.cs @@ -2,6 +2,8 @@ #if !FLAX_EDITOR using System; +#pragma warning disable 1591 + namespace FlaxEngine { /// @@ -11,332 +13,209 @@ namespace FlaxEngine [Tooltip("The debug shapes rendering service. Not available in final game. For use only in the editor.")] public static unsafe partial class DebugDraw { - /// - /// Draws the collected debug shapes to the output. - /// - /// The rendering context. - /// The rendering output surface handle. - /// The custom depth texture used for depth test. Can be MSAA. Must match target surface size. - /// True if perform manual depth test with scene depth buffer when rendering the primitives. Uses custom shader and the scene depth buffer. public static void Draw(ref RenderContext renderContext, GPUTextureView target = null, GPUTextureView depthBuffer = null, bool enableDepthTest = false) { } - /// - /// Draws the debug shapes for the given collection of selected actors and other scene actors debug shapes. - /// - /// The list of actors to draw. - /// The size of the list of actors. - public static void DrawActors(IntPtr selectedActors, int selectedActorsCount) + public static void DrawActors(IntPtr selectedActors, int 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. - 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. - /// - /// 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. - public 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. - 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. - /// - /// 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. - public static void DrawRay(Ray ray,Color color, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true) + public static void DrawAxisFromDirection(Vector3 origin, Vector3 direction, float size = 100.0f, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawDirection(Vector3 origin, Vector3 direction, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + [Obsolete("Use DrawRay with length parameter instead")] + public static void DrawRay(Vector3 origin, Vector3 direction, Color color, float duration, bool depthTest) + { + } + + public static void DrawRay(Vector3 origin, Vector3 direction, Color color, float length = float.MaxValue, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawRay(Ray ray, Color color, float length = float.MaxValue, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the line. - /// - /// The start point. - /// The end point. - /// 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 DrawLine(Vector3 start, Vector3 end, Color color, 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,...). - /// - /// The list of vertices for lines (must have multiple of 2 elements). - /// The custom matrix used to transform all line vertices. - /// 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 DrawLines(Vector3[] lines, Matrix transform, Color color, float duration = 0.0f, bool depthTest = true) + public static void DrawLine(Vector3 start, Vector3 end, Color startColor, Color endColor, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the circle. - /// - /// The center position. - /// The normal vector direction. - /// The radius. - /// 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 DrawCircle(Vector3 position, Vector3 normal, float radius, Color color, float duration = 0.0f, bool depthTest = true) + public static void DrawLines(Float3[] lines, Matrix transform, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawLines(GPUBuffer lines, Matrix transform, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawLines(Double3[] lines, Matrix transform, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawBezier(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawCircle(Vector3 position, Float3 normal, float radius, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe triangle. - /// - /// The first triangle vertex. - /// The second triangle vertex. - /// The third triangle vertex. - /// 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 DrawWireTriangle(Vector3 v0, Vector3 v1, Vector3 v2, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the triangle. - /// - /// The first triangle vertex. - /// The second triangle vertex. - /// The third triangle vertex. - /// 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 DrawTriangle(Vector3 v0, Vector3 v1, Vector3 v2, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the triangles. - /// - /// The triangle vertices list (must have multiple of 3 elements). - /// 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 DrawTriangles(Vector3[] vertices, Color color, float duration = 0.0f, bool depthTest = true) + public static void DrawTriangles(Float3[] vertices, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the triangles using the given index buffer. - /// - /// The triangle vertices list. - /// The triangle indices list (must have multiple of 3 elements). - /// 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 DrawTriangles(Vector3[] vertices, int[] indices, Color color, float duration = 0.0f, bool depthTest = true) + public static void DrawTriangles(Float3[] vertices, Matrix transform, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawTriangles(Float3[] vertices, int[] indices, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawTriangles(Float3[] vertices, int[] indices, Matrix transform, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawTriangles(Double3[] vertices, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawTriangles(Double3[] vertices, Matrix transform, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawTriangles(Double3[] vertices, int[] indices, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawTriangles(Double3[] vertices, int[] indices, Matrix transform, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawWireTriangles(Float3[] vertices, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawWireTriangles(Float3[] vertices, int[] indices, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawWireTriangles(Double3[] vertices, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawWireTriangles(Double3[] vertices, int[] indices, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe box. - /// - /// The box. - /// 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 DrawWireBox(BoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe frustum. - /// - /// The frustum. - /// 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 DrawWireFrustum(BoundingFrustum frustum, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe box. - /// - /// The box. - /// 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 DrawWireBox(OrientedBoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe sphere. - /// - /// The sphere. - /// 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 DrawWireSphere(BoundingSphere sphere, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the sphere. - /// - /// The sphere. - /// 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. + [Unmanaged] public static void DrawSphere(BoundingSphere sphere, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe tube. - /// - /// The center position. - /// The orientation. - /// The radius. - /// The length. - /// 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. + [Obsolete("Depricated v1.10, use DrawCapsule instead.")] + public static void DrawTube(Vector3 position, Quaternion orientation, float radius, float length, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawCapsule(Vector3 position, Quaternion orientation, float radius, float length, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + [Obsolete("Depricated v1.10, use DrawWireCapsule instead.")] public static void DrawWireTube(Vector3 position, Quaternion orientation, float radius, float length, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe cylinder. - /// - /// The center position. - /// The orientation. - /// The radius. - /// The height. - /// 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 DrawWireCapsule(Vector3 position, Quaternion orientation, float radius, float length, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawCylinder(Vector3 position, Quaternion orientation, float radius, float height, Color color, float duration = 0.0f, bool depthTest = true) + { + } + public static void DrawWireCylinder(Vector3 position, Quaternion orientation, float radius, float height, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe arrow. - /// - /// The arrow origin position. - /// The orientation (defines the arrow direction). - /// The arrow scale (used to adjust the arrow size). - /// The arrow cap scale. - /// 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 DrawWireArrow(Vector3 position, Quaternion orientation, float scale, float capScale, Color color, float duration = 0.0f, bool depthTest = true) - { - } - - /// - /// Draws the box. - /// - /// The box. - /// 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 DrawBox(BoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) - { - } - - /// - /// Draws the box. - /// - /// The box. - /// 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 DrawBox(OrientedBoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) - { - } - - /// - /// Draws the arc. - /// - /// The center position. - /// The orientation. - /// The radius. - /// The angle (in radians) of the arc (arc is facing positive Z axis - forward). Use PI*2 for full disc (360 degrees). - /// 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 DrawArc(Vector3 position, Quaternion orientation, float radius, float angle, Color color, float duration = 0.0f, bool depthTest = true) - { - } - - /// - /// Draws the wireframe arc. - /// - /// The center position. - /// The orientation. - /// The radius. - /// The angle (in radians) of the arc (arc is facing positive Z axis - forward). Use PI*2 for full disc (360 degrees). - /// 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 DrawWireArc(Vector3 position, Quaternion orientation, float radius, float angle, Color color, float duration = 0.0f, bool depthTest = true) - { - } - - /// - /// Draws the cone. - /// - /// The center position. - /// The orientation. - /// The radius. - /// The angle (in radians) of the cone over the XY axis (cone forward is over X). - /// The angle (in radians) of the cone over the XZ axis (cone forward is over X). - /// 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 DrawCone(Vector3 position, Quaternion orientation, float radius, float angleXY, float angleXZ, Color color, float duration = 0.0f, bool depthTest = true) { } - /// - /// Draws the wireframe cone. - /// - /// The center position. - /// The orientation. - /// The radius. - /// The angle (in radians) of the cone over the XY axis (cone forward is over X). - /// The angle (in radians) of the cone over the XZ axis (cone forward is over X). - /// 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 DrawWireCone(Vector3 position, Quaternion orientation, float radius, float angleXY, float angleXZ, Color color, float duration = 0.0f, bool depthTest = true) { } + + public static void DrawArc(Vector3 position, Quaternion orientation, float radius, float angle, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawWireArc(Vector3 position, Quaternion orientation, float radius, float angle, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawWireArrow(Vector3 position, Quaternion orientation, float scale, float capScale, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawBox(BoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawBox(OrientedBoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) + { + } + + public static void DrawText(string text, Float2 position, Color color, int size = 20, float duration = 0.0f) + { + } + + public static void DrawText(string text, Vector3 position, Color color, int size = 32, float duration = 0.0f, float scale = 1.0f) + { + } + + public static void DrawText(string text, Transform transform, Color color, int size = 32, float duration = 0.0f) + { + } + + public static void Clear(IntPtr context = new IntPtr()) + { + } } } #endif diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index 00b52a4c5..84e223434 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -556,6 +556,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// /// Draws the tube. + /// [Deprecated in v1.10] /// /// The center position. /// The orientation. @@ -580,6 +581,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// /// Draws the wireframe tube. + /// [Deprecated in v1.10] /// /// The center position. /// The orientation. @@ -757,7 +759,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw #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) -// Deprecated v1.10. Use DEBUG_DRAW_CAPSULE +// [Deprecated v1.10. Use DEBUG_DRAW_CAPSULE] #define DEBUG_DRAW_TUBE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawCapsule(position, orientation, radius, length, color, duration, depthTest) #define DEBUG_DRAW_CAPSULE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawCapsule(position, orientation, radius, length, color, duration, depthTest) #define DEBUG_DRAW_BOX(box, color, duration, depthTest) DebugDraw::DrawBox(box, color, duration, depthTest) @@ -770,7 +772,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw #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) -// Deprecated v1.10. Use DEBUG_DRAW_WIRE_CAPSULE +// [Deprecated v1.10. Use DEBUG_DRAW_WIRE_CAPSULE] #define DEBUG_DRAW_WIRE_TUBE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawWireCapsule(position, orientation, radius, length, color, duration, depthTest) #define DEBUG_DRAW_WIRE_CAPSULE(position, orientation, radius, length, color, duration, depthTest) DebugDraw::DrawWireCapsule(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)