diff options
author | Adam Frisby | 2007-07-24 04:53:21 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-24 04:53:21 +0000 |
commit | 4b0734c4ad75b93d84c11942531cf2d2e070ba6e (patch) | |
tree | e1e6bf405de882a0bc688615c0a736c7b9f42df6 /OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators | |
parent | * More console related changes. (diff) | |
download | opensim-SC-4b0734c4ad75b93d84c11942531cf2d2e070ba6e.zip opensim-SC-4b0734c4ad75b93d84c11942531cf2d2e070ba6e.tar.gz opensim-SC-4b0734c4ad75b93d84c11942531cf2d2e070ba6e.tar.bz2 opensim-SC-4b0734c4ad75b93d84c11942531cf2d2e070ba6e.tar.xz |
* Terrain Fracture Generator now produces more appropriate results.
* Terrain Flatten Brush has been optimised, now affects an appropriate sized section of terrain.
* Navier-Stokes handler bounds issue partially fixed.
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators')
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs | 37 |
1 files changed, 35 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 b585caa..8427eab 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs | |||
@@ -79,6 +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 | |||
82 | public void Fracture(int number, double scalemin, double scalemax) | 83 | public void Fracture(int number, double scalemin, double scalemax) |
83 | { | 84 | { |
84 | Random rand = new Random(seed); | 85 | Random rand = new Random(seed); |
@@ -90,6 +91,8 @@ namespace libTerrain | |||
90 | a = RadialEdge256(rand.Next(1023)); // TODO: Broken | 91 | a = RadialEdge256(rand.Next(1023)); // TODO: Broken |
91 | b = RadialEdge256(rand.Next(1023)); // TODO: Broken | 92 | b = RadialEdge256(rand.Next(1023)); // TODO: Broken |
92 | double z = rand.NextDouble(); | 93 | double z = rand.NextDouble(); |
94 | double u = rand.NextDouble(); | ||
95 | double v = rand.NextDouble(); | ||
93 | 96 | ||
94 | for (int x = 0; x < w; x++) | 97 | for (int x = 0; x < w; x++) |
95 | { | 98 | { |
@@ -97,9 +100,39 @@ namespace libTerrain | |||
97 | { | 100 | { |
98 | double miny = Tools.linearInterpolate(a[1], b[1], (double)x / (double)w); | 101 | double miny = Tools.linearInterpolate(a[1], b[1], (double)x / (double)w); |
99 | 102 | ||
100 | if (y > miny) | 103 | if (v >= 0.5) |
104 | { | ||
105 | if (u >= 0.5) | ||
106 | { | ||
107 | if (y > miny) | ||
108 | { | ||
109 | map[x, y] += Tools.linearInterpolate(scalemin, scalemax, z); | ||
110 | } | ||
111 | } | ||
112 | else | ||
113 | { | ||
114 | if (y < miny) | ||
115 | { | ||
116 | map[x, y] += Tools.linearInterpolate(scalemin, scalemax, z); | ||
117 | } | ||
118 | } | ||
119 | } | ||
120 | else | ||
101 | { | 121 | { |
102 | map[x, y] += Tools.linearInterpolate(scalemin, scalemax, z); | 122 | if (u >= 0.5) |
123 | { | ||
124 | if (x > miny) | ||
125 | { | ||
126 | map[x, y] += Tools.linearInterpolate(scalemin, scalemax, z); | ||
127 | } | ||
128 | } | ||
129 | else | ||
130 | { | ||
131 | if (x < miny) | ||
132 | { | ||
133 | map[x, y] += Tools.linearInterpolate(scalemin, scalemax, z); | ||
134 | } | ||
135 | } | ||
103 | } | 136 | } |
104 | } | 137 | } |
105 | } | 138 | } |