aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2007-04-07 16:30:16 +0000
committerAdam Frisby2007-04-07 16:30:16 +0000
commit55aaf8060f34b46169ce96ab159928d7a4c72adc (patch)
treefa7ea88dd3a9ef543b394fe48559e3a375909049
parentPort to a 2D Heightmap complete (diff)
downloadopensim-SC_OLD-55aaf8060f34b46169ce96ab159928d7a4c72adc.zip
opensim-SC_OLD-55aaf8060f34b46169ce96ab159928d7a4c72adc.tar.gz
opensim-SC_OLD-55aaf8060f34b46169ce96ab159928d7a4c72adc.tar.bz2
opensim-SC_OLD-55aaf8060f34b46169ce96ab159928d7a4c72adc.tar.xz
Added setHeights1D to allow importing from a 1D array
-rw-r--r--OpenSim.Terrain.BasicTerrain/TerrainEngine.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
index de0ab50..cbc99bc 100644
--- a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
@@ -30,6 +30,15 @@ namespace OpenSim.Terrain
30 return heights; 30 return heights;
31 } 31 }
32 32
33 public void setHeights1D(float[] heights)
34 {
35 int i;
36 for (i = 0; i < w * h; i++)
37 {
38 map[i / w, i % w] = heights[i];
39 }
40 }
41
33 /// <summary> 42 /// <summary>
34 /// Swaps the references between the height and water buffers to allow you to edit the water heightmap. Remember to swap back when you are done. 43 /// Swaps the references between the height and water buffers to allow you to edit the water heightmap. Remember to swap back when you are done.
35 /// </summary> 44 /// </summary>