]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Aabb.cc
revamped scene drawing in preparation for octree
[chaz/yoink] / src / Moof / Aabb.cc
index 7b2ada7ba7f7f5b6704adf59af8e9962bd64d9aa..d81c971f78947d61a0df5d5b0de4344c46f93b16 100644 (file)
@@ -27,6 +27,7 @@
 *******************************************************************************/
 
 #include <Moof/Aabb.hh>
+#include <Moof/Camera.hh>
 
 
 namespace Mf {
@@ -43,7 +44,7 @@ void Aabb::draw(Scalar alpha) const
                                                 max[0], min[1], max[2],
                                                 max[0], max[1], max[2]};
 
-       GLubyte indicis[] = {0, 1, 2, 3,
+       GLubyte indices[] = {0, 1, 2, 3,
                                                 1, 2, 7, 4,
                                                 3, 0, 5, 6,
                                                 2, 3, 6, 7,
@@ -53,7 +54,12 @@ void Aabb::draw(Scalar alpha) const
        glEnableClientState(GL_VERTEX_ARRAY);
        glVertexPointer(3, GL_SCALAR, 0, vertices);
 
-       glDrawElements(GL_QUADS, sizeof(indicis), GL_UNSIGNED_BYTE, indicis);
+       glDrawElements(GL_QUADS, sizeof(indices), GL_UNSIGNED_BYTE, indices);
+}
+
+bool Aabb::isVisible(const Camera& cam) const
+{
+       return cam.getFrustum().checkAabb(*this);
 }
 
 
This page took 0.019823 seconds and 4 git commands to generate.