Jamie Slowgrove - AI Assignment 1
Line of Sight & A* path-finding
 All Classes Namespaces Files Functions Variables
Public Member Functions | Public Attributes | List of all members
Vec2 Struct Reference

Creates a Vec2 structure with functions Creates a Vec2 structure with overloaded operators to create a new variable type for use as a 2D vector. More...

#include <vec2.h>

Collaboration diagram for Vec2:
Collaboration graph

Public Member Functions

 Vec2 ()
 
 Vec2 (float inputX, float inputY)
 
Vec2operator+= (Vec2 a)
 
Vec2operator-= (Vec2 a)
 
Vec2operator*= (float a)
 
Vec2operator/= (float a)
 

Public Attributes

float x
 
float y
 

Detailed Description

Creates a Vec2 structure with functions Creates a Vec2 structure with overloaded operators to create a new variable type for use as a 2D vector.

Constructor & Destructor Documentation

Vec2::Vec2 ( )
inline

Constructs an Vec2 Constructs the Vec2 setting the values to 0,0

Vec2::Vec2 ( float  inputX,
float  inputY 
)
inline

Constructs a Vec2 Constructs the Vec2 setting the values to the input coordinates

Parameters
floatThe inputed x position
floatThe inputed y position

Member Function Documentation

Vec2* Vec2::operator*= ( float  a)
inline

Overloads the *= operator Overloads the *= operator allowing a Vec2 variable to use *=

Parameters
floatthe scalar to multiply by
Vec2* Vec2::operator+= ( Vec2  a)
inline

Overloads the += operator Overloads the += operator allowing a Vec2 variable to use +=

Parameters
Vec2The input Vec2
Vec2* Vec2::operator-= ( Vec2  a)
inline

Overloads the -= operator Overloads the -= operator allowing a Vec2 variable to use -=

Parameters
Vec2The input Vec2
Vec2* Vec2::operator/= ( float  a)
inline

Overloads the /= operator Overloads the /= operator allowing a Vec2 variable to use /=

Parameters
floatthe scalar to divide by

Member Data Documentation

float Vec2::x

Position variables

float Vec2::y

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