gfx_math.hh File Reference

Math functions for computer graphics. More...

#include "gfx_math_matrix.hh"

Go to the source code of this file.

Namespaces

namespace  gfx

Defines

#define GFX_MATH_HH   1
#define IF_DEG_GT(DEG1, DEG2)   (ABS(DEG1) > ABS(DEG2))
#define IF_DEG_LT(DEG1, DEG2)   (ABS(DEG1) < ABS(DEG2))
#define IF_RAD_GT(RAD1, RAD2)   (ABS(RAD1) > ABS(RAD2))
#define IF_RAD_LT(RAD1, RAD2)   (ABS(RAD1) < ABS(RAD2))
#define DEG2RAD(DEG)   ((DEG) * (degRadRatio))
#define RAD2DEG(RAD)   ((RAD) * (radDegRatio))

Functions

INLINE bool gfx::IF_NAN (volatile fp n)
 gfx::DECLARE_DISTINCT_TYPE (Radian, fpx) DECLARE_DISTINCT_TYPE(Degree
template<typename FP>
pair< FP, FP > gfx::SinCos (const Radian rad)
INLINE Degree gfx::TruncateDeg (Degree deg)
INLINE Radian gfx::Deg2Rad (Degree deg)
INLINE Degree gfx::Rad2Deg (Radian rad)
INLINE fpx gfx::Sin (Degree deg)
INLINE fpx gfx::Cos (Degree deg)
INLINE fp gfx::Distance (const Vector2 &v)
INLINE fp gfx::Distance (const Vector3 &v)
template<typename VECTOR3A, typename VECTOR3B>
fp gfx::Distance (const VECTOR3A &v1, const VECTOR3B &v2)
INLINE fpx gfx::DistanceSquared (const Vector3 &v1, const Vector3 &v2)
template<typename MATRIX1, typename MATRIX2>
fpx gfx::DistanceSquaredMatrix (const MATRIX1 &m1, const MATRIX2 &m2)
INLINE Vector3 gfx::Normalize (const Vector3 &v)
INLINE fp gfx::NormalizeCoord (uint axis, const Vector3 &v)
INLINE Vector3 gfx::CrossProduct (const Vector3 &v0, const Vector3 &v1, const Vector3 &v2)
INLINE fp gfx::DotProduct2 (const Vector2 &v1, const Vector2 &v2)
template<typename VECTOR3A, typename VECTOR3B>
fp gfx::DotProduct3 (const VECTOR3A &v1, const VECTOR3B &v2)
template<typename VECTOR3A, typename VECTOR3B>
fpx gfx::DotProduct3_fpx (const VECTOR3A &v1, const VECTOR3B &v2)
INLINE Radian gfx::Angle2 (const Vector2 &u, const Vector2 &v)
template<typename VECTOR>
Radian gfx::Angle3 (const VECTOR &u, const VECTOR &v)
INLINE Vector3 gfx::Interpolate (const Vector3 &v1, const Vector3 &v2, const fp fraction)
template<typename T>
gfx::Midpoint (T x1, T x2)
INLINE Vector3 gfx::Midpoint (const Vector3 &v1, const Vector3 &v2)
template<typename T>
gfx::SQUARE (T x)
template<typename T>
gfx::AVG (T x, T y)
template<typename T>
gfx::Range (T val, T lo, T hi)
template<typename T>
gfx::IfInRange (T a0, T a1, T b0, T b1)
INLINE fp gfx::Remap (fp value, fp rangeOld, fp rangeNew)
INLINE fp gfx::Truncate (fp val, fp interval)

Variables

const fpx gfx::PI = 3.14159265358979323846L
const fpx gfx::PI2 = 6.28318530717958647692L
const fpx gfx::PI_90 = 1.57079632679489661926L
fpx const Radian gfx::RADIAN_180 = gfx::PI
const Radian gfx::RADIAN_360 = gfx::PI2
INTERN const fpx gfx::degRadRatio = (1.0 / 360.0) * (gfx::PI2)
INTERN const fpx gfx::radDegRatio = (1.0 / gfx::PI2) * 360.0


Detailed Description

Math functions for computer graphics.

Id
LastChangedDate

Author:
Jim E. Brooks http://www.palomino3d.org
Remarks:
To speed or improve FP execution:

Define Documentation

#define DEG2RAD ( DEG   )     ((DEG) * (degRadRatio))

#define GFX_MATH_HH   1

#define IF_DEG_GT ( DEG1,
DEG2   )     (ABS(DEG1) > ABS(DEG2))

#define IF_DEG_LT ( DEG1,
DEG2   )     (ABS(DEG1) < ABS(DEG2))

#define IF_RAD_GT ( RAD1,
RAD2   )     (ABS(RAD1) > ABS(RAD2))

#define IF_RAD_LT ( RAD1,
RAD2   )     (ABS(RAD1) < ABS(RAD2))

#define RAD2DEG ( RAD   )     ((RAD) * (radDegRatio))

Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:15 2007