summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-11-30 11:21:22 -0700
committerXiaohong Bao <bao@lindenlab.com>2011-11-30 11:21:22 -0700
commite6f5a57395a64b8dcfe85f20b0a63402c77a3c5f (patch)
tree6d00bcda1894740e23b74ac73d96fd0637f20bab /indra/newview
parent83c3d378275e4da6f4aa0b148853abf770f73e86 (diff)
fix for SH-2668: "ocean" water is always 20m high instead of the Region Water Height
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llworld.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 6f6e0d2334..676287c0ad 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -818,14 +818,11 @@ void LLWorld::updateWaterObjects()
max_x = (S32)region_x + range;
max_y = (S32)region_y + range;
- F32 height = 0.f;
-
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
LLVOWater* waterp = regionp->getLand().getWaterObj();
- height += regionp->getWaterHeight();
if (waterp)
{
gObjectList.updateActive(waterp);
@@ -842,6 +839,7 @@ void LLWorld::updateWaterObjects()
// Now, get a list of the holes
S32 x, y;
+ F32 water_height = gAgent.getRegion()->getWaterHeight() + 256.f;
for (x = min_x; x <= max_x; x += rwidth)
{
for (y = min_y; y <= max_y; y += rwidth)
@@ -853,7 +851,7 @@ void LLWorld::updateWaterObjects()
waterp->setUseTexture(FALSE);
waterp->setPositionGlobal(LLVector3d(x + rwidth/2,
y + rwidth/2,
- 256.f+DEFAULT_WATER_HEIGHT));
+ water_height));
waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, 512.f));
gPipeline.createObject(waterp);
mHoleWaterObjects.push_back(waterp);
@@ -910,8 +908,7 @@ void LLWorld::updateWaterObjects()
}
waterp->setRegion(gAgent.getRegion());
- LLVector3d water_pos(water_center_x, water_center_y,
- DEFAULT_WATER_HEIGHT+256.f);
+ LLVector3d water_pos(water_center_x, water_center_y, water_height) ;
LLVector3 water_scale((F32) dim[0], (F32) dim[1], 512.f);
//stretch out to horizon