]> git.localhorst.tv Git - blank.git/blobdiff - src/model/geometry.hpp
show player orientation in debug overlay
[blank.git] / src / model / geometry.hpp
index df45fff2f2a2797d789b06b9bd2ad71feb3c6464..f1b3762d2905ff650ae44c435bd2b4cfdf1cfbaa 100644 (file)
@@ -13,6 +13,18 @@ constexpr float PI_0p5 = PI * 0.5f;
 constexpr float PI_1p5 = PI * 1.5f;
 constexpr float PI_2p0 = PI * 2.0f;
 
+constexpr float DEG_RAD_FACTOR = PI / 180.0f;
+constexpr float RAD_DEG_FACTOR = 180.0f / PI;
+
+constexpr float deg2rad(float d) {
+       return d * DEG_RAD_FACTOR;
+}
+
+constexpr float rad2deg(float r) {
+       return r * RAD_DEG_FACTOR;
+}
+
+
 struct AABB {
        glm::vec3 min;
        glm::vec3 max;