Leviathan  0.8.0.0
Leviathan game engine
PhysicsDebugDrawer.h
Go to the documentation of this file.
1 // Leviathan Game Engine
2 // Copyright (c) 2012-2019 Henri Hyyryläinen
3 #include "Define.h"
4 #pragma once
5 // ------------------------------------ //
6 #include "LinearMath/btIDebugDraw.h"
7 
8 
9 namespace Leviathan {
10 class Window;
11 
12 class PhysicsDebugDrawer : public btIDebugDraw {
13 public:
15  PhysicsDebugDrawer(Window& drawtarget, GameWorld& cameraworld);
16 
17  void drawLine(const btVector3& from, const btVector3& to, const btVector3& color) override;
18 
19  void drawSphere(const btVector3& p, btScalar radius, const btVector3& color) override;
20 
21  void drawContactPoint(const btVector3& pointOnB, const btVector3& normalOnB,
22  btScalar distance, int lifeTime, const btVector3& color) override;
23 
24  void reportErrorWarning(const char* warningString) override;
25 
26  void draw3dText(const btVector3& location, const char* textString) override {}
27 
28  void setDebugMode(int mode) override
29  {
30  DebugMode = mode;
31  }
32 
33  int getDebugMode() const override
34  {
35  return DebugMode;
36  }
37 
38  DLLEXPORT void OnBeginDraw();
39 
40 protected:
41  int DebugMode = btIDebugDraw::DBG_DrawWireframe;
42 
43 private:
44  Window& Target;
45  GameWorld& World;
46 };
47 } // namespace Leviathan
void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color) override
void reportErrorWarning(const char *warningString) override
PhysicsDebugDrawer(Window &drawtarget, GameWorld &cameraworld)
void drawSphere(const btVector3 &p, btScalar radius, const btVector3 &color) override
float btScalar
Definition: PhysicalWorld.h:30
void setDebugMode(int mode) override
void drawContactPoint(const btVector3 &pointOnB, const btVector3 &normalOnB, btScalar distance, int lifeTime, const btVector3 &color) override
int getDebugMode() const override
std::iterator_traits< octet_iterator >::difference_type distance(octet_iterator first, octet_iterator last)
Definition: checked.h:198
void draw3dText(const btVector3 &location, const char *textString) override
#define DLLEXPORT
Definition: Include.h:84
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12
Represents a world that contains entities.
Definition: GameWorld.h:57