OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs

Backing out previous change to GetHeights1D. Terrain should now load with the correct rotation, but terraforming is now broken again.
afrisby
Brian McBee 2007-08-06 17:45:57 +00:00
parent 4c9cc74ac2
commit 73dadb4821
1 changed files with 18 additions and 1 deletions

View File

@ -155,7 +155,7 @@ namespace OpenSim.Region.Terrain
/// Converts the heightmap to a 65536 value 1D floating point array
/// </summary>
/// <returns>A float[65536] array containing the heightmap</returns>
public float[] GetHeights1D()
public float[] GetHeights1DFixed()
{
float[] heights = new float[w * h];
int i;
@ -168,6 +168,23 @@ namespace OpenSim.Region.Terrain
return heights;
}
/// <summary>
/// Converts the heightmap to a 65536 value 1D floating point array
/// </summary>
/// <returns>A float[65536] array containing the heightmap</returns>
public float[] GetHeights1D()
{
float[] heights = new float[w * h];
int i;
for (i = 0; i < w * h; i++)
{
heights[i] = (float)heightmap.map[i / w, i % w];
}
return heights;
}
/// <summary>
/// Converts the heightmap to a 256x256 value 2D floating point array.
/// </summary>