diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-11-07 19:24:24 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-11-07 19:24:24 +0100 |
commit | f49c93a5dfc0aeb5c0087cc9adfeb68526a2b0a7 (patch) | |
tree | d9bdec5dfad314c42569297e74612588daf99653 /src/crepe/api/Vector2.h | |
parent | 7131a94fcfab041cb2dbaccefadb12d1db022d73 (diff) |
Make format
Diffstat (limited to 'src/crepe/api/Vector2.h')
-rw-r--r-- | src/crepe/api/Vector2.h | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/src/crepe/api/Vector2.h b/src/crepe/api/Vector2.h index d571209..741951b 100644 --- a/src/crepe/api/Vector2.h +++ b/src/crepe/api/Vector2.h @@ -2,47 +2,46 @@ namespace crepe { - //! Vector2 class - class Vector2 { - public: - //! X component of the vector - float x; - //! Y component of the vector - float y; +//! Vector2 class +class Vector2 { +public: + //! X component of the vector + float x; + //! Y component of the vector + float y; - //! Default constructor - Vector2() = default; + //! Default constructor + Vector2() = default; - //! Constructor with initial values - Vector2(float x, float y); + //! Constructor with initial values + Vector2(float x, float y); - //! Subtracts another vector from this vector and returns the result. - Vector2 operator-(const Vector2& other) const; + //! Subtracts another vector from this vector and returns the result. + Vector2 operator-(const Vector2 & other) const; - //! Adds another vector to this vector and returns the result. - Vector2 operator+(const Vector2& other) const; + //! Adds another vector to this vector and returns the result. + Vector2 operator+(const Vector2 & other) const; - //! Multiplies this vector by a scalar and returns the result. - Vector2 operator*(float scalar) const; + //! Multiplies this vector by a scalar and returns the result. + Vector2 operator*(float scalar) const; - //! Multiplies this vector by another vector element-wise and updates this vector. - Vector2& operator*=(const Vector2& other); + //! Multiplies this vector by another vector element-wise and updates this vector. + Vector2 & operator*=(const Vector2 & other); - //! Adds another vector to this vector and updates this vector. - Vector2& operator+=(const Vector2& other); + //! Adds another vector to this vector and updates this vector. + Vector2 & operator+=(const Vector2 & other); - //! Adds a scalar value to both components of this vector and updates this vector. - Vector2& operator+=(float other); + //! Adds a scalar value to both components of this vector and updates this vector. + Vector2 & operator+=(float other); - //! Returns the negation of this vector. - Vector2 operator-() const; + //! Returns the negation of this vector. + Vector2 operator-() const; - //! Checks if this vector is equal to another vector. - bool operator==(const Vector2& other) const; + //! Checks if this vector is equal to another vector. + bool operator==(const Vector2 & other) const; - //! Checks if this vector is not equal to another vector. - bool operator!=(const Vector2& other) const; - - }; + //! Checks if this vector is not equal to another vector. + bool operator!=(const Vector2 & other) const; +}; } // namespace crepe |