X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FOctree.cc;h=062788daa1f0d0378460c09cfd4b99eff4d924ca;hp=9bb04e81d56e887882c2a59d152cdbcb012c2610;hb=7e898e8ec0ff716e2fc722b883a626a6c346f107;hpb=fe9614821670d9affcb68fb3e45723b9d40d0b7e diff --git a/src/Moof/Octree.cc b/src/Moof/Octree.cc index 9bb04e8..062788d 100644 --- a/src/Moof/Octree.cc +++ b/src/Moof/Octree.cc @@ -26,7 +26,7 @@ *******************************************************************************/ -#include "Camera.hh" +#include "Frustum.hh" #include "Log.hh" #include "Octree.hh" @@ -238,17 +238,17 @@ void Octree::draw(Scalar alpha, OctreeNodeP node) } } -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; @@ -258,7 +258,7 @@ void Octree::drawIfVisible(Scalar alpha, const Camera& cam, OctreeNodeP node) } else // collision == Frustum::INTERSECT { - node->drawIfVisible(alpha, cam); + node->drawIfVisible(alpha, frustum); } if (tree_.children(node) > 0) @@ -280,7 +280,7 @@ void Octree::drawIfVisible(Scalar alpha, const Camera& cam, OctreeNodeP node) OctreeNodeP child = tree_.child(node, i); ASSERT(child.valid() && "expected valid child node"); - drawIfVisible(alpha, cam, child); + drawIfVisible(alpha, frustum, child); } } }