Public Types | Public Member Functions | Protected Attributes | List of all members
b2Draw Class Referenceabstract

#include <b2_draw.h>

Inheritance diagram for b2Draw:
Inheritance graph
[legend]

Public Types

enum  {
  e_shapeBit = 0x0001, e_jointBit = 0x0002, e_aabbBit = 0x0004, e_pairBit = 0x0008,
  e_centerOfMassBit = 0x0010
}
 

Public Member Functions

void AppendFlags (uint32 flags)
 Append flags to the current flags. More...
 
 b2Draw ()
 
void ClearFlags (uint32 flags)
 Clear flags from the current flags. More...
 
virtual void DrawCircle (const b2Vec2 &center, float radius, const b2Color &color)=0
 Draw a circle. More...
 
virtual void DrawPoint (const b2Vec2 &p, float size, const b2Color &color)=0
 Draw a point. More...
 
virtual void DrawPolygon (const b2Vec2 *vertices, int32 vertexCount, const b2Color &color)=0
 Draw a closed polygon provided in CCW order. More...
 
virtual void DrawSegment (const b2Vec2 &p1, const b2Vec2 &p2, const b2Color &color)=0
 Draw a line segment. More...
 
virtual void DrawSolidCircle (const b2Vec2 &center, float radius, const b2Vec2 &axis, const b2Color &color)=0
 Draw a solid circle. More...
 
virtual void DrawSolidPolygon (const b2Vec2 *vertices, int32 vertexCount, const b2Color &color)=0
 Draw a solid closed polygon provided in CCW order. More...
 
virtual void DrawTransform (const b2Transform &xf)=0
 
uint32 GetFlags () const
 Get the drawing flags. More...
 
void SetFlags (uint32 flags)
 Set the drawing flags. More...
 
virtual ~b2Draw ()
 

Protected Attributes

uint32 m_drawFlags
 

Detailed Description

Implement and register this class with a b2World to provide debug drawing of physics entities in your game.

Definition at line 48 of file b2_draw.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
e_shapeBit 

draw shapes

e_jointBit 

draw joint connections

e_aabbBit 

draw axis aligned bounding boxes

e_pairBit 

draw broad-phase pairs

e_centerOfMassBit 

draw center of mass frame

Definition at line 55 of file b2_draw.h.

Constructor & Destructor Documentation

◆ b2Draw()

b2Draw::b2Draw ( )

Definition at line 24 of file b2_draw.cpp.

◆ ~b2Draw()

virtual b2Draw::~b2Draw ( )
inlinevirtual

Definition at line 53 of file b2_draw.h.

Member Function Documentation

◆ AppendFlags()

void b2Draw::AppendFlags ( uint32  flags)

Append flags to the current flags.

Definition at line 39 of file b2_draw.cpp.

◆ ClearFlags()

void b2Draw::ClearFlags ( uint32  flags)

Clear flags from the current flags.

Definition at line 44 of file b2_draw.cpp.

◆ DrawCircle()

virtual void b2Draw::DrawCircle ( const b2Vec2 center,
float  radius,
const b2Color color 
)
pure virtual

Draw a circle.

Implemented in DebugDraw.

◆ DrawPoint()

virtual void b2Draw::DrawPoint ( const b2Vec2 p,
float  size,
const b2Color color 
)
pure virtual

Draw a point.

Implemented in DebugDraw.

◆ DrawPolygon()

virtual void b2Draw::DrawPolygon ( const b2Vec2 vertices,
int32  vertexCount,
const b2Color color 
)
pure virtual

Draw a closed polygon provided in CCW order.

Implemented in DebugDraw.

◆ DrawSegment()

virtual void b2Draw::DrawSegment ( const b2Vec2 p1,
const b2Vec2 p2,
const b2Color color 
)
pure virtual

Draw a line segment.

Implemented in DebugDraw.

◆ DrawSolidCircle()

virtual void b2Draw::DrawSolidCircle ( const b2Vec2 center,
float  radius,
const b2Vec2 axis,
const b2Color color 
)
pure virtual

Draw a solid circle.

Implemented in DebugDraw.

◆ DrawSolidPolygon()

virtual void b2Draw::DrawSolidPolygon ( const b2Vec2 vertices,
int32  vertexCount,
const b2Color color 
)
pure virtual

Draw a solid closed polygon provided in CCW order.

Implemented in DebugDraw.

◆ DrawTransform()

virtual void b2Draw::DrawTransform ( const b2Transform xf)
pure virtual

Draw a transform. Choose your own length scale.

Parameters
xfa transform.

Implemented in DebugDraw.

◆ GetFlags()

uint32 b2Draw::GetFlags ( ) const

Get the drawing flags.

Definition at line 34 of file b2_draw.cpp.

◆ SetFlags()

void b2Draw::SetFlags ( uint32  flags)

Set the drawing flags.

Definition at line 29 of file b2_draw.cpp.

Member Data Documentation

◆ m_drawFlags

uint32 b2Draw::m_drawFlags
protected

Definition at line 99 of file b2_draw.h.


The documentation for this class was generated from the following files:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22