diff options
Diffstat (limited to 'OpenSim.Terrain.BasicTerrain')
-rw-r--r-- | OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs index 6576ab8..cd40d0f 100644 --- a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | |||
@@ -11,6 +11,11 @@ namespace OpenSim.Terrain | |||
11 | /// A [normally] 256x256 heightmap | 11 | /// A [normally] 256x256 heightmap |
12 | /// </summary> | 12 | /// </summary> |
13 | public Channel heightmap; | 13 | public Channel heightmap; |
14 | |||
15 | /// <summary> | ||
16 | /// Whether or not the terrain has been modified since it was last saved and sent to the Physics engine. | ||
17 | /// Counts the number of modifications since the last save. (0 = Untainted) | ||
18 | /// </summary> | ||
14 | public int tainted; | 19 | public int tainted; |
15 | 20 | ||
16 | int w, h; | 21 | int w, h; |
@@ -44,6 +49,10 @@ namespace OpenSim.Terrain | |||
44 | return heights; | 49 | return heights; |
45 | } | 50 | } |
46 | 51 | ||
52 | /// <summary> | ||
53 | /// Converts the heightmap to a 256x256 value 2D floating point array. | ||
54 | /// </summary> | ||
55 | /// <returns>An array of 256,256 values containing the heightmap</returns> | ||
47 | public float[,] getHeights2D() | 56 | public float[,] getHeights2D() |
48 | { | 57 | { |
49 | float[,] heights = new float[w, h]; | 58 | float[,] heights = new float[w, h]; |
@@ -73,6 +82,10 @@ namespace OpenSim.Terrain | |||
73 | tainted++; | 82 | tainted++; |
74 | } | 83 | } |
75 | 84 | ||
85 | /// <summary> | ||
86 | /// Loads a 2D array of values into the heightmap | ||
87 | /// </summary> | ||
88 | /// <param name="heights">An array of 256,256 float values</param> | ||
76 | public void setHeights2D(float[,] heights) | 89 | public void setHeights2D(float[,] heights) |
77 | { | 90 | { |
78 | int x, y; | 91 | int x, y; |
@@ -86,6 +99,11 @@ namespace OpenSim.Terrain | |||
86 | tainted++; | 99 | tainted++; |
87 | } | 100 | } |
88 | 101 | ||
102 | /// <summary> | ||
103 | /// Renormalises the array between min and max | ||
104 | /// </summary> | ||
105 | /// <param name="min">Minimum value of the new array</param> | ||
106 | /// <param name="max">Maximum value of the new array</param> | ||
89 | public void setRange(float min, float max) | 107 | public void setRange(float min, float max) |
90 | { | 108 | { |
91 | heightmap.normalise((double)min, (double)max); | 109 | heightmap.normalise((double)min, (double)max); |