Dbg

The debug subsytem provides an unified way of drawing visual shapes used for debugging. It consists of a squential command queue that process debug call place them into a list and process them all at once. First you need to notify the system to start gathering drawing commands, accumulate the commands and finally tell the system to send all the draw calls to the GPU.

Using this sytem you can choose when to send debug draw commands; it can either be on the OnDisplay function of a Camera (which would also draw directly in the 3d viewport of the editor), a Scene or an App event.

See Also

Variables


Name Description
server_echo Determine the type of echo to log from the server.

Functions


Name Description
DrawBegin Initiate the drawing.
DrawText Draw text on screen using the default font embedded in the Debug class.
DrawLine Draw a colored line in 3d.
DrawShadedLine Draw a shaded line in 3d where a color can be assigned for the start and the end point.
DashedLine Draw a dash line.
DrawLineStrip Draw a line re-using the last point to create a new segment.
DrawParabolicCurve Draw a parabolic curve between two point in space.
DrawPoint Force the application to synchronize based on a specific time step.
DrawTriangle Draw a triangle.
DrawArc Draw a full or partial circle.
DrawDashedArc Draw a dashed full or partial circle.
DrawBBox Draw a bounding box.
DrawAABB Draw an axis aligned bounding box.
DrawDiamond Draw a tri-dimensional wireframed diamond.
DrawWirePyramid Function to draw a tri-dimensional wireframe pyramid.
DrawSolidPyramid Function to draw a tri-dimensional solid pyramid.
DrawSolidCone Draw a solid tri-dimensional cone.
DrawSolidBox Draw a solid colored box.
DrawWireBox Draw a colored wireframe box.
DrawSolidCylinder Draw a solid colored cylinder.
DrawWireCone Function to draw a wireframe cone.
DrawSolidPlane Function to draw a solid plane.
DrawWirePlane Function to draw a plane made of wireframes.
DrawWireBall Function to draw a wireframe ball.
DrawWireSphere Function to draw a sphere made of wireframes.
DrawSolidSphere Function to draw a solid sphere.
DrawEnd Stop gathering drawing commands and send the draw queue to the GPU.

Scripting


Find below a quick example on how to use the debug drawing API.

  • Lua
-- Place this function into a script attached to
-- the main Camera of a Scene.
function OnDisplay()
    -- Signal to start gathering drawing commands.
    Dbg:DrawBegin()
    -- Draw a line to represent the Z axis.
    Dbg:DrawLine( Vec3:Set(0,0,10),
                  Vec3:Set(0,0,-10),
                  Vec4:Set(0,0,1,1) )
    -- Stop gathering commands and draw.
    Dbg:DrawEnd()
end




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA