DebugDrawer

consoledoc.h

A debug helper for rendering debug primitives to the scene.

More...

Public Functions

void
drawBox(Point3F a, Point3F b, LinearColorF color)

Draws an axis aligned box primitive within the two 3d points.

void
drawLine(Point3F a, Point3F b, LinearColorF color)

Draws a line primitive between two 3d points.

void
setLastTTL(uint ms)

Sets the "time to live" (TTL) for the last rendered primitive.

void
setLastZTest(bool enabled)

Sets the z buffer reading state for the last rendered primitive.

void

Toggles the rendering of DebugDrawer primitives.

void

Toggles freeze mode which keeps the currently rendered primitives from expiring.

Detailed Description

A debug helper for rendering debug primitives to the scene.

The DebugDrawer is used to render debug primitives to the scene for testing. It is often useful when debugging collision code or complex 3d algorithms to have them draw debug information, like culling hulls or bounding volumes, normals, simple lines, and so forth.

A key feature of the DebugDrawer is that each primitive gets a "time to live" (TTL) which allows them to continue to render to the scene for a fixed period of time. You can freeze or resume the system at any time to allow you to examine the output.

DebugDraw.drawLine( %player.getMuzzlePoint( 0 ), %hitPoint );
DebugDraw.setLastTTL( 5000 ); // 5 seconds.
The DebugDrawer renders solely in world space and all primitives are rendered with the cull mode disabled.
note:

This feature can easily be used to cheat in online games, so you should be sure it is disabled in your shipping game. By default the DebugDrawer is disabled in all TORQUE_SHIPPING builds.

Public Functions

drawBox(Point3F a, Point3F b, LinearColorF color)

Draws an axis aligned box primitive within the two 3d points.

drawLine(Point3F a, Point3F b, LinearColorF color)

Draws a line primitive between two 3d points.

setLastTTL(uint ms)

Sets the "time to live" (TTL) for the last rendered primitive.

setLastZTest(bool enabled)

Sets the z buffer reading state for the last rendered primitive.

toggleDrawing()

Toggles the rendering of DebugDrawer primitives.

toggleFreeze()

Toggles freeze mode which keeps the currently rendered primitives from expiring.