Hymn to Beauty
C++ 3D Engine
DebugDrawingManager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <glm/glm.hpp>
4#include <vector>
6
7namespace Component {
8class Mesh;
9}
10
13 friend class Hub;
14
15 public:
17
24 void AddPoint(const glm::vec3& position, const glm::vec3& color, float size, float duration = 0.f, bool depthTesting = true);
25
27
30 const std::vector<Video::DebugDrawing::Point>& GetPoints() const;
31
33
41 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);
42
44
47 const std::vector<Video::DebugDrawing::Line>& GetLines() const;
48
50
58 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);
59
61
64 const std::vector<Video::DebugDrawing::Cuboid>& GetCuboids() const;
65
67
76 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);
77
79
82 const std::vector<Video::DebugDrawing::Plane>& GetPlanes() const;
83
85
94 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);
95
97
100 const std::vector<Video::DebugDrawing::Circle>& GetCircles() const;
101
103
111 void AddSphere(const glm::vec3& position, float radius, const glm::vec3& color, float lineWidth = 1.f, float duration = 0.f, bool depthTesting = true);
112
114
117 const std::vector<Video::DebugDrawing::Sphere>& GetSpheres() const;
118
120
129 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);
130
132
135 const std::vector<Video::DebugDrawing::Cylinder>& GetCylinders() const;
136
138
147 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);
148
150
153 const std::vector<Video::DebugDrawing::Cone>& GetCones() const;
154
156
164 void AddMesh(Component::Mesh* meshComponent, const glm::mat4& matrix, const glm::vec3& color, bool wireFrame = true, float duration = 0.f, bool depthTesting = true);
165
167
170 std::vector<Video::DebugDrawing::Mesh> GetMeshes() const;
171
173
176 void Update(float deltaTime);
177
178 private:
182 void operator=(DebugDrawingManager const&) = delete;
183
184 std::vector<Video::DebugDrawing::Point> points;
185 std::vector<Video::DebugDrawing::Line> lines;
186 std::vector<Video::DebugDrawing::Cuboid> cuboids;
187 std::vector<Video::DebugDrawing::Plane> planes;
188 std::vector<Video::DebugDrawing::Circle> circles;
189 std::vector<Video::DebugDrawing::Sphere> spheres;
190 std::vector<Video::DebugDrawing::Cylinder> cylinders;
191 std::vector<Video::DebugDrawing::Cone> cones;
192 std::vector<Video::DebugDrawing::Mesh> meshes;
193};
Component providing geometry to an entity.
Definition: Mesh.hpp:11
Debug drawing facilities.
Definition: DebugDrawingManager.hpp:12
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.
Definition: DebugDrawingManager.cpp:51
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.
Definition: DebugDrawingManager.cpp:145
const std::vector< Video::DebugDrawing::Cylinder > & GetCylinders() const
Get all debug cylinders.
Definition: DebugDrawingManager.cpp:125
std::vector< Video::DebugDrawing::Mesh > GetMeshes() const
Get all debug meshes.
Definition: DebugDrawingManager.cpp:163
const std::vector< Video::DebugDrawing::Point > & GetPoints() const
Get all debug points.
Definition: DebugDrawingManager.cpp:32
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.
Definition: DebugDrawingManager.cpp:98
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.
Definition: DebugDrawingManager.cpp:22
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.
Definition: DebugDrawingManager.cpp:113
const std::vector< Video::DebugDrawing::Line > & GetLines() const
Get all debug lines.
Definition: DebugDrawingManager.cpp:47
const std::vector< Video::DebugDrawing::Cone > & GetCones() const
Get all debug cones.
Definition: DebugDrawingManager.cpp:141
const std::vector< Video::DebugDrawing::Circle > & GetCircles() const
Get all debug circles.
Definition: DebugDrawingManager.cpp:94
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.
Definition: DebugDrawingManager.cpp:82
void Update(float deltaTime)
Update the debug geometry.
Definition: DebugDrawingManager.cpp:167
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.
Definition: DebugDrawingManager.cpp:129
const std::vector< Video::DebugDrawing::Sphere > & GetSpheres() const
Get all debug spheres.
Definition: DebugDrawingManager.cpp:109
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.
Definition: DebugDrawingManager.cpp:66
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.
Definition: DebugDrawingManager.cpp:36
const std::vector< Video::DebugDrawing::Cuboid > & GetCuboids() const
Get all debug cuboids.
Definition: DebugDrawingManager.cpp:62
const std::vector< Video::DebugDrawing::Plane > & GetPlanes() const
Get all debug planes.
Definition: DebugDrawingManager.cpp:78
Singleton class that holds all subsystems.
Definition: Managers.hpp:16
Definition: BoxShapeEditor.hpp:5