From 7661366223f8598439c0fedcf79d8ceee42542df Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 19 Aug 2015 15:24:12 +0100 Subject: minor change --- OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index 3d563a6..282a44a 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs @@ -395,17 +395,21 @@ namespace OpenSim.Region.Framework.Scenes // Fill the heightmap with the center bump terrain private void PinHeadIsland() { + float cx = m_terrainData.SizeX * 0.5f; + float cy = m_terrainData.SizeY * 0.5f; + float h; for (int x = 0; x < Width; x++) { for (int y = 0; y < Height; y++) { - m_terrainData[x, y] = (float)TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10; - float spherFacA = (float)(TerrainUtil.SphericalFactor(x, y, m_terrainData.SizeX / 2.0, m_terrainData.SizeY / 2.0, 50) * 0.01d); - float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, m_terrainData.SizeX / 2.0, m_terrainData.SizeY / 2.0, 100) * 0.001d); - if (m_terrainData[x, y]< spherFacA) - m_terrainData[x, y]= spherFacA; - if (m_terrainData[x, y]< spherFacB) - m_terrainData[x, y] = spherFacB; + h = (float)TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10; + float spherFacA = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 50) * 0.01d); + float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 100) * 0.001d); + if (h < spherFacA) + h = spherFacA; + if (h < spherFacB) + h = spherFacB; + m_terrainData[x, y] = h; } } } -- cgit v1.1