X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fmath.hh;h=ab80dcc35af94cf3677ffa9d4e83224eb3824045;hb=e1a8eee026993b860c557c87ec559c902a4b6a11;hp=313ecc1c09fa8b036821cc4871d31f6b06b8957a;hpb=0fffd0097d7b496454413e57b398c903ecc252e4;p=chaz%2Fyoink diff --git a/src/math.hh b/src/math.hh index 313ecc1..ab80dcc 100644 --- a/src/math.hh +++ b/src/math.hh @@ -37,29 +37,29 @@ #include #include +#include -namespace dc { +namespace dc { -typedef double scalar; ///< Scalar variable. -typedef cml::vector2d vector2; -typedef cml::vector3d vector3; -typedef cml::vector4d vector4; +// Basic types. -typedef cml::matrix33d_c matrix3; -typedef cml::matrix44d_c matrix4; +typedef float scalar; ///< Scalar type. -typedef cml::quaterniond_p quaternion; +typedef cml::vector2f vector2; +typedef cml::vector3f vector3; +typedef cml::vector4f vector4; -typedef cml::vector4f color; +typedef cml::matrix33f_c matrix3; +typedef cml::matrix44f_c matrix4; +typedef cml::quaternionf_p quaternion; -// Here's a simple way to check the equality of floating-point variables more -// reliably using approximation. +typedef vector4 color; -const scalar default_epsilon = 0.00001; ///< @see equals() +const scalar default_epsilon = 0.00001; /** * Check the equality of scalars with a certain degree of error allowed. @@ -75,3 +75,5 @@ inline bool equals(scalar a, scalar b, scalar epsilon = default_epsilon) #endif // _MATH_HH_ +/** vim: set ts=4 sw=4 tw=80: *************************************************/ +