From c3534b532d9e31701f3387199ee29a3d7fbfb68b Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 21 Apr 2007 07:46:33 +0000 Subject: [PATCH] Part 1/2: Comments (other part will come later) --- OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs index 6576ab85b3..cd40d0f7cf 100644 --- a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs @@ -11,6 +11,11 @@ namespace OpenSim.Terrain /// A [normally] 256x256 heightmap /// public Channel heightmap; + + /// + /// Whether or not the terrain has been modified since it was last saved and sent to the Physics engine. + /// Counts the number of modifications since the last save. (0 = Untainted) + /// public int tainted; int w, h; @@ -44,6 +49,10 @@ namespace OpenSim.Terrain return heights; } + /// + /// Converts the heightmap to a 256x256 value 2D floating point array. + /// + /// An array of 256,256 values containing the heightmap public float[,] getHeights2D() { float[,] heights = new float[w, h]; @@ -73,6 +82,10 @@ namespace OpenSim.Terrain tainted++; } + /// + /// Loads a 2D array of values into the heightmap + /// + /// An array of 256,256 float values public void setHeights2D(float[,] heights) { int x, y; @@ -86,6 +99,11 @@ namespace OpenSim.Terrain tainted++; } + /// + /// Renormalises the array between min and max + /// + /// Minimum value of the new array + /// Maximum value of the new array public void setRange(float min, float max) { heightmap.normalise((double)min, (double)max);