Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: a23ceccbee1eea2560add9af3188eb705f3bc7d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
   render/debugdrawer.h
   This file is part of the Osirion project and is distributed under
   the terms of the GNU General Public License version 2
*/

#ifndef __INCLUDED_RENDER_DEBUGDRAWER_H__
#define __INCLUDED_RENDER_DEBUGDRAWER_H__

#include "LinearMath/btIDebugDraw.h"

namespace render {

/**
 * @brief implementation for the bullet debug draw interface
 * This class implements the bullet btIDebugDraw interface to
 * render the world as seen by the bullet physics library
 */
class DebugDrawer: public btIDebugDraw
{
public:
        DebugDrawer();
	virtual ~DebugDrawer();

        virtual void drawLine(const btVector3 & from, const btVector3 & to, const btVector3 & color);
	
	virtual void drawLine(const btVector3& from, const btVector3 & to, const btVector3 & fromColor, const btVector3 & toColor);
	
	virtual void drawContactPoint(const btVector3 & point, const btVector3 & normal, btScalar distance, int lifetime, const btVector3 & color);
	
	virtual void drawSphere(btScalar radius, const btTransform & transform, const btVector3 & color);
	
	virtual void drawSphere(const btVector3 & p, btScalar radius, const btVector3 & color);

	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 reportErrorWarning(const char *warningString);
	
	virtual void draw3dText(const btVector3 &location, const char *textString);
	
	virtual void setDebugMode(int debugMode);
	
	virtual int getDebugMode() const;
	
private:
	int 			debugdrawer_debugmode;
};

extern DebugDrawer bullet_debugdrawer;
} // namespace render

#endif // __INCLUDED_RENDER_DEBUGDRAWER_H__