32 float length()
const {
return (sqrt(pow(
x, 2) + pow(
y, 2))); };
a Vector2 class
Definition: Vector.hpp:20
bool operator==(const Vector2 &other) const
overload operator == to compare two Vector2
Definition: Vector.hpp:43
Vector2 & operator-=(const Vector2 &vec)
overload of the -= operator
Definition: Vector.hpp:68
float dotProduct(Vector2 vec) const
calculate the dot product of the vector
Definition: Vector.hpp:39
Vector2< T > operator/(const T &val) const
overload of the / operator
Definition: Vector.hpp:89
Vector2 & operator+=(const Vector2 &vec)
overload of the += operator
Definition: Vector.hpp:55
~Vector2()=default
destructor
float length() const
calculate the length of the vector
Definition: Vector.hpp:32
Vector2(T x, T y)
constructor
Definition: Vector.hpp:27
Vector2 operator+(const Vector2 &vec) const
overload of the + operator
Definition: Vector.hpp:51
Vector2 normalize() const
normalize the vector
Definition: Vector.hpp:35
Vector2< T > & operator*=(const T &val)
overload of the *= operator
Definition: Vector.hpp:80
T y
Definition: Vector.hpp:101
T x
Definition: Vector.hpp:98
Vector2< T > & operator/=(const T &val)
overload of the /= operator
Definition: Vector.hpp:93
Vector2 operator-(const Vector2 &vec) const
overload of the - operator
Definition: Vector.hpp:64
Vector2()=default
default constructor
bool operator!=(const Vector2 &other) const
overload operator != to compare two Vector2
Definition: Vector.hpp:47
Vector2< T > operator*(const T &val) const
overload of the * operator
Definition: Vector.hpp:76
Definition: AssetManager.hpp:15