Hymn to Beauty
C++ 3D Engine
DebugDrawingManager Class Reference

Debug drawing facilities. More...

#include <DebugDrawingManager.hpp>

Public Member Functions

void AddPoint (const glm::vec3 &position, const glm::vec3 &color, float size, float duration=0.f, bool depthTesting=true)
 Add a point to the world. More...
 
const std::vector< Video::DebugDrawing::Point > & GetPoints () const
 Get all debug points. More...
 
void AddLine (const glm::vec3 &startPosition, const glm::vec3 &endPosition, const glm::vec3 &color, float width=1.f, float duration=0.f, bool depthTesting=true)
 Add a line to the world. More...
 
const std::vector< Video::DebugDrawing::Line > & GetLines () const
 Get all debug lines. More...
 
void AddCuboid (const glm::vec3 &dimensions, const glm::mat4 &matrix, const glm::vec3 &color, float lineWidth=1.f, float duration=0.f, bool depthTesting=true)
 Add a cuboid to the world. More...
 
const std::vector< Video::DebugDrawing::Cuboid > & GetCuboids () const
 Get all debug cuboids. More...
 
void AddPlane (const glm::vec3 &position, const glm::vec3 &normal, const glm::vec2 &size, const glm::vec3 &color, float lineWidth=1.f, float duration=0.f, bool depthTesting=true)
 Add a plane to the world. More...
 
const std::vector< Video::DebugDrawing::Plane > & GetPlanes () const
 Get all debug planes. More...
 
void AddCircle (const glm::vec3 &position, const glm::vec3 &normal, float radius, const glm::vec3 &color, float lineWidth=1.f, float duration=0.f, bool depthTesting=true)
 Add a circle to the world. More...
 
const std::vector< Video::DebugDrawing::Circle > & GetCircles () const
 Get all debug circles. More...
 
void AddSphere (const glm::vec3 &position, float radius, const glm::vec3 &color, float lineWidth=1.f, float duration=0.f, bool depthTesting=true)
 Add a sphere to the world. More...
 
const std::vector< Video::DebugDrawing::Sphere > & GetSpheres () const
 Get all debug spheres. More...
 
void AddCylinder (float radius, float length, const glm::mat4 &matrix, const glm::vec3 &color, float lineWidth=1.f, float duration=0.f, bool depthTesting=true)
 Add a cylinder to the world. More...
 
const std::vector< Video::DebugDrawing::Cylinder > & GetCylinders () const
 Get all debug cylinders. More...
 
void AddCone (float radius, float height, const glm::mat4 &matrix, const glm::vec3 &color, float lineWidth=1.f, float duration=0.f, bool depthTesting=true)
 Add a cone to the world. More...
 
const std::vector< Video::DebugDrawing::Cone > & GetCones () const
 Get all debug cones. More...
 
void AddMesh (Component::Mesh *meshComponent, const glm::mat4 &matrix, const glm::vec3 &color, bool wireFrame=true, float duration=0.f, bool depthTesting=true)
 Add a mesh to the world. More...
 
std::vector< Video::DebugDrawing::MeshGetMeshes () const
 Get all debug meshes. More...
 
void Update (float deltaTime)
 Update the debug geometry. More...
 

Friends

class Hub
 

Detailed Description

Debug drawing facilities.

Member Function Documentation

◆ AddCircle()

