diff options
author | Justin Clarke Casey | 2008-10-07 14:49:12 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-07 14:49:12 +0000 |
commit | 48d86fb23f7ae0e7919274d67fc25f590e6845b1 (patch) | |
tree | efd239c7ccf4dd09a7c81fd06ebe6f1c5bf2c174 /OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/ErodeSphere.cs | |
parent | From: chris yeoh <yeohc@au1.ibm.com> (diff) | |
download | opensim-SC_OLD-48d86fb23f7ae0e7919274d67fc25f590e6845b1.zip opensim-SC_OLD-48d86fb23f7ae0e7919274d67fc25f590e6845b1.tar.gz opensim-SC_OLD-48d86fb23f7ae0e7919274d67fc25f590e6845b1.tar.bz2 opensim-SC_OLD-48d86fb23f7ae0e7919274d67fc25f590e6845b1.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=1207
* Implmements llModifyLand() and a check for the "Allow others to terraform flag"
* Thanks tglion!
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/ErodeSphere.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/ErodeSphere.cs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/ErodeSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/ErodeSphere.cs index dae4cf8..3fa3f8a 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/ErodeSphere.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/ErodeSphere.cs | |||
@@ -150,7 +150,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
150 | 150 | ||
151 | #region ITerrainPaintableEffect Members | 151 | #region ITerrainPaintableEffect Members |
152 | 152 | ||
153 | public void PaintEffect(ITerrainChannel map, double rx, double ry, double strength, double duration) | 153 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, double strength, double duration) |
154 | { | 154 | { |
155 | strength = TerrainUtil.MetersToSphericalStrength(strength); | 155 | strength = TerrainUtil.MetersToSphericalStrength(strength); |
156 | 156 | ||
@@ -173,10 +173,13 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
173 | { | 173 | { |
174 | for (y = 0; y < water.Height; y++) | 174 | for (y = 0; y < water.Height; y++) |
175 | { | 175 | { |
176 | const double solConst = (1.0 / rounds); | 176 | if (mask[x,y]) |
177 | double sedDelta = water[x, y] * solConst; | 177 | { |
178 | map[x, y] -= sedDelta; | 178 | const double solConst = (1.0 / rounds); |
179 | sediment[x, y] += sedDelta; | 179 | double sedDelta = water[x, y] * solConst; |
180 | map[x, y] -= sedDelta; | ||
181 | sediment[x, y] += sedDelta; | ||
182 | } | ||
180 | } | 183 | } |
181 | } | 184 | } |
182 | 185 | ||
@@ -292,8 +295,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
292 | double sedimentDeposit = sediment[x, y] - waterCapacity; | 295 | double sedimentDeposit = sediment[x, y] - waterCapacity; |
293 | if (sedimentDeposit > 0) | 296 | if (sedimentDeposit > 0) |
294 | { | 297 | { |
295 | sediment[x, y] -= sedimentDeposit; | 298 | if (mask[x,y]) |
296 | map[x, y] += sedimentDeposit; | 299 | { |
300 | sediment[x, y] -= sedimentDeposit; | ||
301 | map[x, y] += sedimentDeposit; | ||
302 | } | ||
297 | } | 303 | } |
298 | } | 304 | } |
299 | } | 305 | } |
@@ -302,10 +308,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
302 | // Deposit any remainder (should be minimal) | 308 | // Deposit any remainder (should be minimal) |
303 | for (x = 0; x < water.Width; x++) | 309 | for (x = 0; x < water.Width; x++) |
304 | for (y = 0; y < water.Height; y++) | 310 | for (y = 0; y < water.Height; y++) |
305 | if (sediment[x, y] > 0) | 311 | if (mask[x,y] && sediment[x, y] > 0) |
306 | map[x, y] += sediment[x, y]; | 312 | map[x, y] += sediment[x, y]; |
307 | } | 313 | } |
308 | 314 | ||
309 | #endregion | 315 | #endregion |
310 | } | 316 | } |
311 | } \ No newline at end of file | 317 | } |