diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-11-21 17:04:37 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-11-21 17:04:37 +0100 |
commit | adbd81d3937a1363af312202c7e4b5ec0bf3458d (patch) | |
tree | a45ebed952a0d4720f93192cf5f638f6e2f2961d /src/crepe/api/Vector2.h | |
parent | 115d6f50152dc018073345800ca90b85846ebaa9 (diff) |
Made Vector2 templated
Diffstat (limited to 'src/crepe/api/Vector2.h')
-rw-r--r-- | src/crepe/api/Vector2.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/crepe/api/Vector2.h b/src/crepe/api/Vector2.h index 2fb6136..0e41936 100644 --- a/src/crepe/api/Vector2.h +++ b/src/crepe/api/Vector2.h @@ -3,11 +3,12 @@ namespace crepe { //! 2D vector +template <class T> struct Vector2 { //! X component of the vector - double x = 0; + T x = 0; //! Y component of the vector - double y = 0; + T y = 0; //! Subtracts another vector from this vector and returns the result. Vector2 operator-(const Vector2 & other) const; @@ -38,3 +39,5 @@ struct Vector2 { }; } // namespace crepe + +#include "Vector2.hpp" |