GCP Assignment 1
Namespaces | Classes | Functions
Maths Namespace Reference

The namespace for all maths code. More...

Namespaces

 Convert
 Contains maths conversion functions for use within the code.
 

Classes

struct  Mat4
 Contains the Mat4 structure with functions and overloaded operators. This is row major. More...
 
struct  Quaternion
 Contains the Quaternion structure with functions and overloaded operators. More...
 
struct  Vec2
 Contains the Vec2 structure with functions and overloaded operators. More...
 
struct  Vec3
 Contains the Vec3 structure with functions and overloaded operators. More...
 
struct  Vec4
 Contains the Vec4 structure with functions and overloaded operators. More...
 

Functions

Mat4 operator+ (Mat4 mIn, float s)
 Overloads the + operator allowing a Mat4 to be added to a scalar. More...
 
Mat4 operator+ (Mat4 mInA, Mat4 mInB)
 Overloads the + operator allowing a Mat4 to be added to a scalar. More...
 
Mat4 operator- (Mat4 mInA, float s)
 Overloads the - operator allowing a Mat4 to be added to a scalar. More...
 
Mat4 operator- (Mat4 mInA, Mat4 mInB)
 Overloads the - operator allowing a Mat4 to be subtracted from a scalar. More...
 
Mat4 operator* (Mat4 mInA, float s)
 Overloads the * operator allowing a Mat4 to be multiplied to a scalar. More...
 
Mat4 operator* (Mat4 mInA, Mat4 mInB)
 Overloads the * operator allowing a Mat4 to be multiplied with another Mat4. REMEMBER: Mat1 * Mat2 != Mat2 * Mat1. More...
 
Quaternion operator* (Quaternion q1, Quaternion q2)
 Overloads the * operator allowing a Quaternion to be multiplied by another Quaternion. IMPORTANT: (Quaternion1 * Quaternion2) != (Quaternion2 * Quaternion1) More...
 
Vec2 operator- (Vec2 vecIn)
 Overloads the - operator allowing a Vec2 to be inverted. More...
 
Vec2 operator- (Vec2 vecInA, Vec2 vecInB)
 Overloads the - operator allowing Vec2's to be subtracted from each other. More...
 
Vec2 operator+ (Vec2 vecInA, Vec2 vecInB)
 Overloads the + operator. More...
 
Vec2 operator/ (Vec2 vecInA, float scalar)
 Overloads the / operator allowing a Vec2 to be divided by a scalar. More...
 
Vec2 operator* (Vec2 vecInA, float scalar)
 Overloads the * operator allowing a Vec2 to be multiplied by a scalar. More...
 
Vec2 operator* (Vec2 vecInA, Vec2 vecInB)
 Overloads the * operator allowing a Vec2 to be multiplied by another Vec2. More...
 
Vec3 operator- (Vec3 vecIn)
 Overloads the - operator allowing a Vec3 to be inverted. More...
 
Vec3 operator- (Vec3 vecInA, Vec3 vecInB)
 Overloads the - operator allowing Vec3's to be subtracted from each other. More...
 
Vec3 operator+ (Vec3 vecInA, Vec3 vecInB)
 Overloads the + operator. More...
 
Vec3 operator/ (Vec3 vecInA, float scalar)
 Overloads the / operator allowing a Vec3 to be divided by a scalar. More...
 
Vec3 operator* (Vec3 vecInA, float scalar)
 Overloads the * operator allowing a Vec3 to be multiplied by a scalar. More...
 
Vec3 operator* (Vec3 vecInA, Vec3 vecInB)
 Overloads the * operator allowing a Vec2 to be multiplied by another Vec3. More...
 
Vec4 operator- (Vec4 vecIn)
 Overloads the - operator allowing a Vec4 to be inverted. More...
 
Vec4 operator- (Vec4 vecInA, Vec4 vecInB)
 Overloads the - operator allowing Vec4's to be subtracted from each other. More...
 
Vec4 operator+ (Vec4 vecInA, Vec4 vecInB)
 Overloads the + operator. More...
 
