diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-11-13 22:38:39 -0700 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-11-13 22:38:39 -0700 |
commit | 6ec5d9943d4637543eacca805d73f859c25a7e07 (patch) | |
tree | 8e548b21d24464b513afe9a41ca10ff1c985593e /indra/llmath/llcamera.cpp | |
parent | 6d9d382c73c026f1dcb2f9d2810994a66cd2bd9d (diff) | |
parent | 6a0a5c18e33be6889f12a9954861c446acb9113b (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/llmath/llcamera.cpp')
-rwxr-xr-x | indra/llmath/llcamera.cpp | 28 |
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); } } |