diff options
| author | Xiaohong Bao <bao@lindenlab.com> | 2013-10-17 20:22:02 -0600 |
|---|---|---|
| committer | Xiaohong Bao <bao@lindenlab.com> | 2013-10-17 20:22:02 -0600 |
| commit | cf89975f166c1546c60dc51b25558ba74dee5cf5 (patch) | |
| tree | 6880cbba2cad337adcf836248259cc488caa0d96 /indra/newview/llvieweroctree.cpp | |
| parent | 18aedf0241ba893e12140c0a3855f328d2b4eded (diff) | |
| parent | c8228b65f8a4a94220c92d89d1529ed484f6e84a (diff) | |
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/newview/llvieweroctree.cpp')
| -rw-r--r-- | indra/newview/llvieweroctree.cpp | 19 |
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) |
