#include "utility.h"
Go to the source code of this file.
Data Structures | |
struct | kmMat4 |
Functions | |
kmMat4 * | kmMat4Fill (kmMat4 *pOut, const kmScalar *pMat) |
kmMat4 * | kmMat4Identity (kmMat4 *pOut) |
kmMat4 * | kmMat4Inverse (kmMat4 *pOut, const kmMat4 *pM) |
int | kmMat4IsIdentity (const kmMat4 *pIn) |
kmMat4 * | kmMat4Transpose (kmMat4 *pOut, const kmMat4 *pIn) |
kmMat4 * | kmMat4Multiply (kmMat4 *pOut, const kmMat4 *pM1, const kmMat4 *pM2) |
kmMat4 * | kmMat4Assign (kmMat4 *pOut, const kmMat4 *pIn) |
int | kmMat4AreEqual (const kmMat4 *pM1, const kmMat4 *pM2) |
kmMat4 * | kmMat4RotationAxis (kmMat4 *pOut, const struct kmVec3 *axis, kmScalar radians) |
kmMat4 * | kmMat4RotationX (kmMat4 *pOut, const kmScalar radians) |
kmMat4 * | kmMat4RotationY (kmMat4 *pOut, const kmScalar radians) |
kmMat4 * | kmMat4RotationZ (kmMat4 *pOut, const kmScalar radians) |
kmMat4 * | kmMat4RotationPitchYawRoll (kmMat4 *pOut, const kmScalar pitch, const kmScalar yaw, const kmScalar roll) |
kmMat4 * | kmMat4RotationQuaternion (kmMat4 *pOut, const struct kmQuaternion *pQ) |
kmMat4 * | kmMat4Scaling (kmMat4 *pOut, const kmScalar x, const kmScalar y, const kmScalar z) |
kmMat4 * | kmMat4Translation (kmMat4 *pOut, const kmScalar x, const kmScalar y, const kmScalar z) |
struct kmVec3 * | kmMat4GetUpVec3 (struct kmVec3 *pOut, const kmMat4 *pIn) |
struct kmVec3 * | kmMat4GetRightVec3 (struct kmVec3 *pOut, const kmMat4 *pIn) |
struct kmVec3 * | kmMat4GetForwardVec3 (struct kmVec3 *pOut, const kmMat4 *pIn) |
kmMat4 * | kmMat4PerspectiveProjection (kmMat4 *pOut, kmScalar fovY, kmScalar aspect, kmScalar zNear, kmScalar zFar) |
kmMat4 * | kmMat4OrthographicProjection (kmMat4 *pOut, kmScalar left, kmScalar right, kmScalar bottom, kmScalar top, kmScalar nearVal, kmScalar farVal) |
kmMat4 * | kmMat4LookAt (kmMat4 *pOut, const struct kmVec3 *pEye, const struct kmVec3 *pCenter, const struct kmVec3 *pUp) |
Assigns the value of pIn to pOut
Definition at line 213 of file mat4.c.
References kmMat4::mat.
Referenced by kmGLGetMatrix().
Fills a kmMat4 structure with the values from a 16 element array of floats pOut - A pointer to the destination matrix pMat - A 16 element array of floats Returns pOut so that the call can be nested
Definition at line 45 of file mat4.c.
References kmScalar, and kmMat4::mat.
Extract the forward vector from a 4x4 matrix. The result is stored in pOut. Returns pOut.
Definition at line 515 of file mat4.c.
References kmVec3Normalize(), kmMat4::mat, kmVec3::x, kmVec3::y, and kmVec3::z.
Extract the right vector from a 4x4 matrix. The result is stored in pOut. Returns pOut.
Definition at line 500 of file mat4.c.
References kmVec3Normalize(), kmMat4::mat, kmVec3::x, kmVec3::y, and kmVec3::z.
Get the up vector from a matrix. pIn is the matrix you wish to extract the vector from. pOut is a pointer to the kmVec3 structure that should hold the resulting vector
Definition at line 486 of file mat4.c.
References kmVec3Normalize(), kmMat4::mat, kmVec3::x, kmVec3::y, and kmVec3::z.
Sets pOut to an identity matrix returns pOut pOut - A pointer to the matrix to set to identity Returns pOut so that the call can be nested
Definition at line 56 of file mat4.c.
References kmMat4::mat.
Referenced by kmGLLoadIdentity(), kmMat4Inverse(), kmMat4LookAt(), kmMat4OrthographicProjection(), kmMat4PerspectiveProjection(), and lazyInitialize().
Calculates the inverse of pM and stores the result in pOut. Returns pOut
Definition at line 68 of file mat4.c.
References kmMat4Identity(), and kmMat4::mat.
int kmMat4IsIdentity | ( | const kmMat4 * | pIn | ) |
Returns KM_TRUE if pIn is an identity matrix KM_FALSE otherwise
Definition at line 148 of file mat4.c.
References kmMat4::mat.
kmMat4* kmMat4LookAt | ( | kmMat4 * | pOut, | |
const struct kmVec3 * | pEye, | |||
const struct kmVec3 * | pCenter, | |||
const struct kmVec3 * | pUp | |||
) |
Multiplies pM1 with pM2, stores the result in pOut, returns pOut
Definition at line 178 of file mat4.c.
References kmMat4::mat.
Referenced by kmGLMultMatrix(), kmGLRotatef(), kmGLScalef(), and kmMat4LookAt().
kmMat4* kmMat4OrthographicProjection | ( | kmMat4 * | pOut, | |
kmScalar | left, | |||
kmScalar | right, | |||
kmScalar | bottom, | |||
kmScalar | top, | |||
kmScalar | nearVal, | |||
kmScalar | farVal | |||
) |
Creates an orthographic projection matrix like glOrtho
Definition at line 558 of file mat4.c.
References kmMat4Identity(), kmScalar, and kmMat4::mat.
kmMat4* kmMat4PerspectiveProjection | ( | kmMat4 * | pOut, | |
kmScalar | fovY, | |||
kmScalar | aspect, | |||
kmScalar | zNear, | |||
kmScalar | zFar | |||
) |
Creates a perspective projection matrix in the same way as gluPerspective
Definition at line 530 of file mat4.c.
References kmDegreesToRadians(), kmMat4Identity(), kmScalar, and kmMat4::mat.
kmMat4* kmMat4RotationPitchYawRoll | ( | kmMat4 * | pOut, | |
const kmScalar | pitch, | |||
const kmScalar | yaw, | |||
const kmScalar | roll | |||
) |
Builds a rotation matrix from pitch, yaw and roll. The resulting matrix is stored in pOut and pOut is returned
Definition at line 386 of file mat4.c.
References kmScalar, and kmMat4::mat.
kmMat4* kmMat4RotationQuaternion | ( | kmMat4 * | pOut, | |
const struct kmQuaternion * | pQ | |||
) |
Builds a scaling matrix
Definition at line 447 of file mat4.c.
References kmMat4::mat.
Referenced by kmGLScalef().
Builds a translation matrix. All other elements in the matrix will be set to zero except for the diagonal which is set to 1.0
Definition at line 463 of file mat4.c.
References kmMat4::mat.
Referenced by kmMat4LookAt().
Sets pOut to the transpose of pIn, returns pOut
Definition at line 162 of file mat4.c.
References kmMat4::mat.