aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs19
1 files changed, 18 insertions, 1 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
index bd66c02..a519185 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Region.Terrain
155 /// Converts the heightmap to a 65536 value 1D floating point array 155 /// Converts the heightmap to a 65536 value 1D floating point array
156 /// </summary> 156 /// </summary>
157 /// <returns>A float[65536] array containing the heightmap</returns> 157 /// <returns>A float[65536] array containing the heightmap</returns>
158 public float[] GetHeights1D() 158 public float[] GetHeights1DFixed()
159 { 159 {
160 float[] heights = new float[w * h]; 160 float[] heights = new float[w * h];
161 int i; 161 int i;
@@ -169,6 +169,23 @@ namespace OpenSim.Region.Terrain
169 } 169 }
170 170
171 /// <summary> 171 /// <summary>
172 /// Converts the heightmap to a 65536 value 1D floating point array
173 /// </summary>
174 /// <returns>A float[65536] array containing the heightmap</returns>
175 public float[] GetHeights1D()
176 {
177 float[] heights = new float[w * h];
178 int i;
179
180 for (i = 0; i < w * h; i++)
181 {
182 heights[i] = (float)heightmap.map[i / w, i % w];
183 }
184
185 return heights;
186 }
187
188 /// <summary>
172 /// Converts the heightmap to a 256x256 value 2D floating point array. 189 /// Converts the heightmap to a 256x256 value 2D floating point array.
173 /// </summary> 190 /// </summary>
174 /// <returns>An array of 256,256 values containing the heightmap</returns> 191 /// <returns>An array of 256,256 values containing the heightmap</returns>