]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Math.hh
initial working frustum culling implementation
[chaz/yoink] / src / Moof / Math.hh
index c4e3484ebebc56b5bad7e05cee6c13f9ef657557..26c4b5180dc61395c97752bd133b606de9285b10 100644 (file)
@@ -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<Scalar>                                 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;
 
@@ -64,7 +85,7 @@ const Scalar EPSILON = 0.000001;
  * Check the equality of scalars with a certain degree of error allowed.
  */
 
-inline bool checkEquality(Scalar a, Scalar b, Scalar epsilon = EPSILON)
+inline bool isEqual(Scalar a, Scalar b, Scalar epsilon = EPSILON)
 {
        return std::abs(a - b) < epsilon;
 }
This page took 0.019537 seconds and 4 git commands to generate.