aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
diff options
context:
space:
mode:
authorUbitUmarov2015-09-01 14:54:35 +0100
committerUbitUmarov2015-09-01 14:54:35 +0100
commit371c9dd2af01a2e7422ec901ee1f80757284a78c (patch)
tree058d2a513cacb12efcce0c0df0ae14ad135dbfe2 /OpenSim/Region/Framework/Scenes/TerrainChannel.cs
parentremove lixo (diff)
parentdont change camera on crossings (diff)
downloadopensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.zip
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.gz
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.bz2
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.xz
bad merge?
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/TerrainChannel.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/TerrainChannel.cs44
1 files changed, 43 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
index 3d563a6..6fd9096 100644
--- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
+++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Region.Framework.Scenes
49 { 49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51 private static string LogHeader = "[TERRAIN CHANNEL]"; 51 private static string LogHeader = "[TERRAIN CHANNEL]";
52<<<<<<< HEAD
52 53
53 protected TerrainData m_terrainData; 54 protected TerrainData m_terrainData;
54 55
@@ -57,6 +58,16 @@ namespace OpenSim.Region.Framework.Scenes
57 public int Height { get { return m_terrainData.SizeY; } } // Y dimension 58 public int Height { get { return m_terrainData.SizeY; } } // Y dimension
58 public int Altitude { get { return m_terrainData.SizeZ; } } // Y dimension 59 public int Altitude { get { return m_terrainData.SizeZ; } } // Y dimension
59 60
61=======
62
63 protected TerrainData m_terrainData;
64
65 public int Width { get { return m_terrainData.SizeX; } } // X dimension
66 // Unfortunately, for historical reasons, in this module 'Width' is X and 'Height' is Y
67 public int Height { get { return m_terrainData.SizeY; } } // Y dimension
68 public int Altitude { get { return m_terrainData.SizeZ; } } // Y dimension
69
70>>>>>>> avn/ubitvar
60 // Default, not-often-used builder 71 // Default, not-often-used builder
61 public TerrainChannel() 72 public TerrainChannel()
62 { 73 {
@@ -157,7 +168,15 @@ namespace OpenSim.Region.Framework.Scenes
157 { 168 {
158 if (Double.IsNaN(value) || Double.IsInfinity(value)) 169 if (Double.IsNaN(value) || Double.IsInfinity(value))
159 return; 170 return;
160 171<<<<<<< HEAD
172
173=======
174 if (value < 0)
175 value = 0;
176 else
177 if (value > 655.35)
178 value = 655.35;
179>>>>>>> avn/ubitvar
161 m_terrainData[x, y] = (float)value; 180 m_terrainData[x, y] = (float)value;
162 } 181 }
163 } 182 }
@@ -363,8 +382,13 @@ namespace OpenSim.Region.Framework.Scenes
363 public int SizeY; 382 public int SizeY;
364 public int SizeZ; 383 public int SizeZ;
365 public float CompressionFactor; 384 public float CompressionFactor;
385<<<<<<< HEAD
366 public int[] Map; 386 public int[] Map;
367 public TerrainChannelXMLPackage(int pX, int pY, int pZ, float pCompressionFactor, int[] pMap) 387 public TerrainChannelXMLPackage(int pX, int pY, int pZ, float pCompressionFactor, int[] pMap)
388=======
389 public float[] Map;
390 public TerrainChannelXMLPackage(int pX, int pY, int pZ, float pCompressionFactor, float[] pMap)
391>>>>>>> avn/ubitvar
368 { 392 {
369 Version = 1; 393 Version = 1;
370 SizeX = pX; 394 SizeX = pX;
@@ -395,10 +419,17 @@ namespace OpenSim.Region.Framework.Scenes
395 // Fill the heightmap with the center bump terrain 419 // Fill the heightmap with the center bump terrain
396 private void PinHeadIsland() 420 private void PinHeadIsland()
397 { 421 {
422<<<<<<< HEAD
423=======
424 float cx = m_terrainData.SizeX * 0.5f;
425 float cy = m_terrainData.SizeY * 0.5f;
426 float h;
427>>>>>>> avn/ubitvar
398 for (int x = 0; x < Width; x++) 428 for (int x = 0; x < Width; x++)
399 { 429 {
400 for (int y = 0; y < Height; y++) 430 for (int y = 0; y < Height; y++)
401 { 431 {
432<<<<<<< HEAD
402 m_terrainData[x, y] = (float)TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10; 433 m_terrainData[x, y] = (float)TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10;
403 float spherFacA = (float)(TerrainUtil.SphericalFactor(x, y, m_terrainData.SizeX / 2.0, m_terrainData.SizeY / 2.0, 50) * 0.01d); 434 float spherFacA = (float)(TerrainUtil.SphericalFactor(x, y, m_terrainData.SizeX / 2.0, m_terrainData.SizeY / 2.0, 50) * 0.01d);
404 float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, m_terrainData.SizeX / 2.0, m_terrainData.SizeY / 2.0, 100) * 0.001d); 435 float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, m_terrainData.SizeX / 2.0, m_terrainData.SizeY / 2.0, 100) * 0.001d);
@@ -406,6 +437,17 @@ namespace OpenSim.Region.Framework.Scenes
406 m_terrainData[x, y]= spherFacA; 437 m_terrainData[x, y]= spherFacA;
407 if (m_terrainData[x, y]< spherFacB) 438 if (m_terrainData[x, y]< spherFacB)
408 m_terrainData[x, y] = spherFacB; 439 m_terrainData[x, y] = spherFacB;
440=======
441 // h = (float)TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10;
442 h = 1.0f;
443 float spherFacA = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 50) * 0.01d);
444 float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 100) * 0.001d);
445 if (h < spherFacA)
446 h = spherFacA;
447 if (h < spherFacB)
448 h = spherFacB;
449 m_terrainData[x, y] = h;
450>>>>>>> avn/ubitvar
409 } 451 }
410 } 452 }
411 } 453 }