Ocular Engine
Ocular::Graphics::Debug Class Reference

Draws debug graphics such as lines, points, bounding volumes, axis, etc. More...

#include <DebugGraphics.hpp>

Public Member Functions

void addLine (Math::Vector3f const &start, Math::Vector3f const &stop, Core::Color const &color, uint64_t lifetime)
 
void addCircle (Math::Vector3f const &center, float radius, Math::Vector3f const &normal, Core::Color const &color, uint32_t segments, uint64_t lifetime)
 
void render ()
 

Protected Member Functions

bool fetchMaterial ()
 
void removeDeadShapes ()
 

Protected Attributes

Materialm_Material
 Flat shader material used to render all debug shapes.
 
Math::Transform m_Transform
 Default identity transform to render all debug shapes with.
 
std::vector< DebugShapem_DebugShapes
 Container of all debug shapes to draw.
 

Detailed Description

Draws debug graphics such as lines, points, bounding volumes, axis, etc.

Member Function Documentation

void Ocular::Graphics::Debug::addCircle ( Math::Vector3f const &  center,
float  radius,
Math::Vector3f const &  normal,
Core::Color const &  color,
uint32_t  segments,
uint64_t  lifetime 
)

Add a 3D circle shape to be rendered.

Parameters
[in]centerCenter of the circle in world coordinates.
[in]radiusRadius of the circle in units.
[in]normalNormal of the circle's surface.
[in]colorColor of the circle.
[in]segmentsNumber of individual segments that comprise the circle. Minimum of 3.
[in]lifetimeLength of time (in milliseconds) the line should be drawn. Lifetime of 0 indicates the line will persist forever.
void Ocular::Graphics::Debug::addLine ( Math::Vector3f const &  start,
Math::Vector3f const &  stop,
Core::Color const &  color,
uint64_t  lifetime 
)

Adds a line shape to be rendered.

Parameters
[in]startLine starting point in world coordinates
[in]stopLine stopping point in world coordinates
[in]colorLine color
[in]lifetimeLength of time (in milliseconds) the line should be drawn. Lifetime of 0 indicates the line will persist forever.
void Ocular::Graphics::Debug::render ( )

Renders all shapes that are alive.


The documentation for this class was generated from the following files: