diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-09-26 18:08:24 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-09-26 18:08:24 -0400 |
commit | bc4444cd78067cbf11d3ffb210375a31a33f96bd (patch) | |
tree | d9b8e78db237869e630fec6c71335d1294cec101 /indra/llmath | |
parent | 8ddc0c0ac43e9d10bf0262cd1ab3c0e79808fc14 (diff) | |
parent | 09bf3c1fec107e9e66514837d208ef62a6b67b91 (diff) |
Merge into viewer/viewer-20 yesterday's lindenlab/svn-imports-viewer-20
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llcamera.cpp | 28 | ||||
-rw-r--r-- | indra/llmath/llcamera.h | 16 | ||||
-rw-r--r-- | indra/llmath/llrect.h | 1 | ||||
-rw-r--r-- | indra/llmath/llvolume.cpp | 11 | ||||
-rw-r--r-- | indra/llmath/v3math.h | 4 |
5 files changed, 52 insertions, 8 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 ¢er, 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 ¢er, 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 ¢er, 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) { diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index 23ee1157f9..0c81067919 100644 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -93,6 +93,17 @@ public: PLANE_TOP_MASK = (1<<PLANE_TOP), PLANE_ALL_MASK = 0xf }; + + enum + { + AGENT_PLANE_LEFT = 0, + AGENT_PLANE_RIGHT, + AGENT_PLANE_NEAR, + AGENT_PLANE_BOTTOM, + AGENT_PLANE_TOP, + AGENT_PLANE_FAR, + }; + enum { HORIZ_PLANE_LEFT = 0, HORIZ_PLANE_RIGHT = 1, @@ -132,7 +143,8 @@ private: public: LLVector3 mAgentFrustum[8]; //8 corners of 6-plane frustum F32 mFrustumCornerDist; //distance to corner of frustum against far clip plane - + LLPlane getAgentPlane(U32 idx) { return mAgentPlanes[idx].p; } + public: LLCamera(); LLCamera(F32 vertical_fov_rads, F32 aspect_ratio, S32 view_height_in_pixels, F32 near_plane, F32 far_plane); @@ -179,6 +191,8 @@ public: // Return number of bytes copied. size_t readFrustumFromBuffer(const char *buffer); void calcAgentFrustumPlanes(LLVector3* frust); + void ignoreAgentFrustumPlane(S32 idx); + // Returns 1 if partly in, 2 if fully in. // NOTE: 'center' is in absolute frame. S32 sphereInFrustumOld(const LLVector3 ¢er, const F32 radius) const; diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index c03a331aff..2fa8cb3f16 100644 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h @@ -42,6 +42,7 @@ template <class Type> class LLRectBase { public: + typedef Type tCoordType; Type mLeft; Type mTop; Type mRight; diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index a0357a32cc..5cc0a596fd 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -84,6 +84,7 @@ const F32 SKEW_MIN = -0.95f; const F32 SKEW_MAX = 0.95f; const F32 SCULPT_MIN_AREA = 0.002f; +const S32 SCULPT_MIN_AREA_DETAIL = 1; BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm) { @@ -2230,10 +2231,14 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, if (!data_is_empty) { sculptGenerateMapVertices(sculpt_width, sculpt_height, sculpt_components, sculpt_data, sculpt_type); - - if (sculptGetSurfaceArea() < SCULPT_MIN_AREA) + + // don't test lowest LOD to support legacy content DEV-33670 + if (mDetail > SCULPT_MIN_AREA_DETAIL) { - data_is_empty = TRUE; + if (sculptGetSurfaceArea() < SCULPT_MIN_AREA) + { + data_is_empty = TRUE; + } } } diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 805d7e6384..06a4f5c542 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -409,8 +409,8 @@ inline bool operator<(const LLVector3 &a, const LLVector3 &b) return (a.mV[0] < b.mV[0] || (a.mV[0] == b.mV[0] && (a.mV[1] < b.mV[1] - || (a.mV[1] == b.mV[1]) - && a.mV[2] < b.mV[2]))); + || ((a.mV[1] == b.mV[1]) + && a.mV[2] < b.mV[2])))); } inline const LLVector3& operator+=(LLVector3 &a, const LLVector3 &b) |