1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 00:49:54 +00:00
openmw-tes3mp/apps/openmw/mwrender/bulletdebugdraw.hpp

62 lines
1.2 KiB
C++
Raw Normal View History

2015-05-02 22:39:01 +00:00
#ifndef OPENMW_MWRENDER_BULLETDEBUGDRAW_H
#define OPENMW_MWRENDER_BULLETDEBUGDRAW_H
#include <osg/ref_ptr>
#include <osg/Array>
#include <osg/PrimitiveSet>
2015-05-27 20:32:11 +00:00
#include <LinearMath/btIDebugDraw.h>
class btCollisionWorld;
2015-05-27 20:32:11 +00:00
2015-05-02 22:39:01 +00:00
namespace osg
{
class Group;
class Geometry;
}
namespace MWRender
{
class DebugDrawer : public btIDebugDraw
{
protected:
osg::ref_ptr<osg::Group> mParentNode;
btCollisionWorld *mWorld;
2015-05-02 22:39:01 +00:00
osg::ref_ptr<osg::Geometry> mGeometry;
osg::ref_ptr<osg::Vec3Array> mVertices;
osg::ref_ptr<osg::DrawArrays> mDrawArrays;
bool mDebugOn;
2015-05-24 02:28:34 +00:00
void createGeometry();
void destroyGeometry();
2015-05-02 22:39:01 +00:00
public:
DebugDrawer(osg::ref_ptr<osg::Group> parentNode, btCollisionWorld *world);
2015-05-02 22:39:01 +00:00
~DebugDrawer();
void step();
void drawLine(const btVector3& from,const btVector3& to,const btVector3& color);
void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color);
void reportErrorWarning(const char* warningString);
void draw3dText(const btVector3& location,const char* textString) {}
//0 for off, anything else for on.
void setDebugMode(int isOn);
//0 for off, anything else for on.
int getDebugMode() const;
};
}
#endif