Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Debug::Rendering::Draw Class Reference

Static API for immediate-mode debug line drawing. More...

#include <DebugDraw.h>

Static Public Member Functions

static void setEnabled (bool enabled)
 Enable or disable debug drawing globally.
static bool isEnabled ()
 Check if debug drawing is currently enabled.
static void line (const glm::vec3 &start, const glm::vec3 &end, const glm::vec4 &color=Colors::White)
 Draw a line between two points.
static void arrow (const glm::vec3 &origin, const glm::vec3 &direction, const glm::vec4 &color=Colors::White, float headSize=0.1f)
 Draw an arrow from origin in the given direction.
static void vector (const glm::vec3 &origin, const glm::vec3 &vec, const glm::vec4 &color=Colors::White, float scale=1.0f)
 Draw a vector from origin (alias for arrow with scale)
static void axes (const glm::vec3 &origin, float size=1.0f)
 Draw coordinate axes at a position (RGB = XYZ)
static void point (const glm::vec3 &position, float size=0.05f, const glm::vec4 &color=Colors::White)
 Draw a point as a small cross.
static void box (const glm::vec3 &center, const glm::vec3 &halfExtents, const glm::vec4 &color=Colors::Green)
 Draw a wireframe box.
static void box (const glm::mat4 &transform, const glm::vec3 &halfExtents, const glm::vec4 &color=Colors::Green)
 Draw a wireframe box with transform.
static void sphere (const glm::vec3 &center, float radius, const glm::vec4 &color=Colors::Green, int segments=16)
 Draw a wireframe sphere (approximated with circles)
static void capsule (const glm::mat4 &transform, float radius, float height, const glm::vec4 &color=Colors::Green, int segments=16)
 Draw a wireframe capsule (cylinder with hemispherical ends)
static void convexHull (const std::vector< glm::vec3 > &vertices, const glm::mat4 &transform=glm::mat4(1.0f), const glm::vec4 &color=Colors::Cyan)
 Draw a convex hull from vertices.
static void triangleMesh (const std::vector< glm::vec3 > &vertices, const std::vector< uint32_t > &indices, const glm::mat4 &transform=glm::mat4(1.0f), const glm::vec4 &color=Colors::Cyan)
 Draw a triangle mesh wireframe.
static void beginFrame (Engine::Rendering::RenderProcess *renderProcess)
 Called at frame start to clear previous frame's lines.
static void setCurrentRenderProcess (Engine::Rendering::RenderProcess *renderProcess)
 Set the current render process for line accumulation.
static uint32_t getLineCount ()
 Get the number of lines in the current frame.
static uint32_t getLastLineCount ()
static uint32_t getLineCapacity ()

Static Private Member Functions

static void addLine (const glm::vec3 &start, const glm::vec3 &end, const glm::vec4 &color)
 Internal: add a single line to the buffer.

Static Private Attributes

static bool enabled_
static Engine::Rendering::RenderProcess * currentRenderProcess_

Detailed Description

Static API for immediate-mode debug line drawing.

Lines are rendered after scene geometry in Pass 2, depth-tested against the scene but not writing to depth. All lines are automatically cleared at the start of each frame.

Usage: DebugDraw::line(start, end, DebugColors::Red); DebugDraw::arrow(origin, direction, DebugColors::Green); DebugDraw::axes(position, 0.5f);

Definition at line 53 of file DebugDraw.h.

Member Function Documentation

◆ addLine()

void Engine::Debug::Rendering::Draw::addLine ( const glm::vec3 & start,
const glm::vec3 & end,
const glm::vec4 & color )
staticprivate

Internal: add a single line to the buffer.

◆ arrow()

void Engine::Debug::Rendering::Draw::arrow ( const glm::vec3 & origin,
const glm::vec3 & direction,
const glm::vec4 & color = Colors::White,
float headSize = 0.1f )
static

Draw an arrow from origin in the given direction.

Parameters
originStarting point in world space
directionDirection vector (not normalized - length determines arrow length)
colorArrow color (default: white)
headSizeSize of arrowhead relative to direction length (default: 0.1)

References Engine::Debug::Rendering::Colors::White.

◆ axes()

void Engine::Debug::Rendering::Draw::axes ( const glm::vec3 & origin,
float size = 1.0f )
static

Draw coordinate axes at a position (RGB = XYZ)

Parameters
originCenter position in world space
sizeLength of each axis (default: 1.0)

◆ beginFrame()

void Engine::Debug::Rendering::Draw::beginFrame ( Engine::Rendering::RenderProcess * renderProcess)
static

Called at frame start to clear previous frame's lines.

Parameters
renderProcessCurrent render process

◆ box() [1/2]

void Engine::Debug::Rendering::Draw::box ( const glm::mat4 & transform,
const glm::vec3 & halfExtents,
const glm::vec4 & color = Colors::Green )
static

Draw a wireframe box with transform.

Parameters
transformWorld transform matrix
halfExtentsHalf-size in each axis (local space)
colorBox color (default: green)

References Engine::Debug::Rendering::Colors::Green.

