Untitled Game engine no.5  1.0
Debug.hpp
1 //
2 // Created by jibbo on 3/30/21.
3 //
4 
5 #ifndef ENGINE_PROJ_DEBUG_H
6 #define ENGINE_PROJ_DEBUG_H
7 
8 #endif //ENGINE_PROJ_DEBUG_H
9 
10 #include "GLBuffer.hpp"
11 #include <cstring>
12 #include <map>
13 
14 namespace Engine {
19  struct Debug {
20  public:
21  static std::map<std::string, float> varLookup;
22 
23 
29  static void setDebug(const std::string& key, float var);
30 
36  static float& getDebug(const std::string &key);
37 
42  static glm::mat4 offset() {
43  glm::mat4 out = glm::mat4(1);
44 
45  out *= glm::scale(glm::vec3{1.f, 1.f, 1.f});
46 
47  out *= glm::rotate(glm::radians(Debug::getDebug("debug_ry")), glm::vec3{0.f, 1.f, 0.f});
48  out *= glm::rotate(glm::radians(Debug::getDebug("debug_rx")), glm::vec3{1.f, 0.f, 0.f});
49 
50  out *= glm::translate(glm::vec3 {
51  Debug::getDebug("debug_x"),
52  Debug::getDebug("debug_y"),
53  Debug::getDebug("debug_z")});
54 
55 // std::cout << glm::to_string(out) << std::endl;
56 
57  return out;
58  }
59  };
60 
61 
62 }
Engine::Debug
Definition: Debug.hpp:19
Engine
Definition: Animation.hpp:14
Engine::Debug::getDebug
static float & getDebug(const std::string &key)
Definition: Debug.cpp:18
Engine::Debug::setDebug
static void setDebug(const std::string &key, float var)
Definition: Debug.cpp:14
Engine::Debug::offset
static glm::mat4 offset()
Definition: Debug.hpp:42