From d6e99a696aa582b81018078b68f6600c8030d643 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 7 Nov 2023 02:51:42 +0000 Subject: WIP typedefing all the things - headers --- lib/location.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/location.h') diff --git a/lib/location.h b/lib/location.h index 078f5d3..7f2b44d 100644 --- a/lib/location.h +++ b/lib/location.h @@ -1,14 +1,16 @@ #pragma once +#include "config/types.h" #include -#include class Location { public: - explicit Location(glm::vec3 pos = {}, glm::vec3 rot = {}) : pos {pos}, rot {rot} { } +#ifndef __cpp_aggregate_paren_init + explicit Location(Position3D pos = {}, Rotation3D rot = {}) : pos {pos}, rot {rot} { } +#endif - glm::mat4 getTransform() const; + [[nodiscard]] glm::mat4 getTransform() const; - glm::vec3 pos; - glm::vec3 rot; + Position3D pos; + Rotation3D rot; }; -- cgit v1.2.3 From 5bc0462311ab4c691102f0bc39d6ae03c61a287b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 11 Nov 2023 17:32:05 +0000 Subject: Add Location method for getting the rotation only transform --- lib/location.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/location.h') diff --git a/lib/location.h b/lib/location.h index 7f2b44d..55737ae 100644 --- a/lib/location.h +++ b/lib/location.h @@ -10,6 +10,7 @@ public: #endif [[nodiscard]] glm::mat4 getTransform() const; + [[nodiscard]] glm::mat4 getRotationTransform() const; Position3D pos; Rotation3D rot; -- cgit v1.2.3 From 3200eb41d60595813dca751fe15193ba0b44dddf Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 25 Nov 2023 14:32:56 +0000 Subject: Remove getTransform --- lib/location.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/location.h') diff --git a/lib/location.h b/lib/location.h index 55737ae..85834a0 100644 --- a/lib/location.h +++ b/lib/location.h @@ -9,7 +9,6 @@ public: explicit Location(Position3D pos = {}, Rotation3D rot = {}) : pos {pos}, rot {rot} { } #endif - [[nodiscard]] glm::mat4 getTransform() const; [[nodiscard]] glm::mat4 getRotationTransform() const; Position3D pos; -- cgit v1.2.3 From 0aa665c3648d788755b00c9e431c872d57fddbb8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 25 Nov 2023 16:28:39 +0000 Subject: 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 --- lib/location.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/location.h') diff --git a/lib/location.h b/lib/location.h index 85834a0..8570fc2 100644 --- a/lib/location.h +++ b/lib/location.h @@ -6,11 +6,11 @@ class Location { public: #ifndef __cpp_aggregate_paren_init - explicit Location(Position3D pos = {}, Rotation3D rot = {}) : pos {pos}, rot {rot} { } + explicit Location(GlobalPosition3D pos = {}, Rotation3D rot = {}) : pos {pos}, rot {rot} { } #endif [[nodiscard]] glm::mat4 getRotationTransform() const; - Position3D pos; + GlobalPosition3D pos; Rotation3D rot; }; -- cgit v1.2.3