*******************************************************************************/
-#include "Camera.hh"
+#include "Frustum.hh"
#include "Log.hh"
#include "Octree.hh"
}
}
-void Octree::drawIfVisible(Scalar alpha, const Camera& cam, OctreeNodeP node)
+void Octree::drawIfVisible(Scalar alpha, const Frustum& frustum, OctreeNodeP node)
{
ASSERT(node.valid() && "invalid node passed");
// try to cull by sphere
Frustum::Collision collision =
- cam.getFrustum().contains(node->getSphere());
+ frustum.contains(node->getSphere());
if (collision == Frustum::OUTSIDE) return;
// try to cull by aabb
- collision = cam.getFrustum().contains(node->getAabb());
+ collision = frustum.contains(node->getAabb());
if (collision == Frustum::OUTSIDE) return;
}
else // collision == Frustum::INTERSECT
{
- node->drawIfVisible(alpha, cam);
+ node->drawIfVisible(alpha, frustum);
}
if (tree_.children(node) > 0)
OctreeNodeP child = tree_.child(node, i);
ASSERT(child.valid() && "expected valid child node");
- drawIfVisible(alpha, cam, child);
+ drawIfVisible(alpha, frustum, child);
}
}
}