X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FMath.hh;h=4e1cda8c1a25f3a4f57cffe616a56564040f45f6;hp=c4e3484ebebc56b5bad7e05cee6c13f9ef657557;hb=493ddb59a8620b49dfa0ff62ce93395ebfd02e86;hpb=bc5448947f45c0ba4d22b5ad736b7c545d8ec075 diff --git a/src/Moof/Math.hh b/src/Moof/Math.hh index c4e3484..4e1cda8 100644 --- a/src/Moof/Math.hh +++ b/src/Moof/Math.hh @@ -57,6 +57,27 @@ typedef cml::matrix< Scalar, cml::fixed<4,4>, typedef cml::quaternion< Scalar, cml::fixed<>, cml::vector_first, cml::positive_cross > Quaternion; +typedef cml::constants Constants; + + +inline Vector3& demoteVector(Vector3& left, const Vector4& right) +{ + left[0] = right[0]; + left[1] = right[1]; + left[2] = right[2]; + return left; +} + +inline Vector4& promoteVector(Vector4& left, const Vector3& right) +{ + left[0] = right[0]; + left[1] = right[1]; + left[2] = right[2]; + left[3] = 1.0; + return left; +} + + const Scalar EPSILON = 0.000001;