From 0d4066a347b66372884fc31b0288e4b2c35385d0 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Fri, 14 Mar 2014 10:07:26 -0700 Subject: [PATCH] added note --- libraries/octree/src/ViewFrustum.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/octree/src/ViewFrustum.cpp b/libraries/octree/src/ViewFrustum.cpp index aeffcc4968..66f1445ddc 100644 --- a/libraries/octree/src/ViewFrustum.cpp +++ b/libraries/octree/src/ViewFrustum.cpp @@ -277,6 +277,10 @@ ViewFrustum::location ViewFrustum::boxInFrustum(const AABox& box) const { return keyholeResult; } + // TODO: These calculations are expensive, taking up 80% of our time in this function. + // This appears to be expensive because we have to test the distance to each plane. + // One suggested optimization is to first check against the approximated cone. We might + // also be able to test against the cone to the bounding sphere of the box. for(int i=0; i < 6; i++) { const glm::vec3& normal = _planes[i].getNormal(); const glm::vec3& boxVertexP = box.getVertexP(normal);