Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Quaternion Class Reference

This class represents a quaternion used for 3D rotations. More...

#include <Math3D.h>

Public Member Functions

 Quaternion (float w=1, float x=0, float y=0, float z=0)
 Creates a new quaternion.
 
const float & w () const
 Retrieves the w component of the quarternion.
 
const float & x () const
 Retrieves the x component of the quarternion.
 
const float & y () const
 Retrieves the y component of the quarternion.
 
const float & z () const
 Retrieves the z component of the quarternion.
 
void get (float *destination) const
 Retrieves the components of the vector.
 
float * get ()
 Retrieves the components of the vector.
 
const float * get () const
 Retrieves the components of the vector.
 
Vector3 getLookAt () const
 When the quaternion represents an orientation, this returns the negative z axis vector.
 
Vector3 getUp () const
 When the quaternion represents an orientation, this returns the y axis vector.
 

Detailed Description

This class represents a quaternion used for 3D rotations.

Constructor & Destructor Documentation

◆ Quaternion()

Quaternion::Quaternion ( float w = 1,
float x = 0,
float y = 0,
float z = 0 )
inline

Creates a new quaternion.

Parameters
wThe w component.
xThe x component.
yThe y component.
zThe z component.

Member Function Documentation

◆ get() [1/3]

float * Quaternion::get ( )
inline

Retrieves the components of the vector.

Returns
The components as float[4].

◆ get() [2/3]

const float * Quaternion::get ( ) const
inline

Retrieves the components of the vector.

Returns
The components as float[4].

◆ get() [3/3]

void Quaternion::get ( float * destination) const
inline

Retrieves the components of the vector.

Parameters
destinationWhere the 4 float values should be saved to.

◆ getLookAt()

Vector3 Quaternion::getLookAt ( ) const
inline

When the quaternion represents an orientation, this returns the negative z axis vector.

Returns
The negative z axis vector.

◆ getUp()

Vector3 Quaternion::getUp ( ) const
inline

When the quaternion represents an orientation, this returns the y axis vector.

Returns
The y axis vector.

◆ w()

const float & Quaternion::w ( ) const
inline

Retrieves the w component of the quarternion.

Returns
The w component.

◆ x()

const float & Quaternion::x ( ) const
inline

Retrieves the x component of the quarternion.

Returns
The x component.

◆ y()

const float & Quaternion::y ( ) const
inline

Retrieves the y component of the quarternion.

Returns
The y component.

◆ z()

const float & Quaternion::z ( ) const
inline

Retrieves the z component of the quarternion.

Returns
The z component.

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