From f2e5b685fd1357b55beeea967b12b353c5d65fb5 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Mon, 11 Nov 2024 20:49:55 +0100 Subject: fixed build issue --- src/crepe/api/Vector2.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/crepe/api/Vector2.h') diff --git a/src/crepe/api/Vector2.h b/src/crepe/api/Vector2.h index 741951b..90d9d57 100644 --- a/src/crepe/api/Vector2.h +++ b/src/crepe/api/Vector2.h @@ -6,15 +6,15 @@ namespace crepe { class Vector2 { public: //! X component of the vector - float x; + double x; //! Y component of the vector - float y; + double y; //! Default constructor Vector2() = default; //! Constructor with initial values - Vector2(float x, float y); + Vector2(double x, double y); //! Subtracts another vector from this vector and returns the result. Vector2 operator-(const Vector2 & other) const; @@ -23,7 +23,7 @@ public: Vector2 operator+(const Vector2 & other) const; //! Multiplies this vector by a scalar and returns the result. - Vector2 operator*(float scalar) const; + Vector2 operator*(double scalar) const; //! Multiplies this vector by another vector element-wise and updates this vector. Vector2 & operator*=(const Vector2 & other); @@ -32,7 +32,7 @@ public: Vector2 & operator+=(const Vector2 & other); //! Adds a scalar value to both components of this vector and updates this vector. - Vector2 & operator+=(float other); + Vector2 & operator+=(double other); //! Returns the negation of this vector. Vector2 operator-() const; @@ -42,6 +42,9 @@ public: //! Checks if this vector is not equal to another vector. bool operator!=(const Vector2 & other) const; + + //! + double dot(const Vector2& other) const; }; } // namespace crepe -- cgit v1.2.3