Bullet Collision Detection & Physics Library
Classes | Public Types | Public Member Functions | List of all members
btIDebugDraw Class Referenceabstract

The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations. More...

#include <btIDebugDraw.h>

Classes

struct  DefaultColors
 

Public Types

enum  DebugDrawModes {
  DBG_NoDebug = 0 ,
  DBG_DrawWireframe = 1 ,
  DBG_DrawAabb = 2 ,
  DBG_DrawFeaturesText = 4 ,
  DBG_DrawContactPoints = 8 ,
  DBG_NoDeactivation = 16 ,
  DBG_NoHelpText = 32 ,
  DBG_DrawText = 64 ,
  DBG_ProfileTimings = 128 ,
  DBG_EnableSatComparison = 256 ,
  DBG_DisableBulletLCP = 512 ,
  DBG_EnableCCD = 1024 ,
  DBG_DrawConstraints = (1 << 11) ,
  DBG_DrawConstraintLimits = (1 << 12) ,
  DBG_FastWireframe = (1 << 13) ,
  DBG_DrawNormals = (1 << 14) ,
  DBG_DrawFrames = (1 << 15) ,
  DBG_MAX_DEBUG_DRAW_MODE
}
 

Public Member Functions

virtual ~btIDebugDraw ()
 
virtual DefaultColors getDefaultColors () const
 
virtual void setDefaultColors (const DefaultColors &)
 the default implementation for setDefaultColors has no effect. A derived class can implement it and store the colors. More...
 
