v2.0.2
Functions
CC3MatrixMath.h File Reference
#import "CC3Foundation.h"

Functions

static void CC3KMMat4RotationQuaternion (GLfloat *m, const CC3Vector4 q)
 
static void CC3KMMat4RotationX (GLfloat *m, const GLfloat degrees)
 
static void CC3KMMat4RotationY (GLfloat *m, const GLfloat degrees)
 
static void CC3KMMat4RotationYXZ (GLfloat *m, CC3Vector aRotation)
 
static void CC3KMMat4RotationZ (GLfloat *m, const GLfloat degrees)
 
static void CC3KMMat4RotationZYX (GLfloat *m, CC3Vector aRotation)
 
static void CC3KMMat4Transformation (GLfloat *m, const CC3Vector aTranslation, const CC3Vector aRotation, const CC3Vector aScale)
 
static void CC3Mat4Multiply (GLfloat *mOut, const GLfloat *mL, const GLfloat *mR)
 

Function Documentation

static void CC3KMMat4RotationQuaternion ( GLfloat *  m,
const CC3Vector4  q 
)
inlinestatic

Builds a rotation matrix from a quaternion to a rotation matrix, stores the result in pOut and returns the result.

static void CC3KMMat4RotationX ( GLfloat *  m,
const GLfloat  degrees 
)
inlinestatic

Builds a rotation matrix around the X-axis, stores the result in pOut and returns the result.

static void CC3KMMat4RotationY ( GLfloat *  m,
const GLfloat  degrees 
)
inlinestatic

Builds a rotation matrix around the Y-axis, stores the result in pOut and returns the result.

static void CC3KMMat4RotationYXZ ( GLfloat *  m,
CC3Vector  aRotation 
)
inlinestatic

Builds a rotation matrix that rotates around all three axes, y (yaw), x (pitch) and z (roll), in that order, stores the result in 4x4 GL matrix m and returns the result.

This algorithm matches up along the positive Y axis, which is the OpenGL ES default.

static void CC3KMMat4RotationZ ( GLfloat *  m,
const GLfloat  degrees 
)
inlinestatic

Builds a rotation matrix around the Z-axis, stores the result in pOut and returns the result.

static void CC3KMMat4RotationZYX ( GLfloat *  m,
CC3Vector  aRotation 
)
inlinestatic

Builds a rotation matrix that rotates around all three axes z (roll), y (yaw), and x (pitch), in that order, stores the result in pOut and returns the result This algorithm matches up along the positive Z axis, which is used by some commercial 3D editors.

static void CC3KMMat4Transformation ( GLfloat *  m,
const CC3Vector  aTranslation,
const CC3Vector  aRotation,
const CC3Vector  aScale 
)
inlinestatic

Builds a transformation matrix that translates, rotates and scales according to the specified vectors, stores the result in pOut and returns the result.

static void CC3Mat4Multiply ( GLfloat *  mOut,
const GLfloat *  mL,
const GLfloat *  mR 
)
inlinestatic

Multiplies mL on the left by mR on the right, and stores the result in mOut.

  • mOut is 4x4 matrix
  • mL is 4x4 matrix
  • mR is 4x4 matrix