Breakout
Vec2.h
Go to the documentation of this file.
1 #ifndef VEC2
2 #define VEC2
6 class Vec2 {
7 
8 public:
12  Vec2();
18  Vec2(float x, float y);
24  Vec2 operator+(Vec2 const& rhs);
30  Vec2& operator+= (Vec2 const& rhs);
36  Vec2 operator*(float);
40  float x;
44  float y;
45 };
46 
47 #endif
Vec2 will abstract X&Y position for ball and paddle.
Definition: Vec2.h:6
Vec2 operator*(float)
This method is overloading the * operator to make it easier for us to calculate in certain scenario.
Definition: Vec2.cpp:24
float y
The Y coordinate.
Definition: Vec2.h:44
Vec2 & operator+=(Vec2 const &rhs)
This method is overloading the += operator to make it easier for us to calculate in certain scenario.
Definition: Vec2.cpp:16
Vec2()
Default constructor for Vec2() class.
Definition: Vec2.cpp:3
Vec2 operator+(Vec2 const &rhs)
This method is overloading the + operator to make it easier for us to calculate in certain scenario.
Definition: Vec2.cpp:11
float x
The X coordinate.
Definition: Vec2.h:40
GLint y
Definition: glad.h:1462
GLdouble x
Definition: glad.h:2344