aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Generators/Fracture.cs37
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 }