minor change

avinationmerge
UbitUmarov 2015-08-19 15:24:12 +01:00
parent abeb2ec4b3
commit 7661366223
1 changed files with 11 additions and 7 deletions

View File

@ -395,17 +395,21 @@ namespace OpenSim.Region.Framework.Scenes
// Fill the heightmap with the center bump terrain // Fill the heightmap with the center bump terrain
private void PinHeadIsland() 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 x = 0; x < Width; x++)
{ {
for (int y = 0; y < Height; y++) for (int y = 0; y < Height; y++)
{ {
m_terrainData[x, y] = (float)TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10; h = (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 spherFacA = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 50) * 0.01d);
float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, m_terrainData.SizeX / 2.0, m_terrainData.SizeY / 2.0, 100) * 0.001d); float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 100) * 0.001d);
if (m_terrainData[x, y]< spherFacA) if (h < spherFacA)
m_terrainData[x, y]= spherFacA; h = spherFacA;
if (m_terrainData[x, y]< spherFacB) if (h < spherFacB)
m_terrainData[x, y] = spherFacB; h = spherFacB;
m_terrainData[x, y] = h;
} }
} }
} }