◆ box() [2/2]

void Engine::Debug::Rendering::Draw::box ( const glm::vec3 & center,
const glm::vec3 & halfExtents,
const glm::vec4 & color = Colors::Green )
static

Draw a wireframe box.

Parameters
centerCenter of the box in world space
halfExtentsHalf-size in each axis
colorBox color (default: green)

References Engine::Debug::Rendering::Colors::Green.

◆ capsule()

void Engine::Debug::Rendering::Draw::capsule ( const glm::mat4 & transform,
float radius,
float height,
const glm::vec4 & color = Colors::Green,
int segments = 16 )
static

Draw a wireframe capsule (cylinder with hemispherical ends)

Parameters
transformWorld transform matrix (capsule aligned along local Y axis)
radiusCapsule radius
heightHeight of the cylindrical portion
colorCapsule color (default: green)
segmentsNumber of segments per circle (default: 16)

References Engine::Debug::Rendering::Colors::Green.

◆ convexHull()

void Engine::Debug::Rendering::Draw::convexHull ( const std::vector< glm::vec3 > & vertices,
const glm::mat4 & transform = glm::mat4(1.0f),
const glm::vec4 & color = Colors::Cyan )
static

Draw a convex hull from vertices.

Parameters
verticesArray of vertex positions
transformWorld transform to apply
colorHull color (default: cyan)

References Engine::Debug::Rendering::Colors::Cyan.

◆ getLastLineCount()

uint32_t Engine::Debug::Rendering::Draw::getLastLineCount ( )
static

◆ getLineCapacity()

uint32_t Engine::Debug::Rendering::Draw::getLineCapacity ( )
static

◆ getLineCount()

uint32_t Engine::Debug::Rendering::Draw::getLineCount ( )
static

Get the number of lines in the current frame.

Returns
Line count

◆ isEnabled()

bool Engine::Debug::Rendering::Draw::isEnabled ( )
static

Check if debug drawing is currently enabled.

Returns
true if enabled

◆ line()

void Engine::Debug::Rendering::Draw::line ( const glm::vec3 & start,
const glm::vec3 & end,
const glm::vec4 & color = Colors::White )
static

Draw a line between two points.

Parameters
startStarting point in world space
endEnding point in world space
colorLine color (default: white)

References Engine::Debug::Rendering::Colors::White.

◆ point()

void Engine::Debug::Rendering::Draw::point ( const glm::vec3 & position,
float size = 0.05f,
const glm::vec4 & color = Colors::White )
static

Draw a point as a small cross.

Parameters
positionPoint position in world space
sizeSize of the cross (default: 0.05)
colorPoint color (default: white)

References Engine::Debug::Rendering::Colors::White.

◆ setCurrentRenderProcess()

void Engine::Debug::Rendering::Draw::setCurrentRenderProcess ( Engine::Rendering::RenderProcess * renderProcess)
static

Set the current render process for line accumulation.

Parameters
renderProcessCurrent render process

◆ setEnabled()

void Engine::Debug::Rendering::Draw::setEnabled ( bool enabled)
static

Enable or disable debug drawing globally.

Parameters
enabledtrue to enable, false to disable

◆ sphere()

void Engine::Debug::Rendering::Draw::sphere ( const glm::vec3 & center,
float radius,
const glm::vec4 & color = Colors::Green,
int segments = 16 )
static

Draw a wireframe sphere (approximated with circles)

Parameters
centerCenter of the sphere in world space
radiusSphere radius
colorSphere color (default: green)
segmentsNumber of segments per circle (default: 16)

References Engine::Debug::Rendering::Colors::Green.

◆ triangleMesh()

void Engine::Debug::Rendering::Draw::triangleMesh ( const std::vector< glm::vec3 > & vertices,
const std::vector< uint32_t > & indices,
const glm::mat4 & transform = glm::mat4(1.0f),
const glm::vec4 & color = Colors::Cyan )
static

Draw a triangle mesh wireframe.

Parameters
verticesArray of vertex positions
indicesTriangle indices
transformWorld transform to apply
colorMesh color (default: cyan)

References Engine::Debug::Rendering::Colors::Cyan.

◆ vector()

void Engine::Debug::Rendering::Draw::vector ( const glm::vec3 & origin,
const glm::vec3 & vec,
const glm::vec4 & color = Colors::White,
float scale = 1.0f )
static

Draw a vector from origin (alias for arrow with scale)

Parameters
originStarting point in world space
vecVector to draw
colorVector color (default: white)
scaleScale factor for the vector (default: 1.0)

References Engine::Debug::Rendering::Colors::White.

Member Data Documentation

◆ currentRenderProcess_

Engine::Rendering::RenderProcess* Engine::Debug::Rendering::Draw::currentRenderProcess_
staticprivate

Definition at line 241 of file DebugDraw.h.

◆ enabled_

bool Engine::Debug::Rendering::Draw::enabled_
staticprivate

Definition at line 240 of file DebugDraw.h.


The documentation for this class was generated from the following file:
  • /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/Debug/DebugDraw.h