14 #ifndef SRC_GFXMATH_H_
15 #define SRC_GFXMATH_H_
32 static float Clamp(
float x,
float a,
float b);
42 static float Lerp(
float a,
float b,
float alpha);
44 static int iLerp(
int a,
int b,
float alpha);
72 static const float PI;
This class holds a variety of static math functions that are useful to have defined with creating gra...
static const float TWO_PI
static float ToRadians(float degrees)
static Point3 ScreenToNearPlane(const Matrix4 &viewMatrix, const Matrix4 &projMatrix, const Point2 &normalizedScreenPt)
Converts a 2D point on the filmplane represented in Normalized Device Coorindates,...
static Point3 ScreenToWorld(const Matrix4 &viewMatrix, const Matrix4 &projMatrix, const Point2 &normalizedScreenPt, float normalizedZ)
Converts a 2D point on the filmplane represented in Normalized Device Coorindates,...
static Vector3 ToRadians(Vector3 degrees)
static float ToDegrees(float radians)
static Vector3 ToDegrees(Vector3 radians)
static Point3 ScreenToDepthPlane(const Matrix4 &viewMatrix, const Matrix4 &projMatrix, const Point2 &normalizedScreenPt, float planeDepth)
Similar to filmplane2D_to_nearplane3D() but here rather than using the nearplane, you specify the dep...
static const float HALF_PI
static float Lerp(float a, float b, float alpha)
static float Clamp(float x, float a, float b)
Returns a if x is less than a and b if x is greater than b.
static int iLerp(int a, int b, float alpha)
A 4x4 transformation matrix stored internally as an array of floats in column-major order so as to be...
A 2D Point with floating point coordinates, used for storing 2D texture coordinates,...
A 3D Point with floating point coordinates, used for storing vertices and all sorts of other 3D graph...
A 3D Vector with floating point coordinates, used for storing normals and all sorts of other 3D graph...
Namespace for the MinGfx Toolkit.