X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FMath.hh;h=c4e3484ebebc56b5bad7e05cee6c13f9ef657557;hp=563746e380e5b38fc347f856b3cebd6b3b63c2bd;hb=16d1a05b0777e97a45c48e2874aa4e5cc791282e;hpb=15cd32dc28e7fa5997d9850d7e10b889f69a7cae diff --git a/src/Moof/Math.hh b/src/Moof/Math.hh index 563746e..c4e3484 100644 --- a/src/Moof/Math.hh +++ b/src/Moof/Math.hh @@ -37,27 +37,28 @@ #include #include - -namespace Mf { +#include // GLscalar -// Basic types. +namespace Mf { -typedef float Scalar; ///< Scalar type. -typedef cml::vector2f Vector2; -typedef cml::vector3f Vector3; -typedef cml::vector4f Vector4; +typedef GLscalar Scalar; -typedef cml::matrix33f_c Matrix3; -typedef cml::matrix44f_c Matrix4; +typedef cml::vector< Scalar, cml::fixed<2> > Vector2; +typedef cml::vector< Scalar, cml::fixed<3> > Vector3; +typedef cml::vector< Scalar, cml::fixed<4> > Vector4; -typedef cml::quaternionf_p Quaternion; +typedef cml::matrix< Scalar, cml::fixed<3,3>, + cml::col_basis, cml::col_major > Matrix3; +typedef cml::matrix< Scalar, cml::fixed<4,4>, + cml::col_basis, cml::col_major > Matrix4; -typedef Vector4 Color; +typedef cml::quaternion< Scalar, cml::fixed<>, cml::vector_first, + cml::positive_cross > Quaternion; -const Scalar EPSILON = 0.000001f; +const Scalar EPSILON = 0.000001; /** * Check the equality of scalars with a certain degree of error allowed.