Loading include/math/vector2d.h +44 −0 Original line number Original line Diff line number Diff line Loading @@ -215,15 +215,27 @@ public: /// Vector addition operator /// Vector addition operator VECTOR2<T> operator+( const VECTOR2<T>& aVector ) const; VECTOR2<T> operator+( const VECTOR2<T>& aVector ) const; /// Scalar addition operator VECTOR2<T> operator+( const T& aScalar ) const; /// Compound assignment operator /// Compound assignment operator VECTOR2<T>& operator+=( const VECTOR2<T>& aVector ); VECTOR2<T>& operator+=( const VECTOR2<T>& aVector ); /// Compound assignment operator VECTOR2<T>& operator+=( const T& aScalar ); /// Vector subtraction operator /// Vector subtraction operator VECTOR2<T> operator-( const VECTOR2<T>& aVector ) const; VECTOR2<T> operator-( const VECTOR2<T>& aVector ) const; /// Scalar subtraction operator VECTOR2<T> operator-( const T& aScalar ) const; /// Compound assignment operator /// Compound assignment operator VECTOR2<T>& operator-=( const VECTOR2<T>& aVector ); VECTOR2<T>& operator-=( const VECTOR2<T>& aVector ); /// Compound assignment operator VECTOR2<T>& operator-=( const T& aScalar ); /// Negate Vector operator /// Negate Vector operator VECTOR2<T> operator-(); VECTOR2<T> operator-(); Loading Loading @@ -330,6 +342,15 @@ VECTOR2<T>& VECTOR2<T>::operator+=( const VECTOR2<T>& aVector ) } } template <class T> VECTOR2<T>& VECTOR2<T>::operator+=( const T& aScalar ) { x += aScalar; y += aScalar; return *this; } template <class T> template <class T> VECTOR2<T>& VECTOR2<T>::operator-=( const VECTOR2<T>& aVector ) VECTOR2<T>& VECTOR2<T>::operator-=( const VECTOR2<T>& aVector ) { { Loading @@ -339,6 +360,15 @@ VECTOR2<T>& VECTOR2<T>::operator-=( const VECTOR2<T>& aVector ) } } template <class T> VECTOR2<T>& VECTOR2<T>::operator-=( const T& aScalar ) { x -= aScalar; y -= aScalar; return *this; } template <class T> template <class T> int VECTOR2<T>::LineSide( const VECTOR2<T>& aStart, const VECTOR2<T>& aEnd ) const int VECTOR2<T>::LineSide( const VECTOR2<T>& aStart, const VECTOR2<T>& aEnd ) const { { Loading Loading @@ -463,6 +493,13 @@ VECTOR2<T> VECTOR2<T>::operator+( const VECTOR2<T>& aVector ) const } } template <class T> VECTOR2<T> VECTOR2<T>::operator+( const T& aScalar ) const { return VECTOR2<T> ( x + aScalar, y + aScalar ); } template <class T> template <class T> VECTOR2<T> VECTOR2<T>::operator-( const VECTOR2<T>& aVector ) const VECTOR2<T> VECTOR2<T>::operator-( const VECTOR2<T>& aVector ) const { { Loading @@ -470,6 +507,13 @@ VECTOR2<T> VECTOR2<T>::operator-( const VECTOR2<T>& aVector ) const } } template <class T> VECTOR2<T> VECTOR2<T>::operator-( const T& aScalar ) const { return VECTOR2<T> ( x - aScalar, y - aScalar ); } template <class T> template <class T> VECTOR2<T> VECTOR2<T>::operator-() VECTOR2<T> VECTOR2<T>::operator-() { { Loading Loading
include/math/vector2d.h +44 −0 Original line number Original line Diff line number Diff line Loading @@ -215,15 +215,27 @@ public: /// Vector addition operator /// Vector addition operator VECTOR2<T> operator+( const VECTOR2<T>& aVector ) const; VECTOR2<T> operator+( const VECTOR2<T>& aVector ) const; /// Scalar addition operator VECTOR2<T> operator+( const T& aScalar ) const; /// Compound assignment operator /// Compound assignment operator VECTOR2<T>& operator+=( const VECTOR2<T>& aVector ); VECTOR2<T>& operator+=( const VECTOR2<T>& aVector ); /// Compound assignment operator VECTOR2<T>& operator+=( const T& aScalar ); /// Vector subtraction operator /// Vector subtraction operator VECTOR2<T> operator-( const VECTOR2<T>& aVector ) const; VECTOR2<T> operator-( const VECTOR2<T>& aVector ) const; /// Scalar subtraction operator VECTOR2<T> operator-( const T& aScalar ) const; /// Compound assignment operator /// Compound assignment operator VECTOR2<T>& operator-=( const VECTOR2<T>& aVector ); VECTOR2<T>& operator-=( const VECTOR2<T>& aVector ); /// Compound assignment operator VECTOR2<T>& operator-=( const T& aScalar ); /// Negate Vector operator /// Negate Vector operator VECTOR2<T> operator-(); VECTOR2<T> operator-(); Loading Loading @@ -330,6 +342,15 @@ VECTOR2<T>& VECTOR2<T>::operator+=( const VECTOR2<T>& aVector ) } } template <class T> VECTOR2<T>& VECTOR2<T>::operator+=( const T& aScalar ) { x += aScalar; y += aScalar; return *this; } template <class T> template <class T> VECTOR2<T>& VECTOR2<T>::operator-=( const VECTOR2<T>& aVector ) VECTOR2<T>& VECTOR2<T>::operator-=( const VECTOR2<T>& aVector ) { { Loading @@ -339,6 +360,15 @@ VECTOR2<T>& VECTOR2<T>::operator-=( const VECTOR2<T>& aVector ) } } template <class T> VECTOR2<T>& VECTOR2<T>::operator-=( const T& aScalar ) { x -= aScalar; y -= aScalar; return *this; } template <class T> template <class T> int VECTOR2<T>::LineSide( const VECTOR2<T>& aStart, const VECTOR2<T>& aEnd ) const int VECTOR2<T>::LineSide( const VECTOR2<T>& aStart, const VECTOR2<T>& aEnd ) const { { Loading Loading @@ -463,6 +493,13 @@ VECTOR2<T> VECTOR2<T>::operator+( const VECTOR2<T>& aVector ) const } } template <class T> VECTOR2<T> VECTOR2<T>::operator+( const T& aScalar ) const { return VECTOR2<T> ( x + aScalar, y + aScalar ); } template <class T> template <class T> VECTOR2<T> VECTOR2<T>::operator-( const VECTOR2<T>& aVector ) const VECTOR2<T> VECTOR2<T>::operator-( const VECTOR2<T>& aVector ) const { { Loading @@ -470,6 +507,13 @@ VECTOR2<T> VECTOR2<T>::operator-( const VECTOR2<T>& aVector ) const } } template <class T> VECTOR2<T> VECTOR2<T>::operator-( const T& aScalar ) const { return VECTOR2<T> ( x - aScalar, y - aScalar ); } template <class T> template <class T> VECTOR2<T> VECTOR2<T>::operator-() VECTOR2<T> VECTOR2<T>::operator-() { { Loading