Breakout
Public Member Functions | Public Attributes | List of all members
Vec2 Class Reference

Vec2 will abstract X&Y position for ball and paddle. More...

#include <Vec2.h>

Public Member Functions

 Vec2 ()
 Default constructor for Vec2() class. More...
 
 Vec2 (float x, float y)
 Overloaded constructor that takes in two arguments. More...
 
Vec2 operator+ (Vec2 const &rhs)
 This method is overloading the + operator to make it easier for us to calculate in certain scenario. More...
 
Vec2operator+= (Vec2 const &rhs)
 This method is overloading the += operator to make it easier for us to calculate in certain scenario. More...
 
Vec2 operator* (float)
 This method is overloading the * operator to make it easier for us to calculate in certain scenario. More...
 

Public Attributes

float x
 The X coordinate. More...
 
float y
 The Y coordinate. More...
 

Detailed Description

Vec2 will abstract X&Y position for ball and paddle.

Constructor & Destructor Documentation

◆ Vec2() [1/2]

Vec2::Vec2 ( )

Default constructor for Vec2() class.

◆ Vec2() [2/2]

Vec2::Vec2 ( float  x,
float  y 
)

Overloaded constructor that takes in two arguments.

Parameters
xThe x Coordinate
yThe Y Coordinate

Member Function Documentation

◆ operator*()

Vec2 Vec2::operator* ( float  rhs)

This method is overloading the * operator to make it easier for us to calculate in certain scenario.

Parameters
rhsThe right hand side of the calculation
Returns
returns a Vec2 object

◆ operator+()

Vec2 Vec2::operator+ ( Vec2 const &  rhs)

This method is overloading the + operator to make it easier for us to calculate in certain scenario.

Parameters
rhsThe right hand side of the calculation
Returns
returns a Vec2 object

◆ operator+=()

Vec2 & Vec2::operator+= ( Vec2 const &  rhs)

This method is overloading the += operator to make it easier for us to calculate in certain scenario.

Parameters
rhsThe right hand side of the calculation
Returns
returns a reference to a Vec2 object

Member Data Documentation

◆ x

float Vec2::x

The X coordinate.

◆ y

float Vec2::y

The Y coordinate.


The documentation for this class was generated from the following files: