| 1 | /*************************************************************************** |
|---|
| 2 | |
|---|
| 3 | This source file is part of OGREBULLET |
|---|
| 4 | (Object-oriented Graphics Rendering Engine Bullet Wrapper) |
|---|
| 5 | For the latest info, see http://www.ogre3d.org/phpBB2addons/viewforum.php?f=10 |
|---|
| 6 | |
|---|
| 7 | Copyright (c) 2007 tuan.kuranes@gmail.com (Use it Freely, even Statically, but have to contribute any changes) |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | This program is free software; you can redistribute it and/or modify it under |
|---|
| 12 | the terms of the GPL General Public License with runtime exception as published by the Free Software |
|---|
| 13 | Foundation; either version 2 of the License, or (at your option) any later |
|---|
| 14 | version. |
|---|
| 15 | |
|---|
| 16 | This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|---|
| 18 | FOR A PARTICULAR PURPOSE. See the GPL General Public License with runtime exception for more details. |
|---|
| 19 | |
|---|
| 20 | You should have received a copy of the GPL General Public License with runtime exception along with |
|---|
| 21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
|---|
| 22 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
|---|
| 23 | http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|---|
| 24 | ----------------------------------------------------------------------------- |
|---|
| 25 | */ |
|---|
| 26 | #ifndef _OgreBulletCollisions_DebugDrawer_H_ |
|---|
| 27 | #define _OgreBulletCollisions_DebugDrawer_H_ |
|---|
| 28 | |
|---|
| 29 | #include "OgreBulletCollisionsPreRequisites.h" |
|---|
| 30 | |
|---|
| 31 | #include "Debug/OgreBulletCollisionsDebugLines.h" |
|---|
| 32 | |
|---|
| 33 | namespace OgreBulletCollisions |
|---|
| 34 | { |
|---|
| 35 | //------------------------------------------------------------------------------------------------ |
|---|
| 36 | class DebugDrawer : public DebugLines, public btIDebugDraw |
|---|
| 37 | { |
|---|
| 38 | public: |
|---|
| 39 | DebugDrawer(); |
|---|
| 40 | virtual ~DebugDrawer(); |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | virtual void setDebugMode(int mode){mDebugMode = mode;}; |
|---|
| 44 | virtual int getDebugMode() const { return mDebugMode;}; |
|---|
| 45 | |
|---|
| 46 | virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color); |
|---|
| 47 | virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB, |
|---|
| 48 | btScalar distance,int lifeTime,const btVector3& color); |
|---|
| 49 | |
|---|
| 50 | void drawAabb(const Ogre::Vector3& from,const Ogre::Vector3& to,const Ogre::Vector3& color); |
|---|
| 51 | void drawLine(const Ogre::Vector3& from,const Ogre::Vector3& to,const Ogre::Vector3& color); |
|---|
| 52 | void drawContactPoint(const Ogre::Vector3& PointOnB,const Ogre::Vector3& normalOnB, |
|---|
| 53 | Ogre::Real distance,int lifeTime,const Ogre::Vector3& color); |
|---|
| 54 | |
|---|
| 55 | void setDrawAabb(bool enable); |
|---|
| 56 | void setDrawWireframe(bool enable); |
|---|
| 57 | void setDrawFeaturesText(bool enable); |
|---|
| 58 | void setDrawContactPoints(bool enable); |
|---|
| 59 | void setNoDeactivation(bool enable); |
|---|
| 60 | void setNoHelpText(bool enable); |
|---|
| 61 | void setDrawText(bool enable); |
|---|
| 62 | void setProfileTimings(bool enable); |
|---|
| 63 | void setEnableSatComparison(bool enable); |
|---|
| 64 | void setDisableBulletLCP (bool enable); |
|---|
| 65 | void setEnableCCD(bool enable); |
|---|
| 66 | |
|---|
| 67 | bool doesDrawAabb () const; |
|---|
| 68 | bool doesDrawWireframe () const; |
|---|
| 69 | bool doesDrawFeaturesText () const; |
|---|
| 70 | bool doesDrawContactPoints () const; |
|---|
| 71 | bool doesNoDeactivation () const; |
|---|
| 72 | bool doesNoHelpText () const; |
|---|
| 73 | bool doesDrawText () const; |
|---|
| 74 | bool doesProfileTimings () const; |
|---|
| 75 | bool doesEnableSatComparison () const; |
|---|
| 76 | bool doesDisableBulletLCP () const; |
|---|
| 77 | bool doesEnableCCD () const; |
|---|
| 78 | |
|---|
| 79 | void drawAabb(const btVector3& from,const btVector3& to,const btVector3& color); |
|---|
| 80 | |
|---|
| 81 | // TODO |
|---|
| 82 | void draw3dText(const btVector3& location,const char* textString); |
|---|
| 83 | |
|---|
| 84 | void reportErrorWarning(const char* warningString); |
|---|
| 85 | protected: |
|---|
| 86 | int mDebugMode; |
|---|
| 87 | }; |
|---|
| 88 | } |
|---|
| 89 | |
|---|
| 90 | #endif //_OgreBulletCollisions_DebugDrawer_H_ |
|---|
| 91 | |
|---|