diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs | |
parent | * Deleted .user file (diff) | |
download | opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs index ca93c25..c8584e8 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs | |||
@@ -27,8 +27,6 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | 30 | ||
33 | namespace libTerrain | 31 | namespace libTerrain |
34 | { | 32 | { |
@@ -74,17 +72,18 @@ namespace libTerrain | |||
74 | /// <param name="carry">The percentage of rock which can be picked up to pickup 0..1</param> | 72 | /// <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> | 73 | /// <param name="rounds">The number of erosion rounds (recommended: 25+)</param> |
76 | /// <param name="lowest">Drop sediment at the lowest point?</param> | 74 | /// <param name="lowest">Drop sediment at the lowest point?</param> |
77 | public void AerobicErosion(double windspeed, double pickupTalusMinimum, double dropTalusMinimum, double carry, int rounds, bool lowest, bool usingFluidDynamics) | 75 | public void AerobicErosion(double windspeed, double pickupTalusMinimum, double dropTalusMinimum, double carry, |
76 | int rounds, bool lowest, bool usingFluidDynamics) | ||
78 | { | 77 | { |
79 | bool debugImages = false; | 78 | bool debugImages = false; |
80 | 79 | ||
81 | Channel wind = new Channel(w, h) ; | 80 | Channel wind = new Channel(w, h); |
82 | Channel sediment = new Channel(w, h); | 81 | Channel sediment = new Channel(w, h); |
83 | int x, y, i, j; | 82 | int x, y, i, j; |
84 | 83 | ||
85 | this.Normalise(); | 84 | Normalise(); |
86 | 85 | ||
87 | wind = this.Copy(); | 86 | wind = Copy(); |
88 | wind.Noise(); | 87 | wind.Noise(); |
89 | 88 | ||
90 | if (debugImages) | 89 | if (debugImages) |
@@ -120,7 +119,7 @@ namespace libTerrain | |||
120 | surfacearea += Math.Abs(target - me); | 119 | surfacearea += Math.Abs(target - me); |
121 | } | 120 | } |
122 | 121 | ||
123 | double amount = surfacearea * wind.map[x, y] * carry; | 122 | double amount = surfacearea*wind.map[x, y]*carry; |
124 | 123 | ||
125 | if (amount < 0) | 124 | if (amount < 0) |
126 | amount = 0; | 125 | amount = 0; |
@@ -147,7 +146,7 @@ namespace libTerrain | |||
147 | } | 146 | } |
148 | else | 147 | else |
149 | { | 148 | { |
150 | wind.Pertubation(15); // Can do better later | 149 | wind.Pertubation(15); // Can do better later |
151 | wind.seed++; | 150 | wind.seed++; |
152 | sediment.Pertubation(10); // Sediment is blown around a bit | 151 | sediment.Pertubation(10); // Sediment is blown around a bit |
153 | sediment.seed++; | 152 | sediment.seed++; |
@@ -175,12 +174,12 @@ namespace libTerrain | |||
175 | 174 | ||
176 | if (target < min && lowest) | 175 | if (target < min && lowest) |
177 | { | 176 | { |
178 | minside = (int[])coords.Clone(); | 177 | minside = (int[]) coords.Clone(); |
179 | min = target; | 178 | min = target; |
180 | } | 179 | } |
181 | } | 180 | } |
182 | 181 | ||
183 | double amount = surfacearea * (1.0 - wind.map[x, y]) * carry; | 182 | double amount = surfacearea*(1.0 - wind.map[x, y])*carry; |
184 | 183 | ||
185 | if (amount < 0) | 184 | if (amount < 0) |
186 | amount = 0; | 185 | amount = 0; |
@@ -199,7 +198,7 @@ namespace libTerrain | |||
199 | wind.Normalise(); | 198 | wind.Normalise(); |
200 | wind *= windspeed; | 199 | wind *= windspeed; |
201 | 200 | ||
202 | this.Normalise(); | 201 | Normalise(); |
203 | } | 202 | } |
204 | 203 | ||
205 | Channel myself = this; | 204 | Channel myself = this; |
@@ -207,7 +206,7 @@ namespace libTerrain | |||
207 | myself.Normalise(); | 206 | myself.Normalise(); |
208 | 207 | ||
209 | if (debugImages) | 208 | if (debugImages) |
210 | this.SaveImage("testimg/output.png"); | 209 | SaveImage("testimg/output.png"); |
211 | } | 210 | } |
212 | } | 211 | } |
213 | } \ No newline at end of file | 212 | } \ No newline at end of file |