Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "Util.h"
- #include <iostream>
- /*
- Basic Vector class to avoid depndency on glm. This class
- is a exception on it's styling, since normally the codebase uses
- getters and setters instead of public variables. Also the m_
- prefix on class variables is not used on the Vector class.
- */
- class TVector2
- {
- public:
- TVector2();
- TVector2(int x, int y);
- TVector2(float x, float y);
- ~TVector2();
- TVector2 operator+(const TVector2& other);
- TVector2 operator+=(const TVector2& other);
- TVector2 operator+(float other);
- TVector2 operator-(const TVector2& other);
- TVector2 operator-(float other);
- TVector2 operator-();
- TVector2 operator*(const TVector2& other);
- TVector2 operator*(float other);
- TVector2 operator/(float other);
- bool operator==(const TVector2& other);
- friend std::ostream &operator<<(std::ostream &out, TVector2 vector)
- {
- out << "X:" << vector.X << " Y:" << vector.Y;
- return out;
- }
- float X;
- float Y;
- void Abs();
- void Clamp(TVector2 minValue, TVector2 maxValue);
- static TVector2 Lerp(TVector2 vector1, TVector2 vector2, float amount);
- static TVector2 Random(int minValue, int maxValue);
- static TVector2 Random(TVector2 minValue, TVector2 maxValue);
- int GetLenght();
- protected:
- private:
- };
Advertisement
Add Comment
Please, Sign In to add comment