![]() |
Skylicht Engine
|
A helper class that allows you to draw lines, circles, text... etc., for debugging. More...
#include <Debug/CSceneDebug.h>
Public Member Functions | |
| CSceneDebug () | |
| Constructor. Initializes internal arrays. | |
| virtual | ~CSceneDebug () |
| Destructor. Cleans up all debug primitives and the noZDebug instance. | |
| CSceneDebug * | getNoZDebug () |
| Returns the singleton instance dedicated for "No Z Debug" visualization. | |
| void | addCircle (const core::vector3df &pos, float radius, const core::vector3df &normal, const SColor &color) |
| Adds a debug circle to the scene. | |
| void | addEclipse (const core::vector3df &pos, float radiusZ, float radiusX, const core::vector3df &normal, const SColor &color) |
| Adds a debug ellipse to the scene. | |
| void | addTri (const core::triangle3df &tri, const SColor &color) |
| Adds a debug triangle to the scene. | |
| void | addLine (const core::line3df &line, const SColor &color) |
| Adds a debug line to the scene. | |
| void | addLine (const core::vector3df &v1, const core::vector3df &v2, const SColor &color) |
| Adds a debug line to the scene. | |
| void | addLinestrip (const core::array< core::vector3df > &point, const SColor &color) |
| Adds a debug linestrip (connected line segments) to the scene. | |
| void | addLinestrip (const std::vector< core::vector3df > &point, const SColor &color) |
| Adds a debug linestrip to the scene. | |
| void | addBoudingBox (const core::aabbox3df &box, const SColor &color) |
| Adds a debug axis-aligned bounding box to the scene. | |
| void | addTransformBBox (const core::aabbox3df &box, const SColor &color, const core::matrix4 &mat) |
| Adds a debug bounding box with a transformation applied. The box is drawn with its edges transformed by the given matrix. | |
| void | addSphere (const core::vector3df &pos, float radius, const SColor &color) |
| Adds a debug sphere (as two circles) to the scene. | |
| void | addPosition (const core::vector3df &pos, float length, const SColor &color) |
| Adds debug axis lines to visualize a position and orientation. | |
| void | addTransform (const core::matrix4 &mat, float vectorLength) |
| Adds debug axis lines at a transformed position (visualizes transform matrix axes). X (red), Y (green), Z (blue). | |
| void | addText (const core::vector3df &pos, const char *string, const SColor &color) |
| Adds a 3D debug text billboard at the given scene position. | |
| void | addText2D (const core::vector2df &pos, const char *string, const SColor &color) |
| Adds a 2D debug text billboard at the given screen position. | |
| void | clearText () |
| Clears all debug text billboards. | |
| void | clear () |
| void | clearLines () |
| Clears all debug lines. | |
| void | clearLineStrip () |
| Clears all debug linestrips. | |
| void | clearBoxs () |
| Clears all debug bounding boxes. | |
| void | clearTri () |
| Clears all debug triangles. | |
| u32 | getLinesCount () |
| Get the number of debug lines currently stored. | |
| u32 | getLineStripCount () |
| Get the number of debug linestrips currently stored. | |
| u32 | getBoxCount () |
| Get the number of debug boxes currently stored. | |
| u32 | getTriCount () |
| Get the number of debug triangles currently stored. | |
| const SLineDebug & | getLine (int i) |
| Get a reference to the debug line at the specified index. | |
| const SLineStripDebug & | getLineStrip (int i) |
| Get a reference to the debug linestrip at the specified index. | |
| const SBoxDebug & | getBox (int i) |
| Get a reference to the debug box at the specified index. | |
| const STriDebug & | getTri (int i) |
| Get a reference to the debug triangle at the specified index. | |
Protected Attributes | |
| core::array< SLineDebug * > | m_lines |
| Array of debug lines. | |
| core::array< SLineStripDebug * > | m_linestrip |
| Array of debug linestrips. | |
| core::array< SBoxDebug * > | m_boxs |
| Array of debug boxes. | |
| core::array< STriDebug * > | m_tri |
| Array of debug triangles. | |
| core::array< CRenderTextData * > | m_texts |
| Array of debug text billboards. | |
| CSceneDebug * | m_noZDebug |
A helper class that allows you to draw lines, circles, text... etc., for debugging.
You can draw debug visualizations by calling addLine, addText, addCircle, etc., in each loop. The debug data added will be automatically cleared every frame.
| void Skylicht::CSceneDebug::addBoudingBox | ( | const core::aabbox3df & | box, |
| const SColor & | color ) |
Adds a debug axis-aligned bounding box to the scene.
| box | Bounding box geometry. |
| color | Color of the box. |
| void Skylicht::CSceneDebug::addCircle | ( | const core::vector3df & | pos, |
| float | radius, | ||
| const core::vector3df & | normal, | ||
| const SColor & | color ) |
Adds a debug circle to the scene.
| pos | Center position of the circle. |
| radius | Radius of the circle. |
| normal | Normal vector defining the circle's orientation. |
| color | Color of the circle. |
| void Skylicht::CSceneDebug::addEclipse | ( | const core::vector3df & | pos, |
| float | radiusZ, | ||
| float | radiusX, | ||
| const core::vector3df & | normal, | ||
| const SColor & | color ) |
Adds a debug ellipse to the scene.
| pos | Center position of the ellipse. |
| radiusZ | Radius along the Z axis. |
| radiusX | Radius along the X axis. |
| normal | Normal vector defining the ellipse's orientation. |
| color | Color of the ellipse. |
| void Skylicht::CSceneDebug::addLine | ( | const core::line3df & | line, |
| const SColor & | color ) |
Adds a debug line to the scene.
| line | Line geometry. |
| color | Color of the line. |
| void Skylicht::CSceneDebug::addLine | ( | const core::vector3df & | v1, |
| const core::vector3df & | v2, | ||
| const SColor & | color ) |
Adds a debug line to the scene.
| v1 | First endpoint of the line. |
| v2 | Second endpoint of the line. |
| color | Color of the line. |
| void Skylicht::CSceneDebug::addLinestrip | ( | const core::array< core::vector3df > & | point, |
| const SColor & | color ) |
Adds a debug linestrip (connected line segments) to the scene.
| point | Array of points forming the linestrip. |
| color | Color of the linestrip. |
| void Skylicht::CSceneDebug::addLinestrip | ( | const std::vector< core::vector3df > & | point, |
| const SColor & | color ) |
Adds a debug linestrip to the scene.
| point | Irrlicht array of points forming the linestrip. |
| color | Color of the linestrip. |
| void Skylicht::CSceneDebug::addPosition | ( | const core::vector3df & | pos, |
| float | length, | ||
| const SColor & | color ) |
Adds debug axis lines to visualize a position and orientation.
| pos | Center position. |
| length | Length of each axis line. |
| color | Color of the axes. |
| void Skylicht::CSceneDebug::addSphere | ( | const core::vector3df & | pos, |
| float | radius, | ||
| const SColor & | color ) |
Adds a debug sphere (as two circles) to the scene.
| pos | Center position of the sphere. |
| radius | Radius of the sphere. |
| color | Color of the sphere. |
| void Skylicht::CSceneDebug::addText | ( | const core::vector3df & | pos, |
| const char * | string, | ||
| const SColor & | color ) |
Adds a 3D debug text billboard at the given scene position.
| pos | 3D position for the text. |
| string | Text to display. |
| color | Text color. |
| void Skylicht::CSceneDebug::addText2D | ( | const core::vector2df & | pos, |
| const char * | string, | ||
| const SColor & | color ) |
Adds a 2D debug text billboard at the given screen position.
| pos | 2D screen position for the text. |
| string | Text to display. |
| color | Text color. |
| void Skylicht::CSceneDebug::addTransform | ( | const core::matrix4 & | mat, |
| float | vectorLength ) |
Adds debug axis lines at a transformed position (visualizes transform matrix axes). X (red), Y (green), Z (blue).
| mat | Transformation matrix. |
| vectorLength | Length of each axis line. |
| void Skylicht::CSceneDebug::addTransformBBox | ( | const core::aabbox3df & | box, |
| const SColor & | color, | ||
| const core::matrix4 & | mat ) |
Adds a debug bounding box with a transformation applied. The box is drawn with its edges transformed by the given matrix.
| box | Bounding box geometry. |
| color | Color of the box. |
| mat | Transformation matrix. |
| void Skylicht::CSceneDebug::addTri | ( | const core::triangle3df & | tri, |
| const SColor & | color ) |
Adds a debug triangle to the scene.
| tri | The triangle geometry. |
| color | Color of the triangle. |
|
inline |
Get a reference to the debug box at the specified index.
Allows direct access to a specific debug bounding box for inspection or custom rendering.
| i | Index of the box in the internal array. |
|
inline |
Get the number of debug boxes currently stored.
|
inline |
Get a reference to the debug line at the specified index.
This function allows direct inspection or rendering of a specific debug line primitive currently stored.
| i | Index of the debug line in the internal array. |
|
inline |
Get the number of debug lines currently stored.
|
inline |
Get a reference to the debug linestrip at the specified index.
This function allows direct access to a specific debug linestrip (sequence of connected points) for custom processing or visualization.
| i | Index of the linestrip in the internal array. |
|
inline |
Get the number of debug linestrips currently stored.
| CSceneDebug * Skylicht::CSceneDebug::getNoZDebug | ( | ) |
Returns the singleton instance dedicated for "No Z Debug" visualization.
"No Z Debug" means drawing debug primitives that ignore 3D object depth, allowing them to be rendered through all geometry (no depth testing). This is useful for visualizing guides or markers regardless of occlusion by scene objects.
Creates a new instance if it doesn't exist.
|
inline |
Get a reference to the debug triangle at the specified index.
Allows direct access to a specific debug triangle for inspection or custom rendering.
| i | Index of the triangle in the internal array. |
|
inline |
Get the number of debug triangles currently stored.
|
protected |
Array of debug text billboards.
Dedicated CSceneDebug instance for "No Z Debug" visualization (renders without depth testing)