virtual void drawLine (const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
 
virtual void drawLine (const btVector3 &from, const btVector3 &to, const btVector3 &fromColor, const btVector3 &toColor)
 
virtual void drawSphere (btScalar radius, const btTransform &transform, const btVector3 &color)
 
virtual void drawSphere (const btVector3 &p, btScalar radius, const btVector3 &color)
 
virtual void drawTriangle (const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &, const btVector3 &, const btVector3 &, const btVector3 &color, btScalar alpha)
 
virtual void drawTriangle (const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &color, btScalar)
 
virtual void drawContactPoint (const btVector3 &PointOnB, const btVector3 &normalOnB, btScalar distance, int lifeTime, const btVector3 &color)=0
 
virtual void reportErrorWarning (const char *warningString)=0
 
virtual void draw3dText (const btVector3 &location, const char *textString)=0
 
virtual void setDebugMode (int debugMode)=0
 
virtual int getDebugMode () const =0
 
virtual void drawAabb (const btVector3 &from, const btVector3 &to, const btVector3 &color)
 
virtual void drawTransform (const btTransform &transform, btScalar orthoLen)
 
virtual void drawArc (const btVector3 &center, const btVector3 &normal, const btVector3 &axis, btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle, const btVector3 &color, bool drawSect, btScalar stepDegrees=btScalar(10.f))
 
virtual void drawSpherePatch (const btVector3 &center, const btVector3 &up, const btVector3 &axis, btScalar radius, btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3 &color, btScalar stepDegrees=btScalar(10.f), bool drawCenter=true)
 
virtual void drawBox (const btVector3 &bbMin, const btVector3 &bbMax, const btVector3 &color)
 
virtual void drawBox (const btVector3 &bbMin, const btVector3 &bbMax, const btTransform &trans, const btVector3 &color)
 
virtual void drawCapsule (btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
 
virtual void drawCylinder (btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
 
virtual void drawCone (btScalar radius, btScalar height, int upAxis, const btTransform &transform, const btVector3 &color)
 
virtual void drawPlane (const btVector3 &planeNormal, btScalar planeConst, const btTransform &transform, const btVector3 &color)
 
virtual void clearLines ()
 
virtual void flushLines ()
 

Detailed Description

The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.

Typical use case: create a debug drawer object, and assign it to a btCollisionWorld or btDynamicsWorld using setDebugDrawer and call debugDrawWorld. A class that implements the btIDebugDraw interface will need to provide non-empty implementations of the the drawLine and getDebugMode methods at a minimum. For color arguments the X,Y,Z components refer to Red, Green and Blue each in the range [0..1]

Definition at line 26 of file btIDebugDraw.h.

Member Enumeration Documentation

◆ DebugDrawModes

Enumerator
DBG_NoDebug 
DBG_DrawWireframe 
DBG_DrawAabb 
DBG_DrawFeaturesText 
DBG_DrawContactPoints 
DBG_NoDeactivation 
DBG_NoHelpText 
DBG_DrawText 
DBG_ProfileTimings 
DBG_EnableSatComparison 
DBG_DisableBulletLCP 
DBG_EnableCCD 
DBG_DrawConstraints 
DBG_DrawConstraintLimits 
DBG_FastWireframe 
DBG_DrawNormals 
DBG_DrawFrames 
DBG_MAX_DEBUG_DRAW_MODE 

Definition at line 52 of file btIDebugDraw.h.

Constructor & Destructor Documentation

◆ ~btIDebugDraw()

virtual btIDebugDraw::~btIDebugDraw ( )
inlinevirtual

Definition at line 74 of file btIDebugDraw.h.

Member Function Documentation

◆ clearLines()

virtual void btIDebugDraw::clearLines ( )
inlinevirtual

Definition at line 464 of file btIDebugDraw.h.

◆ draw3dText()

virtual void btIDebugDraw::draw3dText ( const btVector3 location,
const char *  textString 
)
pure virtual

◆ drawAabb()

virtual void btIDebugDraw::drawAabb ( const btVector3 from,
const btVector3 to,
const btVector3 color 
)
inlinevirtual

Definition at line 135 of file btIDebugDraw.h.

◆ drawArc()

virtual void btIDebugDraw::drawArc ( const btVector3 center,
const btVector3 normal,
const btVector3 axis,
btScalar  radiusA,
btScalar  radiusB,
btScalar  minAngle,
btScalar  maxAngle,
const btVector3 color,
bool  drawSect,
btScalar  stepDegrees = btScalar(10.f) 
)
inlinevirtual

Definition at line 171 of file btIDebugDraw.h.

◆ drawBox() [1/2]

virtual void btIDebugDraw::drawBox ( const btVector3 bbMin,
const btVector3 bbMax,
const btTransform trans,
const btVector3 color 
)
inlinevirtual

Definition at line 319 of file btIDebugDraw.h.

◆ drawBox() [2/2]

virtual void btIDebugDraw::drawBox ( const btVector3 bbMin,
const btVector3 bbMax,
const btVector3 color 
)
inlinevirtual

Definition at line 304 of file btIDebugDraw.h.

◆ drawCapsule()

virtual void btIDebugDraw::drawCapsule ( btScalar  radius,
btScalar  halfHeight,
int  upAxis,
const btTransform transform,
const btVector3 color 
)
inlinevirtual

Definition at line 335 of file btIDebugDraw.h.

◆ drawCone()

virtual void btIDebugDraw::drawCone ( btScalar  radius,
btScalar  height,
int  upAxis,
const btTransform transform,
const btVector3 color 
)
inlinevirtual

Definition at line 414 of file btIDebugDraw.h.

◆ drawContactPoint()

virtual void btIDebugDraw::drawContactPoint ( const btVector3 PointOnB,
const btVector3 normalOnB,
btScalar  distance,
int  lifeTime,
const btVector3 color 
)
pure virtual

◆ drawCylinder()

virtual void btIDebugDraw::drawCylinder ( btScalar  radius,
btScalar  halfHeight,
int  upAxis,
const btTransform transform,
const btVector3 color 
)
inlinevirtual

Definition at line 388 of file btIDebugDraw.h.

◆ drawLine() [1/2]

virtual void btIDebugDraw::drawLine ( const btVector3 from,
const btVector3 to,
const btVector3 color 
)
pure virtual

◆ drawLine() [2/2]

virtual void btIDebugDraw::drawLine ( const btVector3 from,
const btVector3 to,
const btVector3 fromColor,
const btVector3 toColor 
)
inlinevirtual

Definition at line 86 of file btIDebugDraw.h.

◆ drawPlane()

virtual void btIDebugDraw::drawPlane ( const btVector3 planeNormal,
btScalar  planeConst,
const btTransform transform,
const btVector3 color 
)
inlinevirtual

Definition at line 450 of file btIDebugDraw.h.

◆ drawSphere() [1/2]

virtual void btIDebugDraw::drawSphere ( btScalar  radius,
const btTransform transform,
const btVector3 color 
)
inlinevirtual

Definition at line 92 of file btIDebugDraw.h.

◆ drawSphere() [2/2]

virtual void btIDebugDraw::drawSphere ( const btVector3 p,
btScalar  radius,
const btVector3 color 
)
inlinevirtual

Definition at line 106 of file btIDebugDraw.h.

◆ drawSpherePatch()

virtual void btIDebugDraw::drawSpherePatch ( const btVector3 center,
const btVector3 up,
const btVector3 axis,
btScalar  radius,
btScalar  minTh,
btScalar  maxTh,
btScalar  minPs,
btScalar  maxPs,
const btVector3 color,
btScalar  stepDegrees = btScalar(10.f),
bool  drawCenter = true 
)
inlinevirtual

Definition at line 196 of file btIDebugDraw.h.

◆ drawTransform()

virtual void btIDebugDraw::drawTransform ( const btTransform transform,
btScalar  orthoLen 
)
inlinevirtual

Definition at line 163 of file btIDebugDraw.h.

◆ drawTriangle() [1/2]

virtual void btIDebugDraw::drawTriangle ( const btVector3 v0,
const btVector3 v1,
const btVector3 v2,
const btVector3 ,
const btVector3 ,
const btVector3 ,
const btVector3 color,
btScalar  alpha 
)
inlinevirtual

Definition at line 114 of file btIDebugDraw.h.

◆ drawTriangle() [2/2]

virtual void btIDebugDraw::drawTriangle ( const btVector3 v0,
const btVector3 v1,
const btVector3 v2,
const btVector3 color,
btScalar   
)
inlinevirtual

Definition at line 118 of file btIDebugDraw.h.

◆ flushLines()

virtual void btIDebugDraw::flushLines ( )
inlinevirtual

Definition at line 468 of file btIDebugDraw.h.

◆ getDebugMode()

virtual int btIDebugDraw::getDebugMode ( ) const
pure virtual

◆ getDefaultColors()

virtual DefaultColors btIDebugDraw::getDefaultColors ( ) const
inlinevirtual

Definition at line 76 of file btIDebugDraw.h.

◆ reportErrorWarning()

virtual void btIDebugDraw::reportErrorWarning ( const char *  warningString)
pure virtual

◆ setDebugMode()

virtual void btIDebugDraw::setDebugMode ( int  debugMode)
pure virtual

◆ setDefaultColors()

virtual void btIDebugDraw::setDefaultColors ( const DefaultColors )
inlinevirtual

the default implementation for setDefaultColors has no effect. A derived class can implement it and store the colors.

Definition at line 82 of file btIDebugDraw.h.


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