#include <memory.h>
#include <assert.h>
#include "utility.h"
#include "vec4.h"
#include "mat4.h"
Go to the source code of this file.
Functions | |
kmVec4 * | kmVec4Fill (kmVec4 *pOut, kmScalar x, kmScalar y, kmScalar z, kmScalar w) |
kmVec4 * | kmVec4Add (kmVec4 *pOut, const kmVec4 *pV1, const kmVec4 *pV2) |
kmScalar | kmVec4Dot (const kmVec4 *pV1, const kmVec4 *pV2) |
Returns the dot product of 2 4D vectors. | |
kmScalar | kmVec4Length (const kmVec4 *pIn) |
kmScalar | kmVec4LengthSq (const kmVec4 *pIn) |
Returns the length of the 4D vector squared. | |
kmVec4 * | kmVec4Lerp (kmVec4 *pOut, const kmVec4 *pV1, const kmVec4 *pV2, kmScalar t) |
Returns the interpolation of 2 4D vectors based on t. Currently not implemented! | |
kmVec4 * | kmVec4Normalize (kmVec4 *pOut, const kmVec4 *pIn) |
Normalizes a 4D vector. The result is stored in pOut. pOut is returned. | |
kmVec4 * | kmVec4Scale (kmVec4 *pOut, const kmVec4 *pIn, const kmScalar s) |
Scales a vector to the required length. This performs a Normalize before multiplying by S. | |
kmVec4 * | kmVec4Subtract (kmVec4 *pOut, const kmVec4 *pV1, const kmVec4 *pV2) |
Subtracts one 4D pV2 from pV1. The result is stored in pOut. pOut is returned. | |
kmVec4 * | kmVec4Transform (kmVec4 *pOut, const kmVec4 *pV, const kmMat4 *pM) |
Transforms a 4D vector by a matrix, the result is stored in pOut, and pOut is returned. | |
kmVec4 * | kmVec4TransformArray (kmVec4 *pOut, unsigned int outStride, const kmVec4 *pV, unsigned int vStride, const kmMat4 *pM, unsigned int count) |
Loops through an input array transforming each vec4 by the matrix. | |
int | kmVec4AreEqual (const kmVec4 *p1, const kmVec4 *p2) |
kmVec4 * | kmVec4Assign (kmVec4 *pOut, const kmVec4 *pIn) |
kmScalar kmVec4Length | ( | const kmVec4 * | pIn | ) |
kmScalar kmVec4LengthSq | ( | const kmVec4 * | pIn | ) |
Normalizes a 4D vector. The result is stored in pOut. pOut is returned.
Definition at line 99 of file vec4.c.
References kmScalar, kmVec4Length(), kmVec4::w, kmVec4::x, kmVec4::y, and kmVec4::z.
Referenced by kmVec4Scale().
Transforms a 4D vector by a matrix, the result is stored in pOut, and pOut is returned.
Definition at line 132 of file vec4.c.
References kmMat4::mat, kmVec4::w, kmVec4::x, kmVec4::y, and kmVec4::z.
Referenced by kmVec4TransformArray().
kmVec4* kmVec4TransformArray | ( | kmVec4 * | pOut, | |
unsigned int | outStride, | |||
const kmVec4 * | pV, | |||
unsigned int | vStride, | |||
const kmMat4 * | pM, | |||
unsigned int | count | |||
) |
Loops through an input array transforming each vec4 by the matrix.
Definition at line 141 of file vec4.c.
References kmVec4Transform().