diff options
author | Dahlia Trimble | 2009-06-18 23:02:12 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-06-18 23:02:12 +0000 |
commit | 00d042f3d18483a5ca54c605d2aa22c6c330e9eb (patch) | |
tree | b9e1522a3b3abf1aa77942d4d2f762d43a16146e /OpenSim/Region/CoreModules | |
parent | Applied patch from Mantis #3817, which fixes a error when using MSSQL. I don'... (diff) | |
download | opensim-SC_OLD-00d042f3d18483a5ca54c605d2aa22c6c330e9eb.zip opensim-SC_OLD-00d042f3d18483a5ca54c605d2aa22c6c330e9eb.tar.gz opensim-SC_OLD-00d042f3d18483a5ca54c605d2aa22c6c330e9eb.tar.bz2 opensim-SC_OLD-00d042f3d18483a5ca54c605d2aa22c6c330e9eb.tar.xz |
Thanks Michelle Argus for Mantis #0003742: Terrain editor - Flatten tool lowers Land
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs | 53 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 5 |
2 files changed, 21 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs index 2fa0c3f..9aa3dff 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs | |||
@@ -41,34 +41,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
41 | 41 | ||
42 | int x, y; | 42 | int x, y; |
43 | 43 | ||
44 | duration = 0.009; //MCP Should be read from ini file | ||
45 | |||
46 | // Disabled - just use the client value. | ||
47 | /* | ||
48 | if (rz < 0) { | ||
49 | double sum = 0.0; | ||
50 | double step2 = 0.0; | ||
51 | |||
52 | |||
53 | // compute delta map | ||
54 | for (x = 0; x < map.Width; x++) | ||
55 | { | ||
56 | for (y = 0; y < map.Height; y++) | ||
57 | { | ||
58 | double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); | ||
59 | |||
60 | if (z > 0) // add in non-zero amount | ||
61 | { | ||
62 | sum += map[x, y] * z; | ||
63 | step2 += z; | ||
64 | } | ||
65 | } | ||
66 | } | ||
67 | rz = sum / step2; | ||
68 | } | ||
69 | */ | ||
70 | |||
71 | |||
72 | // blend in map | 44 | // blend in map |
73 | for (x = 0; x < map.Width; x++) | 45 | for (x = 0; x < map.Width; x++) |
74 | { | 46 | { |
@@ -77,19 +49,28 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
77 | if (!mask[x,y]) | 49 | if (!mask[x,y]) |
78 | continue; | 50 | continue; |
79 | 51 | ||
80 | double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration; | 52 | double z; |
81 | 53 | if (duration < 4.0) | |
82 | if (z > 0) // add in non-zero amount | ||
83 | { | 54 | { |
84 | if (z > 1.0) | 55 | z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration * 0.25; |
85 | z = 1.0; | 56 | } |
86 | 57 | else { | |
87 | map[x, y] = (map[x, y] * (1.0 - z)) + (rz * z); | 58 | z = 1.0; |
88 | } | 59 | } |
89 | 60 | ||
90 | double delta = rz - map[x, y]; | 61 | double delta = rz - map[x, y]; |
91 | if (Math.Abs(delta) > 0.1) | 62 | if (Math.Abs(delta) > 0.1) |
92 | delta *= 0.25; | 63 | { |
64 | if (z > 1.0) | ||
65 | { | ||
66 | z = 1.0; | ||
67 | } | ||
68 | else if (z < 0.0) | ||
69 | { | ||
70 | z = 0.0; | ||
71 | } | ||
72 | delta *= z; | ||
73 | } | ||
93 | 74 | ||
94 | if (delta != 0) // add in non-zero amount | 75 | if (delta != 0) // add in non-zero amount |
95 | { | 76 | { |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 08b1830..4d01f22 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -299,7 +299,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
299 | /// <param name="agentId">UUID of script-owner</param> | 299 | /// <param name="agentId">UUID of script-owner</param> |
300 | public void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId) | 300 | public void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId) |
301 | { | 301 | { |
302 | client_OnModifyTerrain(user, (float)pos.Z, (float)0.25, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId); | 302 | float duration = 0.25f; |
303 | if (action == 0) | ||
304 | duration = 4.0f; | ||
305 | client_OnModifyTerrain(user, (float)pos.Z, duration, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId); | ||
303 | } | 306 | } |
304 | 307 | ||
305 | /// <summary> | 308 | /// <summary> |