From b7fadd730a78671a0eaf55c36df24c04661ef2c3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 16 Nov 2021 00:07:48 +0000 Subject: Swap y,z axis This was a pain... but all the coords make much more sense now and a lot of mystery negation has disappeared. --- lib/maths.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lib/maths.h') diff --git a/lib/maths.h b/lib/maths.h index c02123a..285c69a 100644 --- a/lib/maths.h +++ b/lib/maths.h @@ -18,11 +18,13 @@ struct Arc : public std::pair { } }; -constexpr const glm::vec3 up {0, 1, 0}; -constexpr const glm::vec3 north {0, 0, 1}; -constexpr const glm::vec3 south {0, 0, -1}; -constexpr const glm::vec3 east {-1, 0, 0}; -constexpr const glm::vec3 west {1, 0, 0}; +constexpr const glm::vec3 origin {0, 0, 0}; +constexpr const glm::vec3 up {0, 0, 1}; +constexpr const glm::vec3 down {0, 0, -1}; +constexpr const glm::vec3 north {0, 1, 0}; +constexpr const glm::vec3 south {0, -1, 0}; +constexpr const glm::vec3 east {1, 0, 0}; +constexpr const glm::vec3 west {-1, 0, 0}; constexpr auto half_pi {glm::half_pi()}; constexpr auto quarter_pi {half_pi / 2}; constexpr auto pi {glm::pi()}; @@ -73,13 +75,13 @@ rdiv(Ta a, Tb b) constexpr inline glm::vec2 operator!(const glm::vec3 & v) { - return {v.x, v.z}; + return {v.x, v.y}; } constexpr inline glm::vec3 -operator^(const glm::vec2 & v, float y) +operator^(const glm::vec2 & v, float z) { - return {v.x, y, v.y}; + return {v.x, v.y, z}; } constexpr inline glm::vec3 -- cgit v1.2.3