From b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 23 Jul 2007 05:29:52 +0000 Subject: * Major style changes in libTerrain.Channel - now uses .NET-style naming syntax. * Issue#218 - Updated mySQL region table. --- .../Channel/Manipulators/AerobicErosion.cs | 30 +++++++++++----------- .../Channel/Manipulators/HydraulicErosion.cs | 14 +++++----- .../Channel/Manipulators/ThermalWeathering.cs | 10 ++++---- 3 files changed, 27 insertions(+), 27 deletions(-) (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators') 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 /// The percentage of rock which can be picked up to pickup 0..1 /// The number of erosion rounds (recommended: 25+) /// Drop sediment at the lowest point? - public void AerobicErosion(double windspeed, double pickup_talus_minimum, double drop_talus_minimum, double carry, int rounds, bool lowest, bool usingFluidDynamics) + public void AerobicErosion(double windspeed, double pickupTalusMinimum, double dropTalusMinimum, double carry, int rounds, bool lowest, bool usingFluidDynamics) { Channel wind = new Channel(w, h) ; Channel sediment = new Channel(w, h); int x, y, i, j; - wind = this.copy(); - wind.normalise(); // Cheap wind calculations + wind = this.Copy(); + wind.Normalise(); // Cheap wind calculations wind *= windspeed; if (usingFluidDynamics) @@ -90,7 +90,7 @@ namespace libTerrain } else { - wind.pertubation(30); // Can do better later + wind.Pertubation(30); // Can do better later } for (i = 0; i < rounds; i++) @@ -100,13 +100,13 @@ namespace libTerrain { for (y = 1; y < h - 1; y++) { - double me = get(x, y); + double me = Get(x, y); double surfacearea = 0.3; // Everything will erode even if it's flat. Just slower. for (j = 0; j < 9; j++) { - int[] coords = neighbours(NEIGHBOURS.NEIGHBOUR_MOORE, j); - double target = get(x + coords[0], y + coords[1]); + int[] coords = Neighbours(NeighbourSystem.Moore, j); + double target = Get(x + coords[0], y + coords[1]); surfacearea += Math.Abs(target - me); } @@ -116,7 +116,7 @@ namespace libTerrain if (amount < 0) amount = 0; - if (surfacearea > pickup_talus_minimum) + if (surfacearea > pickupTalusMinimum) { this.map[x, y] -= amount; sediment.map[x, y] += amount; @@ -131,9 +131,9 @@ namespace libTerrain } else { - wind.pertubation(15); // Can do better later + wind.Pertubation(15); // Can do better later wind.seed++; - sediment.pertubation(10); // Sediment is blown around a bit + sediment.Pertubation(10); // Sediment is blown around a bit sediment.seed++; } @@ -142,15 +142,15 @@ namespace libTerrain { for (y = 1; y < h - 1; y++) { - double me = get(x, y); + double me = Get(x, y); double surfacearea = 0.01; // Flat land does not get deposition double min = double.MaxValue; int[] minside = new int[2]; for (j = 0; j < 9; j++) { - int[] coords = neighbours(NEIGHBOURS.NEIGHBOUR_MOORE, j); - double target = get(x + coords[0], y + coords[1]); + int[] coords = Neighbours(NeighbourSystem.Moore, j); + double target = Get(x + coords[0], y + coords[1]); surfacearea += Math.Abs(target - me); @@ -166,7 +166,7 @@ namespace libTerrain if (amount < 0) amount = 0; - if (surfacearea > drop_talus_minimum) + if (surfacearea > dropTalusMinimum) { this.map[x + minside[0], y + minside[1]] += amount; sediment.map[x, y] -= amount; @@ -178,7 +178,7 @@ namespace libTerrain Channel myself = this; myself += sediment; - myself.normalise(); + myself.Normalise(); } } } \ No newline at end of file diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/HydraulicErosion.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/HydraulicErosion.cs index e3463c1..5ace241 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/HydraulicErosion.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/HydraulicErosion.cs @@ -34,17 +34,17 @@ namespace libTerrain { partial class Channel { - public void hydraulicErosion(Channel rain, double evaporation, double solubility, int frequency, int rounds) + public void HydraulicErosion(Channel rain, double evaporation, double solubility, int frequency, int rounds) { Channel water = new Channel(w, h); Channel sediment = new Channel(w, h); Channel terrain = this; Channel waterFlow = new Channel(w, h); - NEIGHBOURS type = NEIGHBOURS.NEIGHBOUR_MOORE; + NeighbourSystem type = NeighbourSystem.Moore; int NEIGHBOUR_ME = 4; - int NEIGHBOUR_MAX = type == NEIGHBOURS.NEIGHBOUR_MOORE ? 9 : 5; + int NEIGHBOUR_MAX = type == NeighbourSystem.Moore ? 9 : 5; for (int i = 0; i < rounds; i++) { @@ -66,7 +66,7 @@ namespace libTerrain { if (j != NEIGHBOUR_ME) { - int[] coords = neighbours(type, j); + int[] coords = Neighbours(type, j); coords[0] += x; coords[1] += y; @@ -107,13 +107,13 @@ namespace libTerrain { if (j != NEIGHBOUR_ME) { - int[] coords = neighbours(type, j); + int[] coords = Neighbours(type, j); coords[0] += x; coords[1] += y; if (diffs[j] > 0) { - waterFlow.setWrap(coords[0], coords[1], waterFlow.map[coords[0], coords[1]] + diffs[j] * totalInverseDiff); + waterFlow.SetWrap(coords[0], coords[1], waterFlow.map[coords[0], coords[1]] + diffs[j] * totalInverseDiff); } } } @@ -121,7 +121,7 @@ namespace libTerrain } water += waterFlow; - waterFlow.fill(0); + waterFlow.Fill(0); water *= evaporation; diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/ThermalWeathering.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/ThermalWeathering.cs index 7514971..449bf85 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/ThermalWeathering.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/ThermalWeathering.cs @@ -40,7 +40,7 @@ namespace libTerrain /// The rock angle (represented as a dy/dx ratio) at which point it will be succeptible to breakage /// The number of erosion rounds /// The amount of rock to carry each round - public Channel thermalWeathering(double talus, int rounds, double c) + public Channel ThermalWeathering(double talus, int rounds, double c) { double[,] lastFrame; double[,] thisFrame; @@ -48,10 +48,10 @@ namespace libTerrain lastFrame = (double[,])map.Clone(); thisFrame = (double[,])map.Clone(); - NEIGHBOURS type = NEIGHBOURS.NEIGHBOUR_MOORE; // Using moore neighbourhood (twice as computationally expensive) + NeighbourSystem type = NeighbourSystem.Moore; // Using moore neighbourhood (twice as computationally expensive) int NEIGHBOUR_ME = 4; // I am always 4 in both systems. - int NEIGHBOUR_MAX = type == NEIGHBOURS.NEIGHBOUR_MOORE ? 9 : 5; + int NEIGHBOUR_MAX = type == NeighbourSystem.Moore ? 9 : 5; int frames = rounds; // Number of thermal erosion iterations to run int i, j; @@ -67,7 +67,7 @@ namespace libTerrain { if (j != NEIGHBOUR_ME) { - int[] coords = neighbours(type, j); + int[] coords = Neighbours(type, j); coords[0] += x; coords[1] += y; @@ -103,7 +103,7 @@ namespace libTerrain map = thisFrame; - normalise(); // Just to guaruntee a smooth 0..1 value + Normalise(); // Just to guaruntee a smooth 0..1 value return this; } } -- cgit v1.1