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

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

#include <Quaternion.h>

Collaboration diagram for Quaternion:
Collaboration graph

Public Member Functions

 Quaternion ()
 Constructs the Quaternion setting the values to 1,0,0,0. More...
 
 Quaternion (float w, float x, float y, float z)
 Constructs the Quaternion setting the values to the input coordinates. More...
 
 Quaternion (int w, int x, int y, int z)
 Constructs the Quaternion setting the values to the input coordinates. More...
 
float getLength ()
 Returns the length of the Quaternion. More...
 
float getDotProduct (Quaternion Qa, Quaternion Qb)
 Returns the dot product of two Quaternions. More...
 
Quaternion getNormalised ()
 Returns the normalised version of the Quaternion. More...
 
void rotate (Quaternion &quat, Vec3 axis, float angle)
 Rotates a Quaternion. More...
 
Mat4 getMatrix ()
 Gets a Mat4 from the Quaternion. More...
 

Public Attributes

float w
 the variables for the Quaternions More...
 
float x
 
float y
 
float z
 

Detailed Description

Contains the Quaternion structure with functions and overloaded operators.

Constructor & Destructor Documentation

◆ Quaternion() [1/3]

Quaternion::Quaternion ( )
inline

Constructs the Quaternion setting the values to 1,0,0,0.

Here is the caller graph for this function:

◆ Quaternion() [2/3]

Quaternion::Quaternion ( float  w,
float  x,
float  y,
float  z 
)
inline

Constructs the Quaternion setting the values to the input coordinates.

Parameters
wThe inputed w position.
xThe inputed x position.
yThe inputed y position.
zThe inputed z position.

◆ Quaternion() [3/3]

Quaternion::Quaternion ( int  w,
int  x,
int  y,
int  z 
)
inline

Constructs the Quaternion setting the values to the input coordinates.

Parameters
wThe inputed w position.
xThe inputed x position.
yThe inputed y position.
zThe inputed z position.

Member Function Documentation

◆ getDotProduct()

float Quaternion::getDotProduct ( Quaternion  Qa,
Quaternion  Qb 
)
inline

Returns the dot product of two Quaternions.

Parameters
QaOne of the Quaternions.
QbOne of the Quaternions.
Returns
The dot product of two Quaternions.

◆ getLength()

float Quaternion::getLength ( )
inline

Returns the length of the Quaternion.

Returns
The length of the Quaternion.
Here is the caller graph for this function:

◆ getMatrix()

Mat4 Quaternion::getMatrix ( )

Gets a Mat4 from the Quaternion.

Returns
The a Mat4 from the Quaternion.
Here is the caller graph for this function:

◆ getNormalised()

Quaternion Quaternion::getNormalised ( )
inline

Returns the normalised version of the Quaternion.

Returns
The normalised version of the Quaternion.
Here is the call graph for this function:

◆ rotate()

void Quaternion::rotate ( Quaternion quat,
Vec3  axis,
float  angle 
)

Rotates a Quaternion.

Parameters
quatThe Quaternion to rotate.
axisThe axis to rotate.
angleThe angle of the rotation
Returns
The length of the Quaternion.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ w

float Quaternion::w

the variables for the Quaternions

◆ x

float Quaternion::x

◆ y

float Quaternion::y

◆ z

float Quaternion::z

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