X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FMath.hh;fp=src%2Fmath.hh;h=563746e380e5b38fc347f856b3cebd6b3b63c2bd;hp=ab80dcc35af94cf3677ffa9d4e83224eb3824045;hb=c2321281bf12a7efaedde930422c7ddbc92080d4;hpb=87bc17e55b0c1dc73ecc66df856d3f08fd7a7724 diff --git a/src/math.hh b/src/Moof/Math.hh similarity index 78% rename from src/math.hh rename to src/Moof/Math.hh index ab80dcc..563746e 100644 --- a/src/math.hh +++ b/src/Moof/Math.hh @@ -26,54 +26,52 @@ *******************************************************************************/ -#ifndef _MATH_HH_ -#define _MATH_HH_ +#ifndef _MOOF_MATH_HH_ +#define _MOOF_MATH_HH_ /** - * @file math.hh + * @file Math.hh * General math-related types and functions. */ #include #include -#include - -namespace dc { +namespace Mf { // Basic types. -typedef float scalar; ///< Scalar type. +typedef float Scalar; ///< Scalar type. -typedef cml::vector2f vector2; -typedef cml::vector3f vector3; -typedef cml::vector4f vector4; +typedef cml::vector2f Vector2; +typedef cml::vector3f Vector3; +typedef cml::vector4f Vector4; -typedef cml::matrix33f_c matrix3; -typedef cml::matrix44f_c matrix4; +typedef cml::matrix33f_c Matrix3; +typedef cml::matrix44f_c Matrix4; -typedef cml::quaternionf_p quaternion; +typedef cml::quaternionf_p Quaternion; -typedef vector4 color; +typedef Vector4 Color; -const scalar default_epsilon = 0.00001; +const Scalar EPSILON = 0.000001f; /** * Check the equality of scalars with a certain degree of error allowed. */ -inline bool equals(scalar a, scalar b, scalar epsilon = default_epsilon) +inline bool checkEquality(Scalar a, Scalar b, Scalar epsilon = EPSILON) { return std::abs(a - b) < epsilon; } -} // namespace dc +} // namespace Mf -#endif // _MATH_HH_ +#endif // _MOOF_MATH_HH_ /** vim: set ts=4 sw=4 tw=80: *************************************************/