Functions

CC3MatrixMath.h File Reference

#import "CC3Foundation.h"

Functions

static void CC3Mat4Multiply (GLfloat *mOut, const GLfloat *mL, const GLfloat *mR)
static void kmMat4RotationQuaternion (GLfloat *m, const CC3Vector4 q)
static void kmMat4RotationX (GLfloat *m, const GLfloat degrees)
static void kmMat4RotationY (GLfloat *m, const GLfloat degrees)
static void kmMat4RotationYXZ (GLfloat *m, CC3Vector aRotation)
static void kmMat4RotationZ (GLfloat *m, const GLfloat degrees)
static void kmMat4RotationZYX (GLfloat *m, CC3Vector aRotation)
static void kmMat4Transformation (GLfloat *m, const CC3Vector aTranslation, const CC3Vector aRotation, const CC3Vector aScale)

Detailed Description


Function Documentation

static void CC3Mat4Multiply ( GLfloat *  mOut,
const GLfloat *  mL,
const GLfloat *  mR 
) [inline, static]

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
static void kmMat4RotationQuaternion ( GLfloat *  m,
const CC3Vector4  q 
) [inline, static]

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

static void kmMat4RotationX ( GLfloat *  m,
const GLfloat  degrees 
) [inline, static]

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

static void kmMat4RotationY ( GLfloat *  m,
const GLfloat  degrees 
) [inline, static]

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

static void kmMat4RotationYXZ ( GLfloat *  m,
CC3Vector  aRotation 
) [inline, static]

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 kmMat4RotationZ ( GLfloat *  m,
const GLfloat  degrees 
) [inline, static]

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

static void kmMat4RotationZYX ( GLfloat *  m,
CC3Vector  aRotation 
) [inline, static]

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 kmMat4Transformation ( GLfloat *  m,
const CC3Vector  aTranslation,
const CC3Vector  aRotation,
const CC3Vector  aScale 
) [inline, static]

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