summaryrefslogtreecommitdiff
path: root/utility
diff options
context:
space:
mode:
Diffstat (limited to 'utility')
-rw-r--r--utility/maths.cpp6
-rw-r--r--utility/maths.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/utility/maths.cpp b/utility/maths.cpp
index aa44220..fb14a17 100644
--- a/utility/maths.cpp
+++ b/utility/maths.cpp
@@ -22,6 +22,12 @@ vector_yaw(const glm::vec3 & diff)
}
float
+vector_pitch(const glm::vec3 & diff)
+{
+ return std::atan(diff.y);
+}
+
+float
round_frac(const float & v, const float & frac)
{
return std::round(v / frac) * frac;
diff --git a/utility/maths.h b/utility/maths.h
index b8dd342..f2114ef 100644
--- a/utility/maths.h
+++ b/utility/maths.h
@@ -29,6 +29,7 @@ constexpr auto two_pi {glm::two_pi<float>()};
glm::mat4 flat_orientation(const glm::vec3 & diff);
float vector_yaw(const glm::vec3 & diff);
+float vector_pitch(const glm::vec3 & diff);
float round_frac(const float & v, const float & frac);