aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-03 20:00:35 +0000
committerAdam Frisby2008-05-03 20:00:35 +0000
commit87b313792821cb842fd54b568302b6877c4e53f8 (patch)
tree446719156d1e8d8c12bc3bcd69546f04ba0d79ab /OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs
parent* Refactor: Move MoveFolder() and PurgeFolder() into CachedUserInfo (which ar... (diff)
downloadopensim-SC_OLD-87b313792821cb842fd54b568302b6877c4e53f8.zip
opensim-SC_OLD-87b313792821cb842fd54b568302b6877c4e53f8.tar.gz
opensim-SC_OLD-87b313792821cb842fd54b568302b6877c4e53f8.tar.bz2
opensim-SC_OLD-87b313792821cb842fd54b568302b6877c4e53f8.tar.xz
* Cleaned up code in Terrain, Tree and Map modules.
* Fixed a bug with Terragen loader where it would do bad things on a non 256x256 sized terrain. Now loads the array correctly. * Moved MapImageModule.cs to Modules/World/WorldMap * Changed Location.RegionHandle to use Helpers.GetUlong instead of doing it ourselves.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs
index 8ae583e..0824efd 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs
@@ -39,13 +39,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
39 { 39 {
40 strength = TerrainUtil.MetersToSphericalStrength(strength); 40 strength = TerrainUtil.MetersToSphericalStrength(strength);
41 41
42 int x, y; 42 int x;
43 for (x = 0; x < map.Width; x++) 43 for (x = 0; x < map.Width; x++)
44 { 44 {
45 // Skip everything unlikely to be affected 45 // Skip everything unlikely to be affected
46 if (Math.Abs(x - rx) > strength * 1.1) 46 if (Math.Abs(x - rx) > strength * 1.1)
47 continue; 47 continue;
48 48
49 int y;
49 for (y = 0; y < map.Height; y++) 50 for (y = 0; y < map.Height; y++)
50 { 51 {
51 // Skip everything unlikely to be affected 52 // Skip everything unlikely to be affected
@@ -57,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
57 z *= z; 58 z *= z;
58 z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry)); 59 z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry));
59 60
60 double noise = TerrainUtil.PerlinNoise2D((double) x / (double) Constants.RegionSize, (double) y / (double) Constants.RegionSize, 8, 1.0); 61 double noise = TerrainUtil.PerlinNoise2D(x / (double) Constants.RegionSize, y / (double) Constants.RegionSize, 8, 1.0);
61 62
62 if (z > 0.0) 63 if (z > 0.0)
63 map[x, y] += noise * z * duration; 64 map[x, y] += noise * z * duration;