MPMA Framework 0.4
Namespaces | Classes | Functions | Variables
GEO Namespace Reference

Geometry library. More...

Namespaces

namespace  INTERSECT
 

Intersection detection.


namespace  RESOLVE
 

Collision resolution.


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  Vector1
 A 1d value. 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 (row-based) More...
struct  Line
 A line or ray. More...
struct  Plane
 A plane. More...
struct  Sphere
 A sphere. More...
struct  AARectoid
 Axis-aligned 3d rectangle. More...
struct  XAlignedUnboundedCylinder
 A an unbounded cylendar aligned along the x axis. More...
struct  YAlignedEllipsoid
 An ellipsoid whose stretch is aligned along the y axis. More...
struct  Line2D
 A line or ray. More...
struct  Circle
 a circle More...
struct  AxisAlignedEllipse
 an ellipse aligned to the x and y axis 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 perspective projection transform
Matrix4 MatProjectionOrtho (float left, float right, float bottom, float top, float nearZ=1.0f, float farZ=1000.0f)
 constructs a parallel 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 >
VecType Clamp (const VecType &val, const VecType &min, const VecType &max)
 component-wise clamps val between min and max and returns the result
float Clamp (const float &val, const float &min, const float &max)
 clamps val between min and max and returns the result
template<typename VecType1 , typename VecType2 >
float VecDot (const VecType1 &v1, const VecType2 &v2)
 dot 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 VecType1 , typename VecType2 >
float VecAngleBetween (const VecType1 &l1, const VecType2 &l2)
 angle between vectors
template<typename VecType1 , typename VecType2 >
float VecDistance (const VecType1 &l1, const VecType2 &l2)
 distance between two points
template<typename VecType1 , typename VecType2 >
VecType1 VecReflect (const VecType1 &vec, const VecType2 &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::GreaterMatrixType MatScale (const VecType &scale)
 builds a scaling matrix
Matrix4 MatProjectionOrtho (float nearZ=1.0f, float farZ=1000.0f)
 constructs a parallel projection transform (from -1 to 1 on the x and y axis)
template<typename VecType >
VecType TransformVector (const typename VecType::MatrixType &m, const VecType &v)
 multiply a matrix by a vector
struct Vector3 VecCross (const struct Vector3 &v1, const struct Vector3 &v2)
 cross product
template<typename T >
Lerp (const T &e0, const T &e1, float w)
 interpolates between two value, with w as the interpolator between 0 and 1
template<typename T >
Bilerp (const T &e00, const T &e10, const T &e01, const T &e11, float x, float y)
 bilinearly interpolates between four value (with x and y from 0 to 1)
template<typename T >
AdjustTowardsTarget (const T &current, const T &target, const T &change)
 adjust current in the direction of target by at most change

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.

Detailed Description

Geometry library.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends