OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Quaternions.h File Reference

Go to the source code of this file.

Classes

struct  Quaternion
 

Typedefs

typedef struct Quaternion Quaternion
 

Functions

Quaternion construct_quaternion (float x, float y, float z, float degs)
 
void construct_modelview_matrix (Quaternion quaternion, float *mat)
 
Quaternion multiply_quaternions (Quaternion a, Quaternion b)
 

Typedef Documentation

typedef struct Quaternion Quaternion

Structure describing a single quaternion instance.

Function Documentation

void construct_modelview_matrix ( Quaternion  quaternion,
float mat 
)

Constructs a modelview matrix based on a given quaternion.

Parameters
quaternionQuaternion describing rotation angle and vector to be used for matrix creation.
matArray to store a modelview matrix. Cannot be NULL.

Definition at line 43 of file Quaternions.cpp.

Quaternion construct_quaternion ( float  x,
float  y,
float  z,
float  degs 
)

Function that returns a new quaternion. It inserts the angle in the real part and the vector in the vector part, yielding a quaternion that represents a rotation around the axis.

Parameters
xX coordinate of a vector defining a rotation axis.
yY coordinate of a vector defining a rotation axis.
zZ coordinate of a vector defining a rotation axis.
degsRotation in degrees.
Returns
Result quaternion.

Definition at line 27 of file Quaternions.cpp.

Quaternion multiply_quaternions ( Quaternion  a,
Quaternion  b 
)

Multiplies quaternion a by b and returns the product. NOTE: quaternion multiplication is not commutative.

Parameters
aQuaternion a.
bQuaternion b.
Returns
Product a*b.

Definition at line 71 of file Quaternions.cpp.