diff options
author | Adam Frisby | 2007-07-23 05:29:52 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-23 05:29:52 +0000 |
commit | b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb (patch) | |
tree | de4466ffdf017e140ec3aca9bb52cbe14e5e5b12 /OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators | |
parent | Couple of small changes (diff) | |
download | opensim-SC_OLD-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.zip opensim-SC_OLD-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.gz opensim-SC_OLD-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.bz2 opensim-SC_OLD-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.xz |
* Major style changes in libTerrain.Channel - now uses .NET-style naming syntax.
* Issue#218 - Updated mySQL region table.
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators')
7 files changed, 35 insertions, 35 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs index 24a8fc4..b585caa 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs | |||
@@ -42,7 +42,7 @@ namespace libTerrain | |||
42 | /// <param name="w"></param> | 42 | /// <param name="w"></param> |
43 | /// <param name="h"></param> | 43 | /// <param name="h"></param> |
44 | /// <returns></returns> | 44 | /// <returns></returns> |
45 | private int[] radialEdge256(int val) | 45 | private int[] RadialEdge256(int val) |
46 | { | 46 | { |
47 | // Four cases: | 47 | // Four cases: |
48 | // 1. 000..255 return 0,val | 48 | // 1. 000..255 return 0,val |
@@ -79,7 +79,7 @@ namespace libTerrain | |||
79 | 79 | ||
80 | throw new Exception("Out of bounds parameter (val)"); | 80 | throw new Exception("Out of bounds parameter (val)"); |
81 | } | 81 | } |
82 | public void fracture(int number, double scalemin, double scalemax) | 82 | public void Fracture(int number, double scalemin, double scalemax) |
83 | { | 83 | { |
84 | Random rand = new Random(seed); | 84 | Random rand = new Random(seed); |
85 | 85 | ||
@@ -87,8 +87,8 @@ namespace libTerrain | |||
87 | { | 87 | { |
88 | int[] a, b; | 88 | int[] a, b; |
89 | 89 | ||
90 | a = radialEdge256(rand.Next(1023)); // TODO: Broken | 90 | a = RadialEdge256(rand.Next(1023)); // TODO: Broken |
91 | b = radialEdge256(rand.Next(1023)); // TODO: Broken | 91 | b = RadialEdge256(rand.Next(1023)); // TODO: Broken |
92 | double z = rand.NextDouble(); | 92 | double z = rand.NextDouble(); |
93 | 93 | ||
94 | for (int x = 0; x < w; x++) | 94 | for (int x = 0; x < w; x++) |
@@ -104,7 +104,7 @@ namespace libTerrain | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | } | 106 | } |
107 | normalise(); | 107 | Normalise(); |
108 | } | 108 | } |
109 | } | 109 | } |
110 | } \ No newline at end of file | 110 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Gradient.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Gradient.cs index c2ad882..0c9b3c3 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Gradient.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Gradient.cs | |||
@@ -35,7 +35,7 @@ namespace libTerrain | |||
35 | partial class Channel | 35 | partial class Channel |
36 | { | 36 | { |
37 | 37 | ||
38 | public void gradientCube() | 38 | public void GradientCube() |
39 | { | 39 | { |
40 | int x, y; | 40 | int x, y; |
41 | for (x = 0; x < w; x++) | 41 | for (x = 0; x < w; x++) |
@@ -45,10 +45,10 @@ namespace libTerrain | |||
45 | map[x, y] = x*y; | 45 | map[x, y] = x*y; |
46 | } | 46 | } |
47 | } | 47 | } |
48 | normalise(); | 48 | Normalise(); |
49 | } | 49 | } |
50 | 50 | ||
51 | public void gradientStripe() | 51 | public void GradientStripe() |
52 | { | 52 | { |
53 | int x, y; | 53 | int x, y; |
54 | for (x = 0; x < w; x++) | 54 | for (x = 0; x < w; x++) |
@@ -58,7 +58,7 @@ namespace libTerrain | |||
58 | map[x, y] = x; | 58 | map[x, y] = x; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | normalise(); | 61 | Normalise(); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | } \ No newline at end of file | 64 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/HillPlanter.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/HillPlanter.cs index e8a660f..3b8e963 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/HillPlanter.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/HillPlanter.cs | |||
@@ -44,7 +44,7 @@ namespace libTerrain | |||
44 | /// <param name="island">Whether to bias hills towards the center of the map</param> | 44 | /// <param name="island">Whether to bias hills towards the center of the map</param> |
45 | /// <param name="additive">Whether to add hills together or to pick the largest value</param> | 45 | /// <param name="additive">Whether to add hills together or to pick the largest value</param> |
46 | /// <param name="noisy">Generates hill-shaped noise instead of consistent hills</param> | 46 | /// <param name="noisy">Generates hill-shaped noise instead of consistent hills</param> |
47 | public void hillsSpheres(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) | 47 | public void HillsSpheres(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) |
48 | { | 48 | { |
49 | Random random = new Random(seed); | 49 | Random random = new Random(seed); |
50 | 50 | ||
@@ -95,7 +95,7 @@ namespace libTerrain | |||
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | normalise(); | 98 | Normalise(); |
99 | } | 99 | } |
100 | 100 | ||
101 | /// <summary> | 101 | /// <summary> |
@@ -108,7 +108,7 @@ namespace libTerrain | |||
108 | /// <param name="island">Whether to bias hills towards the center of the map</param> | 108 | /// <param name="island">Whether to bias hills towards the center of the map</param> |
109 | /// <param name="additive">Whether to add hills together or to pick the largest value</param> | 109 | /// <param name="additive">Whether to add hills together or to pick the largest value</param> |
110 | /// <param name="noisy">Generates hill-shaped noise instead of consistent hills</param> | 110 | /// <param name="noisy">Generates hill-shaped noise instead of consistent hills</param> |
111 | public void hillsCones(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) | 111 | public void HillsCones(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) |
112 | { | 112 | { |
113 | Random random = new Random(seed); | 113 | Random random = new Random(seed); |
114 | 114 | ||
@@ -158,10 +158,10 @@ namespace libTerrain | |||
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | normalise(); | 161 | Normalise(); |
162 | } | 162 | } |
163 | 163 | ||
164 | public void hillsBlocks(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) | 164 | public void HillsBlocks(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) |
165 | { | 165 | { |
166 | Random random = new Random(seed); | 166 | Random random = new Random(seed); |
167 | 167 | ||
@@ -212,10 +212,10 @@ namespace libTerrain | |||
212 | } | 212 | } |
213 | } | 213 | } |
214 | 214 | ||
215 | normalise(); | 215 | Normalise(); |
216 | } | 216 | } |
217 | 217 | ||
218 | public void hillsSquared(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) | 218 | public void HillsSquared(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) |
219 | { | 219 | { |
220 | Random random = new Random(seed); | 220 | Random random = new Random(seed); |
221 | 221 | ||
@@ -268,7 +268,7 @@ namespace libTerrain | |||
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | normalise(); | 271 | Normalise(); |
272 | } | 272 | } |
273 | 273 | ||
274 | } | 274 | } |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Noise.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Noise.cs index e95fb2e..ebb1771 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Noise.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Noise.cs | |||
@@ -38,7 +38,7 @@ namespace libTerrain | |||
38 | /// Fills a channel with 0..1 noise | 38 | /// Fills a channel with 0..1 noise |
39 | /// </summary> | 39 | /// </summary> |
40 | /// <remarks>3-Clause BSD Licensed</remarks> | 40 | /// <remarks>3-Clause BSD Licensed</remarks> |
41 | public void noise() | 41 | public void Noise() |
42 | { | 42 | { |
43 | Random rand = new Random(seed); | 43 | Random rand = new Random(seed); |
44 | int x, y; | 44 | int x, y; |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Spiral.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Spiral.cs index 04ac283..aeff730 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Spiral.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Spiral.cs | |||
@@ -34,7 +34,7 @@ namespace libTerrain | |||
34 | { | 34 | { |
35 | partial class Channel | 35 | partial class Channel |
36 | { | 36 | { |
37 | private double[] coordinatesToPolar(int x, int y) | 37 | private double[] CoordinatesToPolar(int x, int y) |
38 | { | 38 | { |
39 | 39 | ||
40 | double theta = Math.Atan2(x - (w / 2), y - (h / 2)); | 40 | double theta = Math.Atan2(x - (w / 2), y - (h / 2)); |
@@ -48,7 +48,7 @@ namespace libTerrain | |||
48 | return coords; | 48 | return coords; |
49 | } | 49 | } |
50 | 50 | ||
51 | public int[] polarToCoordinates(double r, double theta) { | 51 | public int[] PolarToCoordinates(double r, double theta) { |
52 | double nx; | 52 | double nx; |
53 | double ny; | 53 | double ny; |
54 | 54 | ||
@@ -78,14 +78,14 @@ namespace libTerrain | |||
78 | 78 | ||
79 | public void Polar() | 79 | public void Polar() |
80 | { | 80 | { |
81 | Channel n = this.copy(); | 81 | Channel n = this.Copy(); |
82 | 82 | ||
83 | int x, y; | 83 | int x, y; |
84 | for (x = 0; x < w; x++) | 84 | for (x = 0; x < w; x++) |
85 | { | 85 | { |
86 | for (y = 0; y < h; y++) | 86 | for (y = 0; y < h; y++) |
87 | { | 87 | { |
88 | double[] coords = coordinatesToPolar(x,y); | 88 | double[] coords = CoordinatesToPolar(x,y); |
89 | 89 | ||
90 | coords[0] += w / 2.0; | 90 | coords[0] += w / 2.0; |
91 | coords[1] += h / 2.0; | 91 | coords[1] += h / 2.0; |
@@ -105,8 +105,8 @@ namespace libTerrain | |||
105 | r += incRadius; | 105 | r += incRadius; |
106 | theta += incAngle; | 106 | theta += incAngle; |
107 | 107 | ||
108 | int[] coords = polarToCoordinates(r,theta); | 108 | int[] coords = PolarToCoordinates(r,theta); |
109 | raise(coords[0], coords[1], 20, 1); | 109 | Raise(coords[0], coords[1], 20, 1); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
@@ -122,11 +122,11 @@ namespace libTerrain | |||
122 | r += incRadius; | 122 | r += incRadius; |
123 | theta += incAngle; | 123 | theta += incAngle; |
124 | 124 | ||
125 | int[] coords = polarToCoordinates(r, theta); | 125 | int[] coords = PolarToCoordinates(r, theta); |
126 | points.Add(new Point2D(coords[0],coords[1])); | 126 | points.Add(new Point2D(coords[0],coords[1])); |
127 | } | 127 | } |
128 | 128 | ||
129 | voronoiDiagram(points, c); | 129 | VoronoiDiagram(points, c); |
130 | } | 130 | } |
131 | 131 | ||
132 | public void Spiral(double wid, double hig, double offset) | 132 | public void Spiral(double wid, double hig, double offset) |
@@ -143,7 +143,7 @@ namespace libTerrain | |||
143 | map[x, y] += Math.Sin(dx / wid) + Math.Cos(dy / hig); | 143 | map[x, y] += Math.Sin(dx / wid) + Math.Cos(dy / hig); |
144 | } | 144 | } |
145 | } | 145 | } |
146 | normalise(); | 146 | Normalise(); |
147 | } | 147 | } |
148 | } | 148 | } |
149 | } \ No newline at end of file | 149 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Voronoi.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Voronoi.cs index fdd369b..e973d14 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Voronoi.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Voronoi.cs | |||
@@ -42,7 +42,7 @@ namespace libTerrain | |||
42 | /// <param name="blockSize">A multiple of the channel width and height which will have voronoi points generated in it. | 42 | /// <param name="blockSize">A multiple of the channel width and height which will have voronoi points generated in it. |
43 | /// <para>This is to ensure a more even distribution of the points than pure random allocation.</para></param> | 43 | /// <para>This is to ensure a more even distribution of the points than pure random allocation.</para></param> |
44 | /// <param name="c">The Voronoi diagram type. Usually an array with values consisting of [-1,1]. Experiment with the chain, you can have as many values as you like.</param> | 44 | /// <param name="c">The Voronoi diagram type. Usually an array with values consisting of [-1,1]. Experiment with the chain, you can have as many values as you like.</param> |
45 | public void voronoiDiagram(int pointsPerBlock, int blockSize, double[] c) | 45 | public void VoronoiDiagram(int pointsPerBlock, int blockSize, double[] c) |
46 | { | 46 | { |
47 | List<Point2D> points = new List<Point2D>(); | 47 | List<Point2D> points = new List<Point2D>(); |
48 | Random generator = new Random(seed); | 48 | Random generator = new Random(seed); |
@@ -98,10 +98,10 @@ namespace libTerrain | |||
98 | } | 98 | } |
99 | 99 | ||
100 | // Normalise the result | 100 | // Normalise the result |
101 | normalise(); | 101 | Normalise(); |
102 | } | 102 | } |
103 | 103 | ||
104 | public void voronoiDiagram(List<Point2D> points, double[] c) | 104 | public void VoronoiDiagram(List<Point2D> points, double[] c) |
105 | { | 105 | { |
106 | 106 | ||
107 | Random generator = new Random(seed); | 107 | Random generator = new Random(seed); |
@@ -141,10 +141,10 @@ namespace libTerrain | |||
141 | } | 141 | } |
142 | 142 | ||
143 | // Normalise the result | 143 | // Normalise the result |
144 | normalise(); | 144 | Normalise(); |
145 | } | 145 | } |
146 | 146 | ||
147 | public void voroflatDiagram(int pointsPerBlock, int blockSize) | 147 | public void VoroflatDiagram(int pointsPerBlock, int blockSize) |
148 | { | 148 | { |
149 | List<Point2D> points = new List<Point2D>(); | 149 | List<Point2D> points = new List<Point2D>(); |
150 | Random generator = new Random(seed); | 150 | Random generator = new Random(seed); |
@@ -203,7 +203,7 @@ namespace libTerrain | |||
203 | } | 203 | } |
204 | 204 | ||
205 | // Normalise the result | 205 | // Normalise the result |
206 | normalise(); | 206 | Normalise(); |
207 | } | 207 | } |
208 | } | 208 | } |
209 | } | 209 | } |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Worms.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Worms.cs index 38c8001..38a8023 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Worms.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Worms.cs | |||
@@ -42,7 +42,7 @@ namespace libTerrain | |||
42 | /// <param name="movement">The maximum distance each worm will move each step</param> | 42 | /// <param name="movement">The maximum distance each worm will move each step</param> |
43 | /// <param name="size">The size of the area around the worm modified</param> | 43 | /// <param name="size">The size of the area around the worm modified</param> |
44 | /// <param name="centerspawn">Do worms start in the middle, or randomly?</param> | 44 | /// <param name="centerspawn">Do worms start in the middle, or randomly?</param> |
45 | public void worms(int number, int rounds, double movement, double size, bool centerspawn) | 45 | public void Worms(int number, int rounds, double movement, double size, bool centerspawn) |
46 | { | 46 | { |
47 | Random random = new Random(seed); | 47 | Random random = new Random(seed); |
48 | int i, j; | 48 | int i, j; |
@@ -64,7 +64,7 @@ namespace libTerrain | |||
64 | { | 64 | { |
65 | rx += (random.NextDouble() * movement) - (movement / 2.0); | 65 | rx += (random.NextDouble() * movement) - (movement / 2.0); |
66 | ry += (random.NextDouble() * movement) - (movement / 2.0); | 66 | ry += (random.NextDouble() * movement) - (movement / 2.0); |
67 | raise(rx, ry, size, 1.0); | 67 | Raise(rx, ry, size, 1.0); |
68 | } | 68 | } |
69 | } | 69 | } |
70 | } | 70 | } |