3 #ifndef PHYSICS_DEBUG_DRAW
4 #define PHYSICS_DEBUG_DRAW
7 #include <bullet/btBulletDynamicsCommon.h>
28 void initialize(Ogre::RenderOperation::OperationType operationType,
83 DynamicLines(OperationType opType = Ogre::RenderOperation::OT_LINE_STRIP);
87 void addPoint(
const Ogre::Vector3 &p);
89 void addPoint(Ogre::Real x, Ogre::Real y, Ogre::Real z);
92 void setPoint(
unsigned short index,
const Ogre::Vector3 &value);
95 const Ogre::Vector3&
getPoint(
unsigned short index)
const;
141 typedef std::shared_ptr<PhysicsDebugDrawer>
shared;
149 void drawLine(
const btVector3& from,
const btVector3& to,
const btVector3& color);
151 void drawContactPoint(
const btVector3& PointOnB,
const btVector3& normalOnB, btScalar distance,
int lifeTime,
const btVector3& color);
155 void draw3dText(
const btVector3& location,
const char* textString);
166 #endif // PHYSICS_DEBUG_DRAW
unsigned short getNumPoints(void) const
Return the total number of points in the point list.
Definition: physicsdebugdrawer.cpp:208
int getDebugMode() const
Definition: physicsdebugdrawer.cpp:361
std::shared_ptr< PhysicsDebugDrawer > shared
Definition: physicsdebugdrawer.h:141
void update()
Call this to update the hardware buffer after making changes.
Definition: physicsdebugdrawer.cpp:227
DynamicLines * mLineDrawer
Definition: physicsdebugdrawer.h:137
void setPoint(unsigned short index, const Ogre::Vector3 &value)
Change the location of an existing point in the point list.
Definition: physicsdebugdrawer.cpp:213
btDynamicsWorld * mWorld
Definition: physicsdebugdrawer.h:136
void step()
Definition: physicsdebugdrawer.cpp:315
void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)
Definition: physicsdebugdrawer.cpp:332
virtual ~DynamicLines()
Definition: physicsdebugdrawer.cpp:176
DynamicRenderable()
Constructor.
Definition: physicsdebugdrawer.cpp:33
size_t mIndexBufferCapacity
Maximum capacity of the currently allocated index buffer.
Definition: physicsdebugdrawer.h:40
virtual void createVertexDeclaration()
Implementation DynamicRenderable, creates a simple vertex-only decl.
Definition: physicsdebugdrawer.cpp:232
void clear()
Remove all points from the point list.
Definition: physicsdebugdrawer.cpp:221
PhysicsDebugDrawer(Ogre::SceneNode *node, btDynamicsWorld *world)
Definition: physicsdebugdrawer.cpp:288
OperationType getOperationType() const
Definition: physicsdebugdrawer.cpp:185
virtual void createVertexDeclaration()=0
void addPoint(const Ogre::Vector3 &p)
Add a point to the point list.
Definition: physicsdebugdrawer.cpp:190
void reportErrorWarning(const char *warningString)
Definition: physicsdebugdrawer.cpp:344
std::vector< Ogre::Vector3 > mPoints
Definition: physicsdebugdrawer.h:126
void setOperationType(OperationType opType)
Definition: physicsdebugdrawer.cpp:180
~PhysicsDebugDrawer()
Definition: physicsdebugdrawer.cpp:308
Definition: physicsdebugdrawer.h:12
Definition: physicsdebugdrawer.h:132
Ogre::RenderOperation::OperationType OperationType
Definition: physicsdebugdrawer.h:79
virtual void fillHardwareBuffers()
Implementation DynamicRenderable, pushes point list out to hardware memory.
Definition: physicsdebugdrawer.cpp:238
bool mDirty
Definition: physicsdebugdrawer.h:127
void draw3dText(const btVector3 &location, const char *textString)
Definition: physicsdebugdrawer.cpp:349
bool mDebugOn
Definition: physicsdebugdrawer.h:138
DynamicLines(OperationType opType=Ogre::RenderOperation::OT_LINE_STRIP)
Constructor - see setOperationType() for description of argument.
Definition: physicsdebugdrawer.cpp:169
const Ogre::Vector3 & getPoint(unsigned short index) const
Return the location of an existing point in the point list.
Definition: physicsdebugdrawer.cpp:202
void initialize(Ogre::RenderOperation::OperationType operationType, bool useIndices)
Definition: physicsdebugdrawer.cpp:43
virtual ~DynamicRenderable()
Virtual destructor.
Definition: physicsdebugdrawer.cpp:37
virtual Ogre::Real getSquaredViewDepth(const Ogre::Camera *cam) const
Implementation of SimpleRenderable.
Definition: physicsdebugdrawer.cpp:150
size_t mVertexBufferCapacity
Maximum capacity of the currently allocated vertex buffer.
Definition: physicsdebugdrawer.h:38
Ogre::SceneNode * mNode
Definition: physicsdebugdrawer.h:135
std::vector< Ogre::Vector3 > Vector3Array
Definition: physicsdebugdrawer.h:10
virtual Ogre::Real getBoundingRadius(void) const
Implementation of SimpleRenderable.
Definition: physicsdebugdrawer.cpp:145
void prepareHardwareBuffers(size_t vertexCount, size_t indexCount)
Definition: physicsdebugdrawer.cpp:61
void drawContactPoint(const btVector3 &PointOnB, const btVector3 &normalOnB, btScalar distance, int lifeTime, const btVector3 &color)
Definition: physicsdebugdrawer.cpp:338
Definition: physicsdebugdrawer.h:77
void setDebugMode(int isOn)
Definition: physicsdebugdrawer.cpp:353
virtual void fillHardwareBuffers()=0