void DebugDrawingManager::AddCircle ( const glm::vec3 &  position,
const glm::vec3 &  normal,
float  radius,
const glm::vec3 &  color,
float  lineWidth = 1.f,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a circle to the world.

Parameters
positionCenter position of the circle.
normalCircle normal.
radiusRadius.
colorColor of the lines.
lineWidthThe width of the lines used to draw the circle.
durationHow long the circle should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ AddCone()

void DebugDrawingManager::AddCone ( float  radius,
float  height,
const glm::mat4 &  matrix,
const glm::vec3 &  color,
float  lineWidth = 1.f,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a cone to the world.

Parameters
radiusThe radius of the cone.
heightThe height of the cone.
matrixMatrix to transform the cone with.
colorColor of the lines.
lineWidthThe width of the lines used to draw the cone.
durationHow long the cone should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ AddCuboid()

void DebugDrawingManager::AddCuboid ( const glm::vec3 &  dimensions,
const glm::mat4 &  matrix,
const glm::vec3 &  color,
float  lineWidth = 1.f,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a cuboid to the world.

Parameters
dimensionsThe dimensions of the cuboid.
matrixMatrix used to transform the cuboid.
colorColor of the lines.
lineWidthThe width of the lines used to draw the box.
durationHow long the box should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ AddCylinder()

void DebugDrawingManager::AddCylinder ( float  radius,
float  length,
const glm::mat4 &  matrix,
const glm::vec3 &  color,
float  lineWidth = 1.f,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a cylinder to the world.

Parameters
radiusThe radius of the cylinder.
lengthThe length of the cylinder.
matrixMatrix used to transform the cylinder.
colorColor of the lines.
lineWidthThe width of the lines used to draw the cylinder.
durationHow long the cylinder should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ AddLine()

void DebugDrawingManager::AddLine ( const glm::vec3 &  startPosition,
const glm::vec3 &  endPosition,
const glm::vec3 &  color,
float  width = 1.f,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a line to the world.

Parameters
startPositionPosition of the start point of the line.
endPositionPosition of the end point of the line.
colorColor of the line.
widthThe width of the line.
durationHow long the line should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ AddMesh()

void DebugDrawingManager::AddMesh ( Component::Mesh meshComponent,
const glm::mat4 &  matrix,
const glm::vec3 &  color,
bool  wireFrame = true,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a mesh to the world.

Parameters
meshComponentThe mesh component.
matrixMatrix to transform the mesh with.
colorColor of the lines.
wireFrameWhether to wireframe the mesh.
durationHow long the mesh should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ AddPlane()

void DebugDrawingManager::AddPlane ( const glm::vec3 &  position,
const glm::vec3 &  normal,
const glm::vec2 &  size,
const glm::vec3 &  color,
float  lineWidth = 1.f,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a plane to the world.

Parameters
positionCenter position of the plane.
normalPlane normal.
sizeSize.
colorColor of the lines.
lineWidthThe width of the lines used to draw the plane.
durationHow long the plane should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ AddPoint()

void DebugDrawingManager::AddPoint ( const glm::vec3 &  position,
const glm::vec3 &  color,
float  size,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a point to the world.

Parameters
positionWorld position of the point.
colorColor of the point.
sizeSize of the point.
durationHow long the point should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ AddSphere()

void DebugDrawingManager::AddSphere ( const glm::vec3 &  position,
float  radius,
const glm::vec3 &  color,
float  lineWidth = 1.f,
float  duration = 0.f,
bool  depthTesting = true 
)

Add a sphere to the world.

Parameters
positionThe position of the sphere.
radiusThe radius of the sphere.
colorColor of the lines.
lineWidthThe width of the lines used to draw the sphere.
durationHow long the sphere should stay in the world (in seconds).
depthTestingWhether to enable depth testing.

◆ GetCircles()

const std::vector< Video::DebugDrawing::Circle > & DebugDrawingManager::GetCircles ( ) const

Get all debug circles.

Returns
All debug circles.

◆ GetCones()

const std::vector< Video::DebugDrawing::Cone > & DebugDrawingManager::GetCones ( ) const

Get all debug cones.

Returns
All debug cones.

◆ GetCuboids()

const std::vector< Video::DebugDrawing::Cuboid > & DebugDrawingManager::GetCuboids ( ) const

Get all debug cuboids.

Returns
All debug cuboids.

◆ GetCylinders()

const std::vector< Video::DebugDrawing::Cylinder > & DebugDrawingManager::GetCylinders ( ) const

Get all debug cylinders.

Returns
All debug cylinders.

◆ GetLines()

const std::vector< Video::DebugDrawing::Line > & DebugDrawingManager::GetLines ( ) const

Get all debug lines.

Returns
All debug lines.

◆ GetMeshes()

std::vector< Video::DebugDrawing::Mesh > DebugDrawingManager::GetMeshes ( ) const

Get all debug meshes.

Returns
All debug meshes.

◆ GetPlanes()

const std::vector< Video::DebugDrawing::Plane > & DebugDrawingManager::GetPlanes ( ) const

Get all debug planes.

Returns
All debug planes.

◆ GetPoints()

const std::vector< Video::DebugDrawing::Point > & DebugDrawingManager::GetPoints ( ) const

Get all debug points.

Returns
All debug points.

◆ GetSpheres()

const std::vector< Video::DebugDrawing::Sphere > & DebugDrawingManager::GetSpheres ( ) const

Get all debug spheres.

Returns
All debug spheres.

◆ Update()

void DebugDrawingManager::Update ( float  deltaTime)

Update the debug geometry.

Parameters
deltaTimeTime since last frame (in seconds).

Friends And Related Function Documentation

◆ Hub

friend class Hub
friend

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