Level H Engine
Public Member Functions | Public Attributes | List of all members
Vec2 Struct Reference

Contains the Vec2 structure with functions and overloaded operators. More...

#include <Vec2.h>

Collaboration diagram for Vec2:
Collaboration graph

Public Member Functions

 Vec2 ()
 Constructs the Vec2 setting the values to 0,0. More...
 
 Vec2 (float x, float y)
 Constructs the Vec2 setting the values to the input coordinates. More...
 
 Vec2 (int x, int y)
 Constructs the Vec2 setting the values to the input coordinates. More...
 
Vec2operator+= (Vec2 vecIn)
 Overloads the += operator. More...
 
Vec2operator-= (Vec2 vecIn)
 Overloads the -= operator. More...
 
float getLength ()
 Returns the length of the Vec2. More...
 

Public Attributes

float x
 Position variables. More...
 
float y
 

Detailed Description

Contains the Vec2 structure with functions and overloaded operators.

Constructor & Destructor Documentation

◆ Vec2() [1/3]

Vec2::Vec2 ( )
inline

Constructs the Vec2 setting the values to 0,0.

◆ Vec2() [2/3]

Vec2::Vec2 ( float  x,
float  y 
)
inline

Constructs the Vec2 setting the values to the input coordinates.

Parameters
xThe inputed x position.
yThe inputed y position.

◆ Vec2() [3/3]

Vec2::Vec2 ( int  x,
int  y 
)
inline

Constructs the Vec2 setting the values to the input coordinates.

Parameters
xThe inputed x position.
yThe inputed y position.

Member Function Documentation

◆ getLength()

float Vec2::getLength ( )
inline

Returns the length of the Vec2.

Returns
The length of the Vec2.

◆ operator+=()

Vec2* Vec2::operator+= ( Vec2  vecIn)
inline

Overloads the += operator.

Parameters
vecInThe input Vec2.
Returns
The new vector.

◆ operator-=()

Vec2* Vec2::operator-= ( Vec2  vecIn)
inline

Overloads the -= operator.

Parameters
vecInThe input Vec2.
Returns
The new vector.

Member Data Documentation

◆ x

float Vec2::x

Position variables.

◆ y

float Vec2::y

The documentation for this struct was generated from the following file: