diff options
Diffstat (limited to 'indra/newview/llworld.cpp')
-rw-r--r-- | indra/newview/llworld.cpp | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 4a6ec7fdbb..6f6e0d2334 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -127,6 +127,12 @@ void LLWorld::destroyClass() LLVOCache::getInstance()->destroyClass() ; } LLViewerPartSim::getInstance()->destroyClass(); + + mDefaultWaterTexturep = NULL ; + for (S32 i = 0; i < 8; i++) + { + mEdgeWaterObjects[i] = NULL; + } } @@ -583,22 +589,22 @@ void LLWorld::updateVisibilities() { F32 cur_far_clip = LLViewerCamera::getInstance()->getFar(); - LLViewerCamera::getInstance()->setFar(mLandFarClip); - - F32 diagonal_squared = F_SQRT2 * F_SQRT2 * mWidth * mWidth; - // Go through the culled list and check for visible regions + // Go through the culled list and check for visible regions (region is visible if land is visible) for (region_list_t::iterator iter = mCulledRegionList.begin(); iter != mCulledRegionList.end(); ) { region_list_t::iterator curiter = iter++; LLViewerRegion* regionp = *curiter; - F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ(); - F32 radius = 0.5f*(F32) sqrt(height * height + diagonal_squared); - if (!regionp->getLand().hasZData() - || LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) + + LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); + if (part) { - mCulledRegionList.erase(curiter); - mVisibleRegionList.push_back(regionp); + LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); + if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1])) + { + mCulledRegionList.erase(curiter); + mVisibleRegionList.push_back(regionp); + } } } @@ -613,17 +619,20 @@ void LLWorld::updateVisibilities() continue; } - F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ(); - F32 radius = 0.5f*(F32) sqrt(height * height + diagonal_squared); - if (LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) - { - regionp->calculateCameraDistance(); - regionp->getLand().updatePatchVisibilities(gAgent); - } - else + LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); + if (part) { - mVisibleRegionList.erase(curiter); - mCulledRegionList.push_back(regionp); + LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); + if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1])) + { + regionp->calculateCameraDistance(); + regionp->getLand().updatePatchVisibilities(gAgent); + } + else + { + mVisibleRegionList.erase(curiter); + mCulledRegionList.push_back(regionp); + } } } |