From 55aaf8060f34b46169ce96ab159928d7a4c72adc Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 7 Apr 2007 16:30:16 +0000 Subject: Added setHeights1D to allow importing from a 1D array --- OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim.Terrain.BasicTerrain') 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 return heights; } + public void setHeights1D(float[] heights) + { + int i; + for (i = 0; i < w * h; i++) + { + map[i / w, i % w] = heights[i]; + } + } + /// /// 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. /// -- cgit v1.1