summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolbrush.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolbrush.cpp')
-rw-r--r--indra/newview/lltoolbrush.cpp63
1 files changed, 60 insertions, 3 deletions
diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp
index b644e43a64..07a9650af2 100644
--- a/indra/newview/lltoolbrush.cpp
+++ b/indra/newview/lltoolbrush.cpp
@@ -466,6 +466,27 @@ void LLToolBrushLand::render()
}
}
+/*
+ * Draw vertical lines from each vertex straight up in world space
+ * with lengths indicating the current "strength" slider.
+ * Decorate the tops and bottoms of the lines like this:
+ *
+ * Raise Revert
+ * /|\ ___
+ * | |
+ * | |
+ *
+ * Rough Smooth
+ * /|\ ___
+ * | |
+ * | |
+ * \|/..........._|_
+ *
+ * Lower Flatten
+ * | |
+ * | |
+ * \|/..........._|_
+ */
void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region,
const LLVector3& pos_world)
{
@@ -479,19 +500,55 @@ void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region
S32 i = (S32) pos_region.mV[VX];
S32 j = (S32) pos_region.mV[VY];
S32 half_edge = llfloor(LAND_BRUSH_SIZE[mBrushIndex]);
+ S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction");
+ F32 force = gSavedSettings.getF32("LandBrushForce"); // .1 to 100?
- gGL.begin(LLVertexBuffer::POINTS);
+ gGL.begin(LLVertexBuffer::LINES);
for(S32 di = -half_edge; di <= half_edge; di++)
{
if((i+di) < 0 || (i+di) >= (S32)land.mGridsPerEdge) continue;
for(S32 dj = -half_edge; dj <= half_edge; dj++)
{
if( (j+dj) < 0 || (j+dj) >= (S32)land.mGridsPerEdge ) continue;
- gGL.vertex3f(pos_world.mV[VX] + di, pos_world.mV[VY] + dj,
- land.getZ((i+di)+(j+dj)*land.mGridsPerEdge));
+ const F32
+ wx = pos_world.mV[VX] + di,
+ wy = pos_world.mV[VY] + dj,
+ wz = land.getZ((i+di)+(j+dj)*land.mGridsPerEdge),
+ norm_dist = sqrt((float)di*di + dj*dj) / half_edge,
+ force_scale = sqrt(2.f) - norm_dist, // 1 at center, 0 at corner
+ wz2 = wz + .2 + (.2 + force/100) * force_scale, // top vertex
+ tic = .075f; // arrowhead size
+ // vertical line
+ gGL.vertex3f(wx, wy, wz);
+ gGL.vertex3f(wx, wy, wz2);
+ if(radioAction == E_LAND_RAISE || radioAction == E_LAND_NOISE) // up arrow
+ {
+ gGL.vertex3f(wx, wy, wz2);
+ gGL.vertex3f(wx+tic, wy, wz2-tic);
+ gGL.vertex3f(wx, wy, wz2);
+ gGL.vertex3f(wx-tic, wy, wz2-tic);
+ }
+ if(radioAction == E_LAND_LOWER || radioAction == E_LAND_NOISE) // down arrow
+ {
+ gGL.vertex3f(wx, wy, wz);
+ gGL.vertex3f(wx+tic, wy, wz+tic);
+ gGL.vertex3f(wx, wy, wz);
+ gGL.vertex3f(wx-tic, wy, wz+tic);
+ }
+ if(radioAction == E_LAND_REVERT || radioAction == E_LAND_SMOOTH) // flat top
+ {
+ gGL.vertex3f(wx-tic, wy, wz2);
+ gGL.vertex3f(wx+tic, wy, wz2);
+ }
+ if(radioAction == E_LAND_LEVEL || radioAction == E_LAND_SMOOTH) // flat bottom
+ {
+ gGL.vertex3f(wx-tic, wy, wz);
+ gGL.vertex3f(wx+tic, wy, wz);
+ }
}
}
gGL.end();
+
glPopMatrix();
}