Classes | |
struct | Vector4 |
A 4d vector or point. More... | |
struct | Vector3 |
A 3d vector or point. More... | |
struct | Vector2 |
A 2d vector or point. More... | |
struct | Matrix4 |
A 4x4 matrix. More... | |
struct | Matrix3 |
A 3x3 matrix. More... | |
struct | Matrix2 |
A 2x2 matrix. More... | |
struct | VectorN |
Base type of all vectors. More... | |
struct | MatrixN |
Base type of all square matrices. More... | |
Functions | |
float | MatDeterminant (const Matrix4 &mat) |
finds the determinant of a matrix | |
float | MatDeterminant (const Matrix3 &mat) |
finds the determinant of a matrix | |
Matrix4 | MatProjectionFoV (float fov=PI/2, float aspectYdivX=1.0f, float nearZ=1.0f, float farZ=1000.0f) |
constructs a left-handed perspective projection transform | |
Matrix4 | MatViewLookAt (const Vector3 &pos, const Vector3 &tar, const Vector3 &vagueUp=Vector3(0, 0, 1), bool flipVert=false, bool flipHorz=false) |
constructs a look-at-based left-handed view transformation | |
bool | NearEqual (float c0, float c1, float tolerance=FLOAT_TOLERANCE) |
compare elements for "near equal" | |
template<typename VecType> | |
bool | NearEqual (const VecType &v1, const VecType &v2, float tolerance=FLOAT_TOLERANCE) |
compare elements for "near equal" | |
template<typename VecType> | |
bool | NearEqual (const VecType &v, float c, float tolerance=FLOAT_TOLERANCE) |
compare elements for "near equal" | |
bool | IsFinite (float c) |
return true if a float is valid | |
template<typename VecType> | |
bool | IsFinite (VecType &v) |
returns true if all elements are valid floats | |
template<typename VecType> | |
float | VecDot (const VecType &v1, const VecType &v2) |
dot product | |
struct Vector3 | VecCross (const struct Vector3 &v1, const struct Vector3 &v2) |
cross product | |
template<typename VecType> | |
VecType | VecNormal (const VecType &v) |
get the normalized version of a vector | |
template<typename VecType> | |
void | VecNormalize (VecType &v) |
normalize a vector | |
template<typename VecType> | |
float | VecAngleBetween (const VecType &l1, const VecType &l2) |
angle between vectors | |
template<typename VecType> | |
VecType | VecReflect (const VecType &vec, const VecType &norm) |
reflect a vector off of a normal | |
template<typename MatType> | |
MatType | MatMul (const MatType &m1, const MatType &m2) |
multiply two matrices | |
float | MatDeterminant (const Matrix2 &mat) |
finds the determinant of a matrix | |
template<typename MatType> | |
MatType | MatTranspose (const MatType &mat) |
finds the transpose of a matrix | |
template<typename MatType> | |
MatType | MatInverse (const MatType &mat) |
finds the inverse of a matrix (undefined behaviour if inverse does not exist) | |
Matrix3 | MatRotateX (float angle) |
creates a matrix that rotates around the x axis | |
Matrix3 | MatRotateY (float angle) |
creates a matrix that rotates around the y axis | |
Matrix3 | MatRotateZ (float angle) |
creates a matrix that rotates around the z axis | |
Matrix3 | MatRotateAxis (const Vector3 &axis, float angle) |
creates a matrix that rotates around an axis | |
template<typename VecType> | |
VecType::GreaterMatrixType | MatTranslate (const VecType &offset) |
builds a translation matrix | |
template<typename VecType> | |
VecType | TransformVector (const typename VecType::MatrixType &m, const VecType &v) |
multiply a matrix by a vector | |
template<typename T> | |
T | Lerp (const T &e0, const T &e1, float w) |
interpolates between two entities, with w as the interpolator between 0 and 1 | |
template<typename T> | |
T | Bilerp (const T &e00, const T &e10, const T &e01, const T &e11, float x, float y) |
bilinearly interpolates between four entities (with x and y from 0 to 1) | |
Variables | |
const float | PI2 = 6.2831853071f |
2 PI | |
const float | PI = 3.14159265f |
PI. | |
const float | FLOAT_TOLERANCE = 0.00001f |
Acceptable range of closeness to count floats as equal. |