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. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 1 + .../World/Terrain/PaintBrushes/FlattenSphere.cs | 24 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index d2f46e5..b2138aa 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4179,6 +4179,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerModifyTerrain = OnModifyTerrain; if (handlerModifyTerrain != null) { + modify.ModifyBlock.Height = -1; // Hack, i don't know why the value is wrong handlerModifyTerrain(modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, modify.ModifyBlock.BrushSize, modify.ModifyBlock.Action, modify.ParcelData[i].North, 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