diff options
author | Adam Frisby | 2007-07-24 05:22:33 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-24 05:22:33 +0000 |
commit | d8997b59d30b63218f594d840d924a10287ce509 (patch) | |
tree | f96960b2605c8da0d6b0a0d9a905db28a62fca67 /OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators | |
parent | * Terrain Fracture Generator now produces more appropriate results. (diff) | |
download | opensim-SC_OLD-d8997b59d30b63218f594d840d924a10287ce509.zip opensim-SC_OLD-d8997b59d30b63218f594d840d924a10287ce509.tar.gz opensim-SC_OLD-d8997b59d30b63218f594d840d924a10287ce509.tar.bz2 opensim-SC_OLD-d8997b59d30b63218f594d840d924a10287ce509.tar.xz |
* Terrain should now send just updated patches.
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators')
7 files changed, 30 insertions, 2 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs index 8427eab..13dd1bc 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs | |||
@@ -82,6 +82,8 @@ namespace libTerrain | |||
82 | 82 | ||
83 | public void Fracture(int number, double scalemin, double scalemax) | 83 | public void Fracture(int number, double scalemin, double scalemax) |
84 | { | 84 | { |
85 | SetDiff(); | ||
86 | |||
85 | Random rand = new Random(seed); | 87 | Random rand = new Random(seed); |
86 | 88 | ||
87 | for (int i = 0; i < number; i++) | 89 | for (int i = 0; i < number; i++) |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Gradient.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Gradient.cs index 0c9b3c3..47b7a66 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Gradient.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Gradient.cs | |||
@@ -37,6 +37,8 @@ namespace libTerrain | |||
37 | 37 | ||
38 | public void GradientCube() | 38 | public void GradientCube() |
39 | { | 39 | { |
40 | SetDiff(); | ||
41 | |||
40 | int x, y; | 42 | int x, y; |
41 | for (x = 0; x < w; x++) | 43 | for (x = 0; x < w; x++) |
42 | { | 44 | { |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/HillPlanter.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/HillPlanter.cs index 3b8e963..5a697b1 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/HillPlanter.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/HillPlanter.cs | |||
@@ -46,6 +46,8 @@ namespace libTerrain | |||
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 | SetDiff(); | ||
50 | |||
49 | Random random = new Random(seed); | 51 | Random random = new Random(seed); |
50 | 52 | ||
51 | int x, y; | 53 | int x, y; |
@@ -110,6 +112,8 @@ namespace libTerrain | |||
110 | /// <param name="noisy">Generates hill-shaped noise instead of consistent hills</param> | 112 | /// <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) | 113 | public void HillsCones(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) |
112 | { | 114 | { |
115 | SetDiff(); | ||
116 | |||
113 | Random random = new Random(seed); | 117 | Random random = new Random(seed); |
114 | 118 | ||
115 | int x, y; | 119 | int x, y; |
@@ -163,6 +167,8 @@ namespace libTerrain | |||
163 | 167 | ||
164 | public void HillsBlocks(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) | 168 | public void HillsBlocks(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) |
165 | { | 169 | { |
170 | SetDiff(); | ||
171 | |||
166 | Random random = new Random(seed); | 172 | Random random = new Random(seed); |
167 | 173 | ||
168 | int x, y; | 174 | int x, y; |
@@ -217,6 +223,8 @@ namespace libTerrain | |||
217 | 223 | ||
218 | public void HillsSquared(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) | 224 | public void HillsSquared(int number, double scale_min, double scale_range, bool island, bool additive, bool noisy) |
219 | { | 225 | { |
226 | SetDiff(); | ||
227 | |||
220 | Random random = new Random(seed); | 228 | Random random = new Random(seed); |
221 | 229 | ||
222 | int x, y; | 230 | int x, y; |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Noise.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Noise.cs index ebb1771..3cefcfe 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Noise.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Noise.cs | |||
@@ -40,6 +40,8 @@ namespace libTerrain | |||
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 | SetDiff(); | ||
44 | |||
43 | Random rand = new Random(seed); | 45 | Random rand = new Random(seed); |
44 | int x, y; | 46 | int x, y; |
45 | for (x = 0; x < w; x++) | 47 | for (x = 0; x < w; x++) |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Spiral.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Spiral.cs index aeff730..80abfe5 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Spiral.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Spiral.cs | |||
@@ -36,7 +36,6 @@ namespace libTerrain | |||
36 | { | 36 | { |
37 | private double[] CoordinatesToPolar(int x, int y) | 37 | private double[] CoordinatesToPolar(int x, int y) |
38 | { | 38 | { |
39 | |||
40 | double theta = Math.Atan2(x - (w / 2), y - (h / 2)); | 39 | double theta = Math.Atan2(x - (w / 2), y - (h / 2)); |
41 | double rx = (double)x - ((double)w / 2); | 40 | double rx = (double)x - ((double)w / 2); |
42 | double ry = (double)y - ((double)h / 2); | 41 | double ry = (double)y - ((double)h / 2); |
@@ -78,6 +77,8 @@ namespace libTerrain | |||
78 | 77 | ||
79 | public void Polar() | 78 | public void Polar() |
80 | { | 79 | { |
80 | SetDiff(); | ||
81 | |||
81 | Channel n = this.Copy(); | 82 | Channel n = this.Copy(); |
82 | 83 | ||
83 | int x, y; | 84 | int x, y; |
@@ -97,6 +98,8 @@ namespace libTerrain | |||
97 | 98 | ||
98 | public void SpiralPlanter(int steps, double incAngle, double incRadius, double offsetRadius, double offsetAngle) | 99 | public void SpiralPlanter(int steps, double incAngle, double incRadius, double offsetRadius, double offsetAngle) |
99 | { | 100 | { |
101 | SetDiff(); | ||
102 | |||
100 | int i; | 103 | int i; |
101 | double r = offsetRadius; | 104 | double r = offsetRadius; |
102 | double theta = offsetAngle; | 105 | double theta = offsetAngle; |
@@ -112,6 +115,8 @@ namespace libTerrain | |||
112 | 115 | ||
113 | public void SpiralCells(int steps, double incAngle, double incRadius, double offsetRadius, double offsetAngle, double[] c) | 116 | public void SpiralCells(int steps, double incAngle, double incRadius, double offsetRadius, double offsetAngle, double[] c) |
114 | { | 117 | { |
118 | SetDiff(); | ||
119 | |||
115 | List<Point2D> points = new List<Point2D>(); | 120 | List<Point2D> points = new List<Point2D>(); |
116 | 121 | ||
117 | int i; | 122 | int i; |
@@ -131,6 +136,8 @@ namespace libTerrain | |||
131 | 136 | ||
132 | public void Spiral(double wid, double hig, double offset) | 137 | public void Spiral(double wid, double hig, double offset) |
133 | { | 138 | { |
139 | SetDiff(); | ||
140 | |||
134 | int x, y, z; | 141 | int x, y, z; |
135 | z = 0; | 142 | z = 0; |
136 | for (x = 0; x < w; x++) | 143 | for (x = 0; x < w; x++) |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Voronoi.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Voronoi.cs index e973d14..eb8f7ba 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Voronoi.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Voronoi.cs | |||
@@ -44,6 +44,8 @@ namespace libTerrain | |||
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 | SetDiff(); | ||
48 | |||
47 | List<Point2D> points = new List<Point2D>(); | 49 | List<Point2D> points = new List<Point2D>(); |
48 | Random generator = new Random(seed); | 50 | Random generator = new Random(seed); |
49 | 51 | ||
@@ -103,7 +105,8 @@ namespace libTerrain | |||
103 | 105 | ||
104 | public void VoronoiDiagram(List<Point2D> points, double[] c) | 106 | public void VoronoiDiagram(List<Point2D> points, double[] c) |
105 | { | 107 | { |
106 | 108 | SetDiff(); | |
109 | |||
107 | Random generator = new Random(seed); | 110 | Random generator = new Random(seed); |
108 | int x, y, i; | 111 | int x, y, i; |
109 | double[] distances = new double[points.Count]; | 112 | double[] distances = new double[points.Count]; |
@@ -146,6 +149,8 @@ namespace libTerrain | |||
146 | 149 | ||
147 | public void VoroflatDiagram(int pointsPerBlock, int blockSize) | 150 | public void VoroflatDiagram(int pointsPerBlock, int blockSize) |
148 | { | 151 | { |
152 | SetDiff(); | ||
153 | |||
149 | List<Point2D> points = new List<Point2D>(); | 154 | List<Point2D> points = new List<Point2D>(); |
150 | Random generator = new Random(seed); | 155 | Random generator = new Random(seed); |
151 | 156 | ||
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Worms.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Worms.cs index 38a8023..ce36daf 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Worms.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Worms.cs | |||
@@ -44,6 +44,8 @@ namespace libTerrain | |||
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 | SetDiff(); | ||
48 | |||
47 | Random random = new Random(seed); | 49 | Random random = new Random(seed); |
48 | int i, j; | 50 | int i, j; |
49 | 51 | ||