From ac443559d119ef2aed5a7e1469e091d5197b358c Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 8 Oct 2008 14:51:55 +0000 Subject: Mantis#2354. Thank you kindly, Tglion for a patch that: The average-value of modify.ModifyBlock.Height in LLClientView.cs:4170 seem to be incorrect or it isn't the average? Mhhh... So the terrain build -> Flaten Sphere is unuseable. I have put in a patch that contains a workaround while the main problem is not solved. --- .../World/Terrain/PaintBrushes/FlattenSphere.cs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs index e507481..c103d99 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs @@ -40,6 +40,30 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes int x, y; + if (rz < 0) { + double sum = 0.0; + double step2 = 0.0; + duration = 0.009; //MCP Should be read from ini file + + + // compute delta map + for (x = 0; x < map.Width; x++) + { + for (y = 0; y < map.Height; y++) + { + double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); + + if (z > 0) // add in non-zero amount + { + sum += map[x, y] * z; + step2 += z; + } + } + } + rz = sum / step2; + } + + // blend in map for (x = 0; x < map.Width; x++) { -- cgit v1.1