summaryrefslogtreecommitdiff
path: root/indra/llmath/llcamera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath/llcamera.cpp')
-rw-r--r--indra/llmath/llcamera.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/llmath/llcamera.cpp b/indra/llmath/llcamera.cpp
index 0f343bcefe..21ea4b2e7c 100644
--- a/indra/llmath/llcamera.cpp
+++ b/indra/llmath/llcamera.cpp
@@ -178,7 +178,7 @@ S32 LLCamera::AABBInFrustum(const LLVector3 &center, const LLVector3& radius)
U8 mask = 0;
S32 result = 2;
- if (radius.magVecSquared() > mFrustumCornerDist * mFrustumCornerDist)
+ /*if (mFrustumCornerDist > 0.f && radius.magVecSquared() > mFrustumCornerDist * mFrustumCornerDist)
{ //box is larger than frustum, check frustum quads against box planes
static const LLVector3 dir[] =
@@ -241,11 +241,15 @@ S32 LLCamera::AABBInFrustum(const LLVector3 &center, const LLVector3& radius)
result = 1;
}
}
- else
+ else*/
{
for (U32 i = 0; i < mPlaneCount; i++)
{
mask = mAgentPlanes[i].mask;
+ if (mask == 0xff)
+ {
+ continue;
+ }
LLPlane p = mAgentPlanes[i].p;
LLVector3 n = LLVector3(p);
float d = p.mV[3];
@@ -294,6 +298,10 @@ S32 LLCamera::AABBInFrustumNoFarClip(const LLVector3 &center, const LLVector3& r
}
mask = mAgentPlanes[i].mask;
+ if (mask == 0xff)
+ {
+ continue;
+ }
LLPlane p = mAgentPlanes[i].p;
LLVector3 n = LLVector3(p);
float d = p.mV[3];
@@ -437,6 +445,11 @@ int LLCamera::sphereInFrustum(const LLVector3 &sphere_center, const F32 radius)
int res = 2;
for (int i = 0; i < 6; i++)
{
+ if (mAgentPlanes[i].mask == 0xff)
+ {
+ continue;
+ }
+
float d = mAgentPlanes[i].p.dist(sphere_center);
if (d > radius)
@@ -622,6 +635,17 @@ U8 LLCamera::calcPlaneMask(const LLPlane& plane)
return mask;
}
+void LLCamera::ignoreAgentFrustumPlane(S32 idx)
+{
+ if (idx < 0 || idx > (S32) mPlaneCount)
+ {
+ return;
+ }
+
+ mAgentPlanes[idx].mask = 0xff;
+ mAgentPlanes[idx].p.clearVec();
+}
+
void LLCamera::calcAgentFrustumPlanes(LLVector3* frust)
{