]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Math.hh
extreme refactoring
[chaz/yoink] / src / Moof / Math.hh
similarity index 78%
rename from src/math.hh
rename to src/Moof/Math.hh
index ab80dcc35af94cf3677ffa9d4e83224eb3824045..563746e380e5b38fc347f856b3cebd6b3b63c2bd 100644 (file)
 
 *******************************************************************************/
 
 
 *******************************************************************************/
 
-#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 <cmath>
 #include <cml/cml.h>
 
  * General math-related types and functions.
  */
 
 #include <cmath>
 #include <cml/cml.h>
 
-#include <iostream>
 
 
-
-namespace dc {
+namespace Mf {
 
 
 // Basic types.
 
 
 
 // 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.
  */
 
 
 /**
  * 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;
 }
 
 
 {
        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: *************************************************/
 
 
 /** vim: set ts=4 sw=4 tw=80: *************************************************/
 
This page took 0.020809 seconds and 4 git commands to generate.