diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llsurfacepatch.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llsurfacepatch.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/linden/indra/newview/llsurfacepatch.cpp b/linden/indra/newview/llsurfacepatch.cpp index f076508..432ca01 100644 --- a/linden/indra/newview/llsurfacepatch.cpp +++ b/linden/indra/newview/llsurfacepatch.cpp | |||
@@ -364,9 +364,17 @@ const LLVector3 &LLSurfacePatch::getNormal(const U32 x, const U32 y) const | |||
364 | 364 | ||
365 | void LLSurfacePatch::updateCameraDistanceRegion(const LLVector3 &pos_region) | 365 | void LLSurfacePatch::updateCameraDistanceRegion(const LLVector3 &pos_region) |
366 | { | 366 | { |
367 | LLVector3 dv = pos_region; | 367 | if (LLPipeline::sDynamicLOD) |
368 | dv -= mCenterRegion; | 368 | { |
369 | mVisInfo.mDistance = llmax(0.f, (F32)(dv.magVec() - mRadius)); | 369 | LLVector3 dv = pos_region; |
370 | dv -= mCenterRegion; | ||
371 | mVisInfo.mDistance = llmax(0.f, (F32)(dv.magVec() - mRadius))/ | ||
372 | llmax(LLVOSurfacePatch::sLODFactor, 0.1f); | ||
373 | } | ||
374 | else | ||
375 | { | ||
376 | mVisInfo.mDistance = 0.f; | ||
377 | } | ||
370 | } | 378 | } |
371 | 379 | ||
372 | F32 LLSurfacePatch::getDistance() const | 380 | F32 LLSurfacePatch::getDistance() const |
@@ -833,8 +841,11 @@ void LLSurfacePatch::updateVisibility() | |||
833 | F32 stride_per_distance = DEFAULT_DELTA_ANGLE / mSurfacep->getMetersPerGrid(); | 841 | F32 stride_per_distance = DEFAULT_DELTA_ANGLE / mSurfacep->getMetersPerGrid(); |
834 | U32 grids_per_patch_edge = mSurfacep->getGridsPerPatchEdge(); | 842 | U32 grids_per_patch_edge = mSurfacep->getGridsPerPatchEdge(); |
835 | 843 | ||
844 | LLVector3 center = mCenterRegion + mSurfacep->getOriginAgent(); | ||
845 | LLVector3 radius = LLVector3(mRadius, mRadius, mRadius); | ||
846 | |||
836 | // sphere in frustum on global coordinates | 847 | // sphere in frustum on global coordinates |
837 | if (gCamera->sphereInFrustum(mCenterRegion + mSurfacep->getOriginAgent(), mRadius) ) | 848 | if (gCamera->AABBInFrustumNoFarClip(center, radius)) |
838 | { | 849 | { |
839 | // We now need to calculate the render stride based on patchp's distance | 850 | // We now need to calculate the render stride based on patchp's distance |
840 | // from LLCamera render_stride is governed by a relation something like this... | 851 | // from LLCamera render_stride is governed by a relation something like this... |