diff options
author | Brian McBee | 2007-08-06 17:45:57 +0000 |
---|---|---|
committer | Brian McBee | 2007-08-06 17:45:57 +0000 |
commit | 73dadb4821e7afeacc38b959e52f368ebeb69d44 (patch) | |
tree | 9aa100c5669b6f60011453a3f984abbaaa63ee95 /OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | |
parent | Re-added Grid mode. (which had got removed/disabled in revision 1515) (diff) | |
download | opensim-SC-73dadb4821e7afeacc38b959e52f368ebeb69d44.zip opensim-SC-73dadb4821e7afeacc38b959e52f368ebeb69d44.tar.gz opensim-SC-73dadb4821e7afeacc38b959e52f368ebeb69d44.tar.bz2 opensim-SC-73dadb4821e7afeacc38b959e52f368ebeb69d44.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs')
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | 19 |
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> |