diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs index 4834c86..0342962 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs | |||
@@ -34,23 +34,27 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
34 | { | 34 | { |
35 | #region ITerrainPaintableEffect Members | 35 | #region ITerrainPaintableEffect Members |
36 | 36 | ||
37 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, double strength, double duration) | 37 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, |
38 | double strength, double duration, int startX, int endX, int startY, int endY) | ||
38 | { | 39 | { |
39 | strength = TerrainUtil.MetersToSphericalStrength(strength); | 40 | strength = TerrainUtil.MetersToSphericalStrength(strength); |
40 | 41 | ||
41 | int x, y; | 42 | int x, y; |
42 | double[,] tweak = new double[map.Width,map.Height]; | 43 | double[,] tweak = new double[map.Width,map.Height]; |
43 | 44 | ||
44 | double area = strength; | 45 | double area = strength; |
45 | double step = strength / 4.0; | 46 | double step = strength / 4.0; |
46 | duration = 0.03; //MCP Should be read from ini file | 47 | duration = 0.03; //MCP Should be read from ini file |
47 | 48 | ||
48 | 49 | ||
49 | // compute delta map | 50 | // compute delta map |
50 | for (x = 0; x < map.Width; x++) | 51 | for (x = startX; x <= endX; x++) |
51 | { | 52 | { |
52 | for (y = 0; y < map.Height; y++) | 53 | for (y = startY; y <= endY; y++) |
53 | { | 54 | { |
55 | if (!mask[x, y]) | ||
56 | continue; | ||
57 | |||
54 | double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); | 58 | double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); |
55 | 59 | ||
56 | if (z > 0) // add in non-zero amount | 60 | if (z > 0) // add in non-zero amount |
@@ -73,11 +77,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
73 | } | 77 | } |
74 | } | 78 | } |
75 | // blend in map | 79 | // blend in map |
76 | for (x = 0; x < map.Width; x++) | 80 | for (x = startX; x <= endX; x++) |
77 | { | 81 | { |
78 | for (y = 0; y < map.Height; y++) | 82 | for (y = startY; y <= endY; y++) |
79 | { | 83 | { |
80 | if (!mask[x,y]) | 84 | if (!mask[x, y]) |
81 | continue; | 85 | continue; |
82 | 86 | ||
83 | double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); | 87 | double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); |