aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-04-22 02:58:39 +0000
committerAdam Frisby2007-04-22 02:58:39 +0000
commit855122add1e01f277af4b4732cd1b9463bfbd8e5 (patch)
treedf861c5f92985fd243b4efd2a24ac08a5e088d6f /OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
parentAdded OpenGridProtocol class - start of the new TCP-based intersim protocol, ... (diff)
downloadopensim-SC-855122add1e01f277af4b4732cd1b9463bfbd8e5.zip
opensim-SC-855122add1e01f277af4b4732cd1b9463bfbd8e5.tar.gz
opensim-SC-855122add1e01f277af4b4732cd1b9463bfbd8e5.tar.bz2
opensim-SC-855122add1e01f277af4b4732cd1b9463bfbd8e5.tar.xz
Comments (Part 2/2)
Diffstat (limited to 'OpenSim.Terrain.BasicTerrain/TerrainEngine.cs')
-rw-r--r--OpenSim.Terrain.BasicTerrain/TerrainEngine.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
index cd40d0f..38c4d0f 100644
--- a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
@@ -160,6 +160,10 @@ namespace OpenSim.Terrain
160 tainted++; 160 tainted++;
161 } 161 }
162 162
163 /// <summary>
164 /// Writes the current terrain heightmap to disk, in the format of a 65536 entry double[] array.
165 /// </summary>
166 /// <param name="filename">The desired output filename</param>
163 public void writeToFileF64(string filename) 167 public void writeToFileF64(string filename)
164 { 168 {
165 System.IO.FileInfo file = new System.IO.FileInfo(filename); 169 System.IO.FileInfo file = new System.IO.FileInfo(filename);
@@ -179,6 +183,10 @@ namespace OpenSim.Terrain
179 s.Close(); 183 s.Close();
180 } 184 }
181 185
186 /// <summary>
187 /// Writes the current terrain heightmap to disk, in the format of a 65536 entry float[] array
188 /// </summary>
189 /// <param name="filename">The desired output filename</param>
182 public void writeToFileF32(string filename) 190 public void writeToFileF32(string filename)
183 { 191 {
184 System.IO.FileInfo file = new System.IO.FileInfo(filename); 192 System.IO.FileInfo file = new System.IO.FileInfo(filename);
@@ -198,6 +206,10 @@ namespace OpenSim.Terrain
198 s.Close(); 206 s.Close();
199 } 207 }
200 208
209 /// <summary>
210 /// Sets the random seed to be used by procedural functions which involve random numbers.
211 /// </summary>
212 /// <param name="val">The desired seed</param>
201 public void setSeed(int val) 213 public void setSeed(int val)
202 { 214 {
203 heightmap.seed = val; 215 heightmap.seed = val;
@@ -252,12 +264,24 @@ namespace OpenSim.Terrain
252 tainted++; 264 tainted++;
253 } 265 }
254 266
267 /// <summary>
268 /// Multiplies the heightfield by val
269 /// </summary>
270 /// <param name="meep">The heightfield</param>
271 /// <param name="val">The multiplier</param>
272 /// <returns></returns>
255 public static TerrainEngine operator *(TerrainEngine meep, Double val) { 273 public static TerrainEngine operator *(TerrainEngine meep, Double val) {
256 meep.heightmap *= val; 274 meep.heightmap *= val;
257 meep.tainted++; 275 meep.tainted++;
258 return meep; 276 return meep;
259 } 277 }
260 278
279 /// <summary>
280 /// Returns the height at the coordinates x,y
281 /// </summary>
282 /// <param name="x">X Coordinate</param>
283 /// <param name="y">Y Coordinate</param>
284 /// <returns></returns>
261 public float this[int x, int y] 285 public float this[int x, int y]
262 { 286 {
263 get 287 get