summaryrefslogtreecommitdiff
path: root/indra/llmath/llcamera.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-11-13 22:38:19 -0700
committerXiaohong Bao <bao@lindenlab.com>2013-11-13 22:38:19 -0700
commit6a0a5c18e33be6889f12a9954861c446acb9113b (patch)
tree9733dddb830eeae2981213ca3c1d5fadb77d9ab7 /indra/llmath/llcamera.cpp
parent754a671c93f55c3e1cde6cd2ee0771156f7abaf5 (diff)
more fix for SH-4607: Create new object cache tuning parameters
fix remote objects not showing up.
Diffstat (limited to 'indra/llmath/llcamera.cpp')
-rwxr-xr-xindra/llmath/llcamera.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/llmath/llcamera.cpp b/indra/llmath/llcamera.cpp
index 4d1ee15661..ff90532f75 100755
--- a/indra/llmath/llcamera.cpp
+++ b/indra/llmath/llcamera.cpp
@@ -629,8 +629,24 @@ void LLCamera::calcAgentFrustumPlanes(LLVector3* frust)
//calculate regional planes from mAgentPlanes.
//vector "shift" is the vector of the region origin in the agent space.
-void LLCamera::calcRegionFrustumPlanes(const LLVector3& shift)
+void LLCamera::calcRegionFrustumPlanes(const LLVector3& shift, F32 far_clip_distance)
{
+ F32 far_w;
+ {
+ LLVector3 p = getOrigin();
+ LLVector3 n(mAgentPlanes[5][0], mAgentPlanes[5][1], mAgentPlanes[5][2]);
+ F32 dd = n * p;
+ if(dd + mAgentPlanes[5][3] < 0) //signed distance
+ {
+ far_w = -far_clip_distance - dd;
+ }
+ else
+ {
+ far_w = far_clip_distance - dd;
+ }
+ far_w += n * shift;
+ }
+
F32 d;
LLVector3 n;
for(S32 i = 0 ; i < 7; i++)
@@ -638,7 +654,15 @@ void LLCamera::calcRegionFrustumPlanes(const LLVector3& shift)
if (mPlaneMask[i] != 0xff)
{
n.setVec(mAgentPlanes[i][0], mAgentPlanes[i][1], mAgentPlanes[i][2]);
- d = mAgentPlanes[i][3] + n * shift;
+
+ if(i != 5)
+ {
+ d = mAgentPlanes[i][3] + n * shift;
+ }
+ else
+ {
+ d = far_w;
+ }
mRegionPlanes[i].setVec(n, d);
}
}