From 53e8d91c06b3fc5cf61ba767930fa733a6efb232 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 14 Mar 2008 13:37:39 +0000 Subject: * Fixed 'flatten area' brush, so it now has a 'force' instead of instantly flattening the selected area. * Noise, and Noise-Area brushes now use Perlin noise, more closely simulating the method LL uses officially. * TerrainModule has been cleaned up slightly. * TerrainUtil class has several new functions related to seeded noise generation. * Extracted ITerrainEffect, ITerrainFloodEffect, ITerrainLoader, ITerrainPaintableEffect, TerrainChannel to seperate files. --- .../Environment/Modules/Terrain/PaintBrushes/NoiseSphere.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Terrain/PaintBrushes') diff --git a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/NoiseSphere.cs b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/NoiseSphere.cs index 4a03a17..9754a99 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/NoiseSphere.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/NoiseSphere.cs @@ -57,15 +57,10 @@ namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes z *= z; z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry)); - double noise; - - lock (Util.RandomClass) - { - noise = Util.RandomClass.NextDouble(); - } + double noise = TerrainUtil.PerlinNoise2D((double)x / (double)Framework.Constants.RegionSize, (double)y / (double)Framework.Constants.RegionSize, 8, 1.0); if (z > 0.0) - map[x, y] += (noise - 0.5) * z * duration; + map[x, y] += noise * z * duration; } } } -- cgit v1.1