Orxonox  0.0.5 Codename: Arcturus
BulletDebugDrawer.h
Go to the documentation of this file.
1 #ifndef _BulletDebugDrawer_H__
2 #define _BulletDebugDrawer_H__
3 
4 #include "tools/ToolsPrereqs.h"
5 
6 #include <btBulletCollisionCommon.h>
7 #include <OgreFrameListener.h>
8 #include <OgreVector3.h>
9 #include <OgreColourValue.h>
10 
11 namespace orxonox
12 {
19  class _ToolsExport BulletDebugDrawer : public btIDebugDraw, public Ogre::FrameListener
20  {
21  public:
22  BulletDebugDrawer(Ogre::SceneManager* sceneManager);
24  virtual void drawLine(const btVector3& from, const btVector3& to, const btVector3& color) override;
25 // virtual void drawTriangle(const btVector3& v0, const btVector3& v1, const btVector3& v2, const btVector3& color, btScalar) override;
26  virtual void drawSphere (const btVector3& p, btScalar radius, const btVector3& color) override;
27  virtual void drawSphere(btScalar radius, const btTransform& transform, const btVector3& color) override;
28  virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btVector3& color) override;
29  virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btTransform& trans, const btVector3& color) override;
30  virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color) override;
31  virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color) override;
32 // virtual void drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color) override;
33 
34  virtual void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color) override;
35 
36  virtual void reportErrorWarning(const char* warningString) override;
37  virtual void draw3dText(const btVector3& location, const char* textString) override;
38 
39  virtual void setDebugMode(int debugMode) override;
40  virtual int getDebugMode() const override;
41 
42  void configure(bool bFill, float fillAlpha);
43 
44  protected:
45  virtual bool frameStarted(const Ogre::FrameEvent& evt) override;
46  virtual bool frameEnded(const Ogre::FrameEvent& evt) override;
47 
48  private:
49  struct ContactPoint
50  {
51  Ogre::Vector3 from;
52  Ogre::Vector3 to;
53  Ogre::ColourValue color;
54  size_t dieTime;
55  };
56 
57  bool bFill_;
59 
60  DebugDrawModes mDebugMode;
61  std::vector<ContactPoint>* mContactPoints;
62  std::vector<ContactPoint> mContactPoints1;
63  std::vector<ContactPoint> mContactPoints2;
64  };
65 }
66 
67 #endif /* _BulletDebugDrawer_H__ */
Definition: BulletDebugDrawer.h:49
std::vector< ContactPoint > * mContactPoints
Definition: BulletDebugDrawer.h:61
Ogre::Vector3 from
Definition: BulletDebugDrawer.h:51
Shared library macros, enums, constants and forward declarations for the tools module ...
size_t dieTime
Definition: BulletDebugDrawer.h:54
#define _ToolsExport
Definition: ToolsPrereqs.h:59
DebugDrawer is a utility to draw debug shapes (lines, triangles, spheres) with Ogre.
Definition: DebugDrawer.h:29
Originally from http://www.ogre3d.org/tikiwiki/BulletDebugDrawer&structure=Cookbook This source code ...
Definition: BulletDebugDrawer.h:19
bool bFill_
Definition: BulletDebugDrawer.h:57
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Ogre::ColourValue color
Definition: BulletDebugDrawer.h:53
std::vector< ContactPoint > mContactPoints2
Definition: BulletDebugDrawer.h:63
DebugDrawModes mDebugMode
Definition: BulletDebugDrawer.h:60
Ogre::Vector3 to
Definition: BulletDebugDrawer.h:52
DebugDrawer * drawer_
Definition: BulletDebugDrawer.h:58
std::vector< ContactPoint > mContactPoints1
Definition: BulletDebugDrawer.h:62