Tramway SDK
debugdrawer.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef PHYSICS_BULLET_DEBUGDRAWER_H
5#define PHYSICS_BULLET_DEBUGDRAWER_H
6
7#include <btBulletDynamicsCommon.h>
8#include <framework/gui.h>
9
10namespace tram::Physics::API {
11
12class PhysicsDebugDraw : public btIDebugDraw {
13public:
14
15 void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color) {
16 drawLine(PointOnB, normalOnB, color);
17 };
18
19 void reportErrorWarning(const char* warningString) {
20 std::cout << warningString << std::endl;
21 };
22
23 void draw3dText(const btVector3& location, const char* textString) {
24 //GUI::DebugText(textString, {location.getX(), location.getY(), location.getZ()}, Render::COLOR_WHITE);
25 };
26
27 void setDebugMode(int debugMode) {};
28
29 int getDebugMode() const {
30 return DBG_MAX_DEBUG_DRAW_MODE;
31 }
32
33 void drawLine(const btVector3& from, const btVector3& to, const btVector3& color){
35 {from.getX(), from.getY(), from.getZ()},
36 {to.getX(), to.getY(), to.getZ()},
37 {color.getX(), color.getY(), color.getZ()}
38 );
39 }
40};
41
42}
43
44#endif // PHYSICS_BULLET_DEBUGDRAWER_H
Definition: debugdrawer.h:12
void reportErrorWarning(const char *warningString)
Definition: debugdrawer.h:19
void setDebugMode(int debugMode)
Definition: debugdrawer.h:27
void draw3dText(const btVector3 &location, const char *textString)
Definition: debugdrawer.h:23
void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)
Definition: debugdrawer.h:33
int getDebugMode() const
Definition: debugdrawer.h:29
void drawContactPoint(const btVector3 &PointOnB, const btVector3 &normalOnB, btScalar distance, int lifeTime, const btVector3 &color)
Definition: debugdrawer.h:15
Definition: api.h:10
void AddLine(vec3 from, vec3 to, vec3 color)
Definition: render.cpp:228