If you use the Opengl renderer, you have access to a debug renderer which, for the moment, allows you to render lines and boxes.
💡 When you add a BoxCollider3DComponent, you don't need to call any functions in the debug renderer. Everything is done automatically.
If you want to add a debug line when you perform a line trace, the procedure is explained in the chapter that talks about physics
💡 By default, the debug renderer is disabled.
void AddDebugLine(DebugLine* pLine);
Adds a DebugLine to the mLines vector. The debug renderer's Draw() function calls the DrawDebugLine() function for each line of the vector.
void DrawDebugBox(Matrix4DRow pWorldTransform);
This function is used to draw a debug box. It takes a Matrix4DRow as parameter, which contains the position, size and rotation of the box to be drawn.
⚠️ Function to call in the scene's Render() function
void DrawDebugLine(const Vector3D& start, const Vector3D& end, const HitResult& hit);
This function is used to draw a debug line. It takes as parameters a start position, an end position and a HitResult.
The HitResult is used to draw a cube at the collision point between the LineTrace and a ColliderComponent.
⚠️ Function to call in the scene's Render() function
void DrawDebugLine(const Vector3D& start, const Vector3D& end);
This function is used to draw a debug line. It takes a start position and an end position as parameters.
⚠️ Function to call in the scene's Render() function
void SetDrawDebug(bool pDraw);
Allows you to change the status of the debug Renderer (Show/Hide debug items)
Defaults to false
void SetDrawLines(bool pDraw);
Enables you to change the status of the debug Renderer (Show/Hide DebugLines)
void SetDrawBoxes(bool pDraw);
Enables you to change the status of the debug renderer (Show/Hide debug boxes)