VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Public Member Functions | List of all members
LiquidFunDebugDraw Class Reference

Implementation of b2Draw which renders objects (body fixtures, particles, etc.) using DebugRenderer. More...

Inheritance diagram for LiquidFunDebugDraw:

Public Member Functions

 LiquidFunDebugDraw ()
 Constructs a LiquidFunDebugDraw. More...
 
virtual void DrawPolygon (const b2Vec2 *vertices, int32 vertexCount, const b2Color &color) override
 Draw a closed polygon line. More...
 
virtual void DrawSolidPolygon (const b2Vec2 *vertices, int32 vertexCount, const b2Color &color) override
 Draw a filled polygon. More...
 
virtual void DrawCircle (const b2Vec2 &center, float32 radius, const b2Color &color) override
 Draw a circle. More...
 
virtual void DrawSolidCircle (const b2Vec2 &center, float32 radius, const b2Vec2 &axis, const b2Color &color) override
 Draw a filled circle. More...
 
virtual void DrawParticles (const b2Vec2 *centers, float32 radius, const b2ParticleColor *colors, int32 count) override
 Draw a list of particles as circles. More...
 
virtual void DrawSegment (const b2Vec2 &p1, const b2Vec2 &p2, const b2Color &color) override
 Draw a line segment. More...
 
virtual void DrawTransform (const b2Transform &xf) override
 Draw a two dimensional transform. More...
 

Detailed Description

Implementation of b2Draw which renders objects (body fixtures, particles, etc.) using DebugRenderer.

b2Draw receives callbacks from b2World when b2World::DrawDebugData() is called. This class then in turn queues up those shapes in DebugRenderer for later rendering. This allows rendering to occur later in the render thread, and queuing to occur in the main thread, keeping debug shapes visually in sync with physics.

Note
It is expected that a valid Renderer be attached when b2World::DrawDebugData() is called, so that Renderer::getDebugRenderer() can be called.

Constructor & Destructor Documentation

LiquidFunDebugDraw::LiquidFunDebugDraw ( )

Constructs a LiquidFunDebugDraw.

Member Function Documentation

virtual void LiquidFunDebugDraw::DrawCircle ( const b2Vec2 &  center,
float32  radius,
const b2Color &  color 
)
overridevirtual

Draw a circle.

Parameters
centerCenter of the circle
radiusRadius of the circle
colorColor to draw the circle
virtual void LiquidFunDebugDraw::DrawParticles ( const b2Vec2 *  centers,
float32  radius,
const b2ParticleColor *  colors,
int32  count 
)
overridevirtual

Draw a list of particles as circles.

Parameters
centersList of particle centers
radiusRadius of circles
colorsList of particle colors
countLength of centers and colors
virtual void LiquidFunDebugDraw::DrawPolygon ( const b2Vec2 *  vertices,
int32  vertexCount,
const b2Color &  color 
)
overridevirtual

Draw a closed polygon line.

Parameters
verticesList of vertices
vertexCountLength of list vertices
colorColor to draw the polygon
virtual void LiquidFunDebugDraw::DrawSegment ( const b2Vec2 &  p1,
const b2Vec2 &  p2,
const b2Color &  color 
)
overridevirtual

Draw a line segment.

Parameters
p1First end point
p2Second end point
colorColor to draw the line segment
virtual void LiquidFunDebugDraw::DrawSolidCircle ( const b2Vec2 &  center,
float32  radius,
const b2Vec2 &  axis,
const b2Color &  color 
)
overridevirtual

Draw a filled circle.

Parameters
centerCenter of the circle
radiusRadius of the circle
axisRotational axis of the circle, to indicate rotation
colorColor to fill the circle
virtual void LiquidFunDebugDraw::DrawSolidPolygon ( const b2Vec2 *  vertices,
int32  vertexCount,
const b2Color &  color 
)
overridevirtual

Draw a filled polygon.

Note
The polygon is expected to be convex.
Parameters
verticesList of vertices
vertexCountLength of list vertices
colorColor to fill the polygon
virtual void LiquidFunDebugDraw::DrawTransform ( const b2Transform &  xf)
overridevirtual

Draw a two dimensional transform.

This method visualizes the transform by drawing two colored lines along the transform's x and y axes.

Parameters
xfTransform to draw