aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Terrain
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/FloodBrushes/RaiseArea.cs60
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/RaiseSphere.cs82
2 files changed, 71 insertions, 71 deletions
diff --git a/OpenSim/Region/Environment/Modules/Terrain/FloodBrushes/RaiseArea.cs b/OpenSim/Region/Environment/Modules/Terrain/FloodBrushes/RaiseArea.cs
index ce83a4c..8fd957b 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/FloodBrushes/RaiseArea.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/FloodBrushes/RaiseArea.cs
@@ -1,30 +1,30 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenSim.Region.Environment.Modules.Terrain; 4using OpenSim.Region.Environment.Modules.Terrain;
5using OpenSim.Region.Environment.Interfaces; 5using OpenSim.Region.Environment.Interfaces;
6 6
7namespace OpenSim.Region.Environment.Modules.Terrain.FloodBrushes 7namespace OpenSim.Region.Environment.Modules.Terrain.FloodBrushes
8{ 8{
9 class RaiseArea : ITerrainFloodEffect 9 class RaiseArea : ITerrainFloodEffect
10 { 10 {
11 #region ITerrainFloodEffect Members 11 #region ITerrainFloodEffect Members
12 12
13 public void FloodEffect(ITerrainChannel map, bool[,] fillArea, double strength) 13 public void FloodEffect(ITerrainChannel map, bool[,] fillArea, double strength)
14 { 14 {
15 int x, y; 15 int x, y;
16 for (x = 0; x < map.Width; x++) 16 for (x = 0; x < map.Width; x++)
17 { 17 {
18 for (y = 0; y < map.Height; y++) 18 for (y = 0; y < map.Height; y++)
19 { 19 {
20 if (fillArea[x, y] == true) 20 if (fillArea[x, y] == true)
21 { 21 {
22 map[x, y] += strength; 22 map[x, y] += strength;
23 } 23 }
24 } 24 }
25 } 25 }
26 } 26 }
27 27
28 #endregion 28 #endregion
29 } 29 }
30} 30}
diff --git a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/RaiseSphere.cs b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/RaiseSphere.cs
index cf95f3f..be4a0b7 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/RaiseSphere.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/RaiseSphere.cs
@@ -1,41 +1,41 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenSim.Region.Environment.Modules.Terrain; 4using OpenSim.Region.Environment.Modules.Terrain;
5using OpenSim.Region.Environment.Interfaces; 5using OpenSim.Region.Environment.Interfaces;
6 6
7namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes 7namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes
8{ 8{
9 class RaiseSphere : ITerrainPaintableEffect 9 class RaiseSphere : ITerrainPaintableEffect
10 { 10 {
11 #region ITerrainPaintableEffect Members 11 #region ITerrainPaintableEffect Members
12 12
13 public void PaintEffect(ITerrainChannel map, double rx, double ry, double strength) 13 public void PaintEffect(ITerrainChannel map, double rx, double ry, double strength)
14 { 14 {
15 int x, y; 15 int x, y;
16 for (x = 0; x < map.Width; x++) 16 for (x = 0; x < map.Width; x++)
17 { 17 {
18 // Skip everything unlikely to be affected 18 // Skip everything unlikely to be affected
19 if (Math.Abs(x - rx) > strength * 1.1) 19 if (Math.Abs(x - rx) > strength * 1.1)
20 continue; 20 continue;
21 21
22 for (y = 0; y < map.Height; y++) 22 for (y = 0; y < map.Height; y++)
23 { 23 {
24 // Skip everything unlikely to be affected 24 // Skip everything unlikely to be affected
25 if (Math.Abs(y - ry) > strength * 1.1) 25 if (Math.Abs(y - ry) > strength * 1.1)
26 continue; 26 continue;
27 27
28 // Calculate a sphere and add it to the heighmap 28 // Calculate a sphere and add it to the heighmap
29 double z = strength; 29 double z = strength;
30 z *= z; 30 z *= z;
31 z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry)); 31 z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry));
32 32
33 if (z > 0.0) 33 if (z > 0.0)
34 map[x, y] += z; 34 map[x, y] += z;
35 } 35 }
36 } 36 }
37 } 37 }
38 38
39 #endregion 39 #endregion
40 } 40 }
41} 41}