summaryrefslogtreecommitdiff
path: root/indra/newview/llvieweroctree.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-10-18 16:15:05 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-10-18 16:15:05 -0600
commitfc45b59a977881a4e37619cb0220790d5ad4c814 (patch)
treeaa221532d4fe021f7ab08cb3d39520c37a669a36 /indra/newview/llvieweroctree.cpp
parentd2cf7ba42931bb7ecf637fbf4ff25c7837c3296f (diff)
parent7bfacf8ca6c7bfdd9b11a2036a914c8f47058a61 (diff)
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/newview/llvieweroctree.cpp')
-rw-r--r--indra/newview/llvieweroctree.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp
index e390249504..425e7fbd1f 100644
--- a/indra/newview/llvieweroctree.cpp
+++ b/indra/newview/llvieweroctree.cpp
@@ -1430,6 +1430,25 @@ S32 LLViewerOctreeCull::AABBRegionSphereIntersectObjectExtents(const LLViewerOct
return AABBSphereIntersect(group->mObjectExtents[0], group->mObjectExtents[1], mCamera->getOrigin() - shift, mCamera->mFrustumCornerDist);
}
//------------------------------------------
+//check if the objects projection large enough
+bool LLViewerOctreeCull::checkProjectionArea(const LLVector4a& center, const LLVector4a& size, const LLVector3& shift, F32 projection_cutoff)
+{
+ LLVector3 local_orig = mCamera->getOrigin() - shift;
+ LLVector4a origin;
+ origin.load3(local_orig.mV);
+
+ LLVector4a lookAt;
+ lookAt.setSub(center, origin);
+ F32 squared_dist = lookAt.dot3(lookAt).getF32();
+ F32 squared_rad = size.dot3(size).getF32();
+
+ if(squared_dist > 0.f)
+ {
+ return squared_rad / squared_dist > projection_cutoff;
+ }
+
+ return true;
+}
//virtual
bool LLViewerOctreeCull::checkObjects(const OctreeNode* branch, const LLViewerOctreeGroup* group)