Skip to content
Snippets Groups Projects
Commit c559e3d6 authored by simon@Simon-PC.lindenlab.com's avatar simon@Simon-PC.lindenlab.com
Browse files

MAINT-1161: non standard sea level not correctly rendered around private islands.

Reviewed by Kelly
parent 184d5ee7
No related branches found
No related tags found
No related merge requests found
...@@ -294,7 +294,7 @@ void LLSurface::initTextures() ...@@ -294,7 +294,7 @@ void LLSurface::initTextures()
mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp); mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
gPipeline.createObject(mWaterObjp); gPipeline.createObject(mWaterObjp);
LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle()); LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); // region doesn't have a valid water height yet
mWaterObjp->setPositionGlobal(water_pos_global); mWaterObjp->setPositionGlobal(water_pos_global);
} }
} }
......
...@@ -837,6 +837,9 @@ void LLWorld::updateWaterObjects() ...@@ -837,6 +837,9 @@ void LLWorld::updateWaterObjects()
} }
mHoleWaterObjects.clear(); mHoleWaterObjects.clear();
// Use the water height of the region we're on for areas where there is no region
F32 water_height = gAgent.getRegion()->getWaterHeight();
// Now, get a list of the holes // Now, get a list of the holes
S32 x, y; S32 x, y;
for (x = min_x; x <= max_x; x += rwidth) for (x = min_x; x <= max_x; x += rwidth)
...@@ -845,12 +848,12 @@ void LLWorld::updateWaterObjects() ...@@ -845,12 +848,12 @@ void LLWorld::updateWaterObjects()
{ {
U64 region_handle = to_region_handle(x, y); U64 region_handle = to_region_handle(x, y);
if (!getRegionFromHandle(region_handle)) if (!getRegionFromHandle(region_handle))
{ { // No region at that area, so make water
LLVOWater* waterp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, gAgent.getRegion()); LLVOWater* waterp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, gAgent.getRegion());
waterp->setUseTexture(FALSE); waterp->setUseTexture(FALSE);
waterp->setPositionGlobal(LLVector3d(x + rwidth/2, waterp->setPositionGlobal(LLVector3d(x + rwidth/2,
y + rwidth/2, y + rwidth/2,
256.f+DEFAULT_WATER_HEIGHT)); 256.f + water_height));
waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, 512.f)); waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, 512.f));
gPipeline.createObject(waterp); gPipeline.createObject(waterp);
mHoleWaterObjects.push_back(waterp); mHoleWaterObjects.push_back(waterp);
...@@ -907,7 +910,7 @@ void LLWorld::updateWaterObjects() ...@@ -907,7 +910,7 @@ void LLWorld::updateWaterObjects()
} }
waterp->setRegion(gAgent.getRegion()); waterp->setRegion(gAgent.getRegion());
LLVector3d water_pos(water_center_x, water_center_y, 256.f+DEFAULT_WATER_HEIGHT) ; LLVector3d water_pos(water_center_x, water_center_y, 256.f + water_height) ;
LLVector3 water_scale((F32) dim[0], (F32) dim[1], 512.f); LLVector3 water_scale((F32) dim[0], (F32) dim[1], 512.f);
//stretch out to horizon //stretch out to horizon
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment