aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs
index 97c2762..198c337 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs
@@ -74,14 +74,14 @@ namespace libTerrain
74 /// <param name="carry">The percentage of rock which can be picked up to pickup 0..1</param> 74 /// <param name="carry">The percentage of rock which can be picked up to pickup 0..1</param>
75 /// <param name="rounds">The number of erosion rounds (recommended: 25+)</param> 75 /// <param name="rounds">The number of erosion rounds (recommended: 25+)</param>
76 /// <param name="lowest">Drop sediment at the lowest point?</param> 76 /// <param name="lowest">Drop sediment at the lowest point?</param>
77 public void AerobicErosion(double windspeed, double pickup_talus_minimum, double drop_talus_minimum, double carry, int rounds, bool lowest, bool usingFluidDynamics) 77 public void AerobicErosion(double windspeed, double pickupTalusMinimum, double dropTalusMinimum, double carry, int rounds, bool lowest, bool usingFluidDynamics)
78 { 78 {
79 Channel wind = new Channel(w, h) ; 79 Channel wind = new Channel(w, h) ;
80 Channel sediment = new Channel(w, h); 80 Channel sediment = new Channel(w, h);
81 int x, y, i, j; 81 int x, y, i, j;
82 82
83 wind = this.copy(); 83 wind = this.Copy();
84 wind.normalise(); // Cheap wind calculations 84 wind.Normalise(); // Cheap wind calculations
85 wind *= windspeed; 85 wind *= windspeed;
86 86
87 if (usingFluidDynamics) 87 if (usingFluidDynamics)
@@ -90,7 +90,7 @@ namespace libTerrain
90 } 90 }
91 else 91 else
92 { 92 {
93 wind.pertubation(30); // Can do better later 93 wind.Pertubation(30); // Can do better later
94 } 94 }
95 95
96 for (i = 0; i < rounds; i++) 96 for (i = 0; i < rounds; i++)
@@ -100,13 +100,13 @@ namespace libTerrain
100 { 100 {
101 for (y = 1; y < h - 1; y++) 101 for (y = 1; y < h - 1; y++)
102 { 102 {
103 double me = get(x, y); 103 double me = Get(x, y);
104 double surfacearea = 0.3; // Everything will erode even if it's flat. Just slower. 104 double surfacearea = 0.3; // Everything will erode even if it's flat. Just slower.
105 105
106 for (j = 0; j < 9; j++) 106 for (j = 0; j < 9; j++)
107 { 107 {
108 int[] coords = neighbours(NEIGHBOURS.NEIGHBOUR_MOORE, j); 108 int[] coords = Neighbours(NeighbourSystem.Moore, j);
109 double target = get(x + coords[0], y + coords[1]); 109 double target = Get(x + coords[0], y + coords[1]);
110 110
111 surfacearea += Math.Abs(target - me); 111 surfacearea += Math.Abs(target - me);
112 } 112 }
@@ -116,7 +116,7 @@ namespace libTerrain
116 if (amount < 0) 116 if (amount < 0)
117 amount = 0; 117 amount = 0;
118 118
119 if (surfacearea > pickup_talus_minimum) 119 if (surfacearea > pickupTalusMinimum)
120 { 120 {
121 this.map[x, y] -= amount; 121 this.map[x, y] -= amount;
122 sediment.map[x, y] += amount; 122 sediment.map[x, y] += amount;
@@ -131,9 +131,9 @@ namespace libTerrain
131 } 131 }
132 else 132 else
133 { 133 {
134 wind.pertubation(15); // Can do better later 134 wind.Pertubation(15); // Can do better later
135 wind.seed++; 135 wind.seed++;
136 sediment.pertubation(10); // Sediment is blown around a bit 136 sediment.Pertubation(10); // Sediment is blown around a bit
137 sediment.seed++; 137 sediment.seed++;
138 } 138 }
139 139
@@ -142,15 +142,15 @@ namespace libTerrain
142 { 142 {
143 for (y = 1; y < h - 1; y++) 143 for (y = 1; y < h - 1; y++)
144 { 144 {
145 double me = get(x, y); 145 double me = Get(x, y);
146 double surfacearea = 0.01; // Flat land does not get deposition 146 double surfacearea = 0.01; // Flat land does not get deposition
147 double min = double.MaxValue; 147 double min = double.MaxValue;
148 int[] minside = new int[2]; 148 int[] minside = new int[2];
149 149
150 for (j = 0; j < 9; j++) 150 for (j = 0; j < 9; j++)
151 { 151 {
152 int[] coords = neighbours(NEIGHBOURS.NEIGHBOUR_MOORE, j); 152 int[] coords = Neighbours(NeighbourSystem.Moore, j);
153 double target = get(x + coords[0], y + coords[1]); 153 double target = Get(x + coords[0], y + coords[1]);
154 154
155 surfacearea += Math.Abs(target - me); 155 surfacearea += Math.Abs(target - me);
156 156
@@ -166,7 +166,7 @@ namespace libTerrain
166 if (amount < 0) 166 if (amount < 0)
167 amount = 0; 167 amount = 0;
168 168
169 if (surfacearea > drop_talus_minimum) 169 if (surfacearea > dropTalusMinimum)
170 { 170 {
171 this.map[x + minside[0], y + minside[1]] += amount; 171 this.map[x + minside[0], y + minside[1]] += amount;
172 sediment.map[x, y] -= amount; 172 sediment.map[x, y] -= amount;
@@ -178,7 +178,7 @@ namespace libTerrain
178 178
179 Channel myself = this; 179 Channel myself = this;
180 myself += sediment; 180 myself += sediment;
181 myself.normalise(); 181 myself.Normalise();
182 } 182 }
183 } 183 }
184} \ No newline at end of file 184} \ No newline at end of file