Vec4 operator/ (Vec4 vecInA, float scalar)
 Overloads the / operator allowing a Vec4 to be divided by a scalar. More...
 
Vec4 operator* (Vec4 vecInA, float scalar)
 Overloads the * operator allowing a Vec4 to be multiplied by a scalar. More...
 
Vec4 operator* (Vec4 vecInA, Vec4 vecInB)
 Overloads the * operator allowing a Vec4 to be multiplied by another Vec4. More...
 

Detailed Description

The namespace for all maths code.

Function Documentation

◆ operator*() [1/9]

Quaternion Maths::operator* ( Quaternion  q1,
Quaternion  q2 
)
inline

Overloads the * operator allowing a Quaternion to be multiplied by another Quaternion. IMPORTANT: (Quaternion1 * Quaternion2) != (Quaternion2 * Quaternion1)

Parameters
q1One of the input Quaternion's.
q2One of the input Quaternion's.
Returns
The new Quaternion.

◆ operator*() [2/9]

Vec2 Maths::operator* ( Vec2  vecInA,
float  scalar 
)
inline

Overloads the * operator allowing a Vec2 to be multiplied by a scalar.

Parameters
vecInAOne of the input Vec2's.
scalarThe scalar to multiply by.
Returns
The new vector.

◆ operator*() [3/9]

Vec2 Maths::operator* ( Vec2  vecInA,
Vec2  vecInB 
)
inline

Overloads the * operator allowing a Vec2 to be multiplied by another Vec2.

Parameters
vecInAOne of the input Vec2's.
vecInBOne of the input Vec2's.
Returns
The new vector.

◆ operator*() [4/9]

Vec4 Maths::operator* ( Vec4  vecInA,
float  scalar 
)
inline

Overloads the * operator allowing a Vec4 to be multiplied by a scalar.

Parameters
vecInAOne of the input Vec4's.
scalarThe scalar to multiply by.
Returns
The new vector.

◆ operator*() [5/9]

Vec3 Maths::operator* ( Vec3  vecInA,
float  scalar 
)
inline

Overloads the * operator allowing a Vec3 to be multiplied by a scalar.

Parameters
vecInAOne of the input Vec3's.
scalarThe scalar to multiply by.
Returns
The new vector.

◆ operator*() [6/9]

Vec4 Maths::operator* ( Vec4  vecInA,
Vec4  vecInB 
)
inline

Overloads the * operator allowing a Vec4 to be multiplied by another Vec4.

Parameters
vecInAOne of the input Vec4's.
vecInBOne of the input Vec4's.
Returns
The new vector.

◆ operator*() [7/9]

Vec3 Maths::operator* ( Vec3  vecInA,
Vec3  vecInB 
)
inline

Overloads the * operator allowing a Vec2 to be multiplied by another Vec3.

Parameters
vecInAOne of the input Vec3's.
vecInBOne of the input Vec3's.
Returns
The new vector.

◆ operator*() [8/9]

Mat4 Maths::operator* ( Mat4  mInA,
float  s 
)
inline

Overloads the * operator allowing a Mat4 to be multiplied to a scalar.

Parameters
mInAThe input Mat4.
sThe scalar to add.
Returns
The new Mat4.

◆ operator*() [9/9]

Mat4 Maths::operator* ( Mat4  mInA,
Mat4  mInB 
)
inline

Overloads the * operator allowing a Mat4 to be multiplied with another Mat4. REMEMBER: Mat1 * Mat2 != Mat2 * Mat1.

Parameters
matInAAn input Mat4.
matInBAn input Mat4.
Returns
The new Mat4.

◆ operator+() [1/5]

Vec2 Maths::operator+ ( Vec2  vecInA,
Vec2  vecInB 
)
inline

Overloads the + operator.

Parameters
vecInAOne of the input Vec2's.
vecInBOne of the input Vec2's.
Returns
The new vector.

◆ operator+() [2/5]

Vec4 Maths::operator+ ( Vec4  vecInA,
Vec4  vecInB 
)
inline

Overloads the + operator.

Parameters
vecInAOne of the input Vec4's.
vecInBOne of the input Vec4's.
Returns
The new vector.

◆ operator+() [3/5]

Vec3 Maths::operator+ ( Vec3  vecInA,
Vec3  vecInB 
)
inline

Overloads the + operator.

Parameters
vecInAOne of the input Vec3's.
vecInBOne of the input Vec3's.
Returns
The new vector.

◆ operator+() [4/5]

Mat4 Maths::operator+ ( Mat4  mIn,
float  s 
)
inline

Overloads the + operator allowing a Mat4 to be added to a scalar.

Parameters
mInThe input Mat4.
sThe scalar to add.
Returns
The new Mat4.

◆ operator+() [5/5]

Mat4 Maths::operator+ ( Mat4  mInA,
Mat4  mInB 
)
inline

Overloads the + operator allowing a Mat4 to be added to a scalar.

Parameters
mInAAn input Mat4.
mInBAn input Mat4.
Returns
The new Mat4.

◆ operator-() [1/8]

Vec2 Maths::operator- ( Vec2  vecIn)
inline

Overloads the - operator allowing a Vec2 to be inverted.

Parameters
vecInThe input Vec2.
Returns
The new vector.

◆ operator-() [2/8]

Vec4 Maths::operator- ( Vec4  vecIn)
inline

Overloads the - operator allowing a Vec4 to be inverted.

Parameters
vecInThe input Vec4.
Returns
The new vector.

◆ operator-() [3/8]

Vec2 Maths::operator- ( Vec2  vecInA,
Vec2  vecInB 
)
inline

Overloads the - operator allowing Vec2's to be subtracted from each other.

Parameters
vecInAOne of the input Vec2's.
vecInBOne of the input Vec2's.
Returns
The new vector.

◆ operator-() [4/8]

Vec3 Maths::operator- ( Vec3  vecIn)
inline

Overloads the - operator allowing a Vec3 to be inverted.

Parameters
vecInThe input Vec3.
Returns
The new vector.

◆ operator-() [5/8]

Vec4 Maths::operator- ( Vec4  vecInA,
Vec4  vecInB 
)
inline

Overloads the - operator allowing Vec4's to be subtracted from each other.

Parameters
vecInAOne of the input Vec4's.
vecInBOne of the input Vec4's.
Returns
The new vector.

◆ operator-() [6/8]

Vec3 Maths::operator- ( Vec3  vecInA,
Vec3  vecInB 
)
inline

Overloads the - operator allowing Vec3's to be subtracted from each other.

Parameters
vecInAOne of the input Vec3's.
vecInBOne of the input Vec3's.
Returns
The new vector.

◆ operator-() [7/8]

Mat4 Maths::operator- ( Mat4  mInA,
float  s 
)
inline

Overloads the - operator allowing a Mat4 to be added to a scalar.

Parameters
mInAThe input Mat4.
sThe scalar to add.
Returns
The new Mat4.

◆ operator-() [8/8]

Mat4 Maths::operator- ( Mat4  mInA,
Mat4  mInB 
)
inline

Overloads the - operator allowing a Mat4 to be subtracted from a scalar.

Parameters
mInAAn input Mat4.
mInBAn input Mat4.
Returns
The new Mat4.

◆ operator/() [1/3]

Vec2 Maths::operator/ ( Vec2  vecInA,
float  scalar 
)
inline

Overloads the / operator allowing a Vec2 to be divided by a scalar.

Parameters
vecInAOne of the input Vec2's.
scalarThe scalar to divide by.
Returns
The new vector.

◆ operator/() [2/3]

Vec4 Maths::operator/ ( Vec4  vecInA,
float  scalar 
)
inline

Overloads the / operator allowing a Vec4 to be divided by a scalar.

Parameters
vecInAOne of the input Vec4's.
scalarThe scalar to divide by.
Returns
The new vector.

◆ operator/() [3/3]

Vec3 Maths::operator/ ( Vec3  vecInA,
float  scalar 
)
inline

Overloads the / operator allowing a Vec3 to be divided by a scalar.

Parameters
vecInAOne of the input Vec3's.
scalarThe scalar to divide by.
Returns
The new vector.