geo/Geo.h File Reference

Vector and matrix primitives and operations. More...

#include <cmath>
#include <string>
#include "base/Types.h"
#include "GeoBases.h"
#include "Geo.cpp"

Include dependency graph for Geo.h:

This graph shows which files directly or indirectly include this file:


Namespaces

namespace  GEO

Classes

struct  GEO::Vector4
 A 4d vector or point. More...
struct  GEO::Vector3
 A 3d vector or point. More...
struct  GEO::Vector2
 A 2d vector or point. More...
struct  GEO::Matrix4
 A 4x4 matrix. More...
struct  GEO::Matrix3
 A 3x3 matrix. More...
struct  GEO::Matrix2
 A 2x2 matrix. More...

Functions

bool GEO::NearEqual (float c0, float c1, float tolerance=FLOAT_TOLERANCE)
 compare elements for "near equal"
template<typename VecType>
bool GEO::NearEqual (const VecType &v1, const VecType &v2, float tolerance=FLOAT_TOLERANCE)
 compare elements for "near equal"
template<typename VecType>
bool GEO::NearEqual (const VecType &v, float c, float tolerance=FLOAT_TOLERANCE)
 compare elements for "near equal"
bool GEO::IsFinite (float c)
 return true if a float is valid
template<typename VecType>
bool GEO::IsFinite (VecType &v)
 returns true if all elements are valid floats
template<typename VecType>
float GEO::VecDot (const VecType &v1, const VecType &v2)
 dot product
struct Vector3 GEO::VecCross (const struct Vector3 &v1, const struct Vector3 &v2)
 cross product
template<typename VecType>
VecType GEO::VecNormal (const VecType &v)
 get the normalized version of a vector
template<typename VecType>
void GEO::VecNormalize (VecType &v)
 normalize a vector
template<typename VecType>
float GEO::VecAngleBetween (const VecType &l1, const VecType &l2)
 angle between vectors
template<typename VecType>
VecType GEO::VecReflect (const VecType &vec, const VecType &norm)
 reflect a vector off of a normal
template<typename MatType>
MatType GEO::MatMul (const MatType &m1, const MatType &m2)
 multiply two matrices
float GEO::MatDeterminant (const Matrix4 &mat)
 finds the determinant of a matrix
float GEO::MatDeterminant (const Matrix3 &mat)
 finds the determinant of a matrix
float GEO::MatDeterminant (const Matrix2 &mat)
 finds the determinant of a matrix
template<typename MatType>
MatType GEO::MatTranspose (const MatType &mat)
 finds the transpose of a matrix
template<typename MatType>
MatType GEO::MatInverse (const MatType &mat)
 finds the inverse of a matrix (undefined behaviour if inverse does not exist)
Matrix3 GEO::MatRotateX (float angle)
 creates a matrix that rotates around the x axis
Matrix3 GEO::MatRotateY (float angle)
 creates a matrix that rotates around the y axis
Matrix3 GEO::MatRotateZ (float angle)
 creates a matrix that rotates around the z axis
Matrix3 GEO::MatRotateAxis (const Vector3 &axis, float angle)
 creates a matrix that rotates around an axis
template<typename VecType>
VecType::GreaterMatrixType GEO::MatTranslate (const VecType &offset)
 builds a translation matrix
Matrix4 GEO::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 GEO::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
template<typename VecType>
VecType GEO::TransformVector (const typename VecType::MatrixType &m, const VecType &v)
 multiply a matrix by a vector

Variables

const float GEO::PI2
 2 PI
const float GEO::PI
 PI.
const float GEO::FLOAT_TOLERANCE
 Acceptable range of closeness to count floats as equal.

Detailed Description

Vector and matrix primitives and operations.


Generated on Sat Oct 20 15:23:26 2007 for MPMA Framework by  doxygen 1.5.3