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