1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-10-05 16:47:19 +02:00
openrw/framework2/include/renderwure/render/DebugDraw.hpp
Daniel Evans 04a8a7d9c5 Improved Collision data loading and debugging.
- Removed interleaved data from CollisionInstance as Bullet didn't
understand.
- Improved performance of the DebugDraw to around 2-3 fps
2013-07-22 02:38:43 +01:00

42 lines
1014 B
C++

#pragma once
#include <LinearMath/btIDebugDraw.h>
#define GLEW_STATIC
#include <GL/glew.h>
#include <vector>
#include <glm/glm.hpp>
class DebugDraw : public btIDebugDraw
{
public:
DebugDraw();
~DebugDraw();
void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color);
void drawTriangle(const btVector3 &a, const btVector3 &b, const btVector3 &c, const btVector3 &color, btScalar alpha);
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);
void setDebugMode(int debugMode);
int getDebugMode() const;
void drawAllLines();
void setShaderProgram(GLuint shaderProgram) {
this->shaderProgram = shaderProgram;
}
protected:
int debugMode;
std::vector<glm::vec3> lines;
size_t maxlines;
btVector3 color;
GLuint shaderProgram;
GLuint vbo, vao, texture;
};