summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-25 16:28:39 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-25 16:28:39 +0000
commit0aa665c3648d788755b00c9e431c872d57fddbb8 (patch)
tree859dba97d3026db485813d808e8180ac94a0ed2a /config
parentRemove getTransform (diff)
downloadilt-0aa665c3648d788755b00c9e431c872d57fddbb8.tar.bz2
ilt-0aa665c3648d788755b00c9e431c872d57fddbb8.tar.xz
ilt-0aa665c3648d788755b00c9e431c872d57fddbb8.zip
Model positions as integers
Introduces test failure in arcs due to rounding, but I don't want to create a complicated fix as link positions are still floats and hopefully that'll go away... somehow
Diffstat (limited to 'config')
-rw-r--r--config/types.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/config/types.h b/config/types.h
index d99735e..6fc7b61 100644
--- a/config/types.h
+++ b/config/types.h
@@ -3,10 +3,14 @@
#include "glad/gl.h"
#include <glm/geometric.hpp>
-using Distance = float;
+using Distance = float; // deprecate
+using RelativeDistance = float;
+using GlobalDistance = int32_t;
using Angle = float;
-template<glm::length_t D> using Position = glm::vec<D, Distance>;
+template<glm::length_t D> using Position = glm::vec<D, Distance>; // deprecate
+template<glm::length_t D> using RelativePosition = glm::vec<D, RelativeDistance>;
+template<glm::length_t D> using GlobalPosition = glm::vec<D, GlobalDistance>;
template<glm::length_t D> using Size = glm::vec<D, Distance>;
template<glm::length_t D> using Scale = glm::vec<D, float>;
template<glm::length_t D> using Direction = glm::vec<D, float>;
@@ -14,8 +18,15 @@ template<glm::length_t D> using Normal = Direction<D>;
template<glm::length_t D> using Rotation = glm::vec<D, Angle>;
template<glm::length_t Channels> using Colour = glm::vec<Channels, float>;
-using Position2D = Position<2>;
-using Position3D = Position<3>;
+using Position2D = Position<2>; // deprecate
+using Position3D = Position<3>; // deprecate
+using BaryPosition = glm::vec<2, float>;
+using RelativePosition2D = RelativePosition<2>;
+using RelativePosition3D = RelativePosition<3>;
+using RelativePosition4D = RelativePosition<4>;
+using GlobalPosition2D = GlobalPosition<2>;
+using GlobalPosition3D = GlobalPosition<3>;
+using GlobalPosition4D = GlobalPosition<4>;
using Size2D = Size<2>;
using Size3D = Size<3>;
using Scale2D = Scale<2>;