DebugDraw
- Module
- DebugDraw
- Header
#include "Tools/DebugDraw.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
DebugDraw(const DebugDraw&) = delete | DebugDraw |
Public functions
| Returns | Name | Description |
|---|---|---|
DebugDraw& | Get | |
const std::vector<FDebugDrawCategoryInfo>& | Categories | |
bool | IsCategoryEnabled | |
void | SetCategoryEnabled | |
uint32_t | GetCategoryMask | |
void | SetActiveCategory | |
EDebugDrawCategory | GetActiveCategory | |
DebugDraw& | operator= | |
void | DrawLine | Drawing primitives (call from main thread during update) |
void | DrawRay | |
void | DrawArrow | |
void | DrawBox | |
void | DrawBox | |
void | DrawSphere | |
void | DrawCapsule | |
void | DrawCircle | |
void | DrawArc | |
void | DrawGrid | |
void | SetDepthTestEnabled | Depth test toggle (for subsequent draw calls) |
bool | IsDepthTestEnabled | |
void | DrawLineWithDepthTest | |
void | DrawLinesWithDepthTest | |
void | DrawThickLine | The line batcher. |
void | DrawThickPolyline | |
void | DrawThickCircle | |
void | DrawScreenPoint | A round dot of constant screen size: a zero-length segment, whose round caps are the dot. |
void | DrawSolidTriangle | |
void | DrawThickBox | Thick versions of the shapes above, for component visualisers. |
void | DrawThickSphere | |
void | DrawThickCapsule | Y-up capsule: halfHeight is the cylinder's, the caps extend past it. |
void | DrawThickFrustum | The eight corners of NDC depth 0..1 through the inverse. |
void | DrawThickCone | A spot light's cone: base circle of radius tan(halfAngle) * length and four edges from the apex. |
void | DrawThickArrow | |
void | ClearPersistent | |
size_t | GetPersistentCount | |
void | EndFrame | Swap buffers: main thread calls EndFrame(), render thread reads back buffer |
const std::vector<DebugDrawVertex>& | GetRenderVertices | Get vertices for rendering (call from render thread) |
const std::vector<DebugDrawVertex>& | GetRenderVerticesNoDepth | |
bool | HasVertices | |
bool | HasVerticesNoDepth | |
const std::vector<FDebugPrimitive>& | GetRenderPrimitives | |
const std::vector<FDebugPrimitive>& | GetPendingPrimitives | The primitives recorded since the last EndFrame, before the swap — what a test inspects to see what one call emitted. |
void | SetEnabled | |
bool | IsEnabled | |
FDebugPrimitive | MakeSegment | |
FDebugPrimitive | MakeTriangle |
Function details
DebugDraw
DebugDraw(const DebugDraw&) = deleteGet
static DebugDraw& Get()Categories
static const std::vector<FDebugDrawCategoryInfo>& Categories()IsCategoryEnabled
bool IsCategoryEnabled(EDebugDrawCategory category) constSetCategoryEnabled
void SetCategoryEnabled(EDebugDrawCategory category, bool enabled)GetCategoryMask
uint32_t GetCategoryMask() constSetActiveCategory
void SetActiveCategory(EDebugDrawCategory category)GetActiveCategory
EDebugDrawCategory GetActiveCategory() constoperator=
DebugDraw& operator=(const DebugDraw&) = deleteDrawLine
void DrawLine(const Vec3& a, const Vec3& b, const Vec4& color = Vec4(1, 1, 1, 1))Drawing primitives (call from main thread during update)
DrawRay
void DrawRay(const Vec3& origin, const Vec3& direction, float length, const Vec4& color = Vec4(1, 1, 0, 1))DrawArrow
void DrawArrow(const Vec3& from, const Vec3& to, const Vec4& color = Vec4(1, 1, 0, 1), float headSize = 0.15f)DrawBox
void DrawBox(const Vec3& center, const Vec3& extents, const Vec4& color = Vec4(0, 1, 0, 1))DrawBox
void DrawBox(const Vec3& center, const Vec3& extents, const Mat4& rotation, const Vec4& color = Vec4(0, 1, 0, 1))DrawSphere
void DrawSphere(const Vec3& center, float radius, const Vec4& color = Vec4(0, 0.5f, 1, 1), int segments = 16)DrawCapsule
void DrawCapsule(const Vec3& center, float radius, float halfHeight, const Vec4& color = Vec4(0, 0.5f, 1, 1), int segments = 12)DrawCircle
void DrawCircle(const Vec3& center, const Vec3& normal, float radius, const Vec4& color = Vec4(1, 1, 1, 1), int segments = 32)DrawArc
void DrawArc(const Vec3& center, const Vec3& direction, const Vec3& up, float radius, float halfAngleDeg, const Vec4& color = Vec4(1, 1, 1, 1), int segments = 24)DrawGrid
void DrawGrid(float size, int divisions, const Vec4& color = Vec4(0.3f, 0.3f, 0.3f, 1.0f))SetDepthTestEnabled
void SetDepthTestEnabled(bool enabled)Depth test toggle (for subsequent draw calls)
IsDepthTestEnabled
bool IsDepthTestEnabled() constDrawLineWithDepthTest
void DrawLineWithDepthTest(const Vec3& a, const Vec3& b, const Vec4& color, bool depthTest)DrawLinesWithDepthTest
void DrawLinesWithDepthTest(const std::vector<DebugDrawVertex>& vertices, bool depthTest)DrawThickLine
void DrawThickLine(const Vec3& a, const Vec3& b, const Vec4& color, const FDebugLineStyle& style)The line batcher. DrawLine above stays the cheap one-pixel path for bulk debug geometry (a navmesh is hundreds of thousands of edges); these are the anti-aliased, screen-space-thick primitives the editor's own overlays draw with, batched into one stream per depth priority and drawn after the selection outline.
DrawThickPolyline
void DrawThickPolyline(const Vec3* points, uint32_t count, bool closed, const Vec4& color, const FDebugLineStyle& style)DrawThickCircle
void DrawThickCircle(const Vec3& center, const Vec3& normal, float radius, const Vec4& color, const FDebugLineStyle& style, int32_t segments = 48)DrawScreenPoint
void DrawScreenPoint(const Vec3& position, float diameterPx, const Vec4& color, const FDebugLineStyle& style)A round dot of constant screen size: a zero-length segment, whose round caps are the dot.
DrawSolidTriangle
void DrawSolidTriangle(const Vec3& a, const Vec3& b, const Vec3& c, const Vec4& color, EDebugDepthPriority priority, float lifetime = 0.0f)DrawThickBox
void DrawThickBox(const Vec3& center, const Vec3& extents, const Mat4& rotation, const Vec4& color, const FDebugLineStyle& style)Thick versions of the shapes above, for component visualisers.
DrawThickSphere
void DrawThickSphere(const Vec3& center, float radius, const Vec4& color, const FDebugLineStyle& style, int32_t segments = 32)DrawThickCapsule
void DrawThickCapsule(const Vec3& center, float radius, float halfHeight, const Vec4& color, const FDebugLineStyle& style, int32_t segments = 24)Y-up capsule: halfHeight is the cylinder's, the caps extend past it.
DrawThickFrustum
void DrawThickFrustum(const Mat4& viewProj, const Vec4& color, const FDebugLineStyle& style)The eight corners of NDC depth 0..1 through the inverse.
DrawThickCone
void DrawThickCone(const Vec3& apex, const Vec3& direction, float length, float halfAngleDeg, const Vec4& color, const FDebugLineStyle& style, int32_t segments = 32)A spot light's cone: base circle of radius tan(halfAngle) * length and four edges from the apex.
DrawThickArrow
void DrawThickArrow(const Vec3& from, const Vec3& to, const Vec4& color, const FDebugLineStyle& style, float headSize = 0.15f)ClearPersistent
void ClearPersistent()GetPersistentCount
size_t GetPersistentCount() constEndFrame
void EndFrame()Swap buffers: main thread calls EndFrame(), render thread reads back buffer
GetRenderVertices
const std::vector<DebugDrawVertex>& GetRenderVertices() constGet vertices for rendering (call from render thread)
GetRenderVerticesNoDepth
const std::vector<DebugDrawVertex>& GetRenderVerticesNoDepth() constHasVertices
bool HasVertices() constHasVerticesNoDepth
bool HasVerticesNoDepth() constGetRenderPrimitives
const std::vector<FDebugPrimitive>& GetRenderPrimitives(EDebugDepthPriority priority) constGetPendingPrimitives
const std::vector<FDebugPrimitive>& GetPendingPrimitives(EDebugDepthPriority priority) constThe primitives recorded since the last EndFrame, before the swap — what a test inspects to see what one call emitted.
SetEnabled
void SetEnabled(bool enabled)IsEnabled
bool IsEnabled() constMakeSegment
static FDebugPrimitive MakeSegment(const Vec3& a, const Vec3& b, const Vec4& color, float thicknessPx, float haloPx)MakeTriangle
static FDebugPrimitive MakeTriangle(const Vec3& a, const Vec3& b, const Vec3& c, const Vec4& color)