X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmath.hh;h=ab80dcc35af94cf3677ffa9d4e83224eb3824045;hp=78f4efdba03535b3382c151674710ad737cfcc07;hb=7d15b919681bb9ec0088b4b27c6abf62d6dfb9b1;hpb=79b5f738f2e38acb60cda7e09f54802933a17105 diff --git a/src/math.hh b/src/math.hh index 78f4efd..ab80dcc 100644 --- a/src/math.hh +++ b/src/math.hh @@ -26,29 +26,41 @@ *******************************************************************************/ +#ifndef _MATH_HH_ +#define _MATH_HH_ + /** * @file math.hh * General math-related types and functions. */ -#ifndef _MATH_HH_ -#define _MATH_HH_ - #include +#include + +#include namespace dc { -typedef double scalar; ///< Scalar variable. +// Basic types. + +typedef float scalar; ///< Scalar type. + +typedef cml::vector2f vector2; +typedef cml::vector3f vector3; +typedef cml::vector4f vector4; +typedef cml::matrix33f_c matrix3; +typedef cml::matrix44f_c matrix4; -// Here's a simple way to check the equality of floating-point variables more -// reliably using approximation. +typedef cml::quaternionf_p quaternion; -const scalar default_epsilon = 0.00001; ///< @see equals() +typedef vector4 color; +const scalar default_epsilon = 0.00001; + /** * Check the equality of scalars with a certain degree of error allowed. */ @@ -61,6 +73,7 @@ inline bool equals(scalar a, scalar b, scalar epsilon = default_epsilon) } // namespace dc - #endif // _MATH_HH_ +/** vim: set ts=4 sw=4 tw=80: *************************************************/ +