Comments (Part 2/2)

0.1-prestable
Adam Frisby 2007-04-22 02:58:39 +00:00
parent 1dfda8f744
commit 855122add1
1 changed files with 24 additions and 0 deletions

View File

@ -160,6 +160,10 @@ namespace OpenSim.Terrain
tainted++; tainted++;
} }
/// <summary>
/// Writes the current terrain heightmap to disk, in the format of a 65536 entry double[] array.
/// </summary>
/// <param name="filename">The desired output filename</param>
public void writeToFileF64(string filename) public void writeToFileF64(string filename)
{ {
System.IO.FileInfo file = new System.IO.FileInfo(filename); System.IO.FileInfo file = new System.IO.FileInfo(filename);
@ -179,6 +183,10 @@ namespace OpenSim.Terrain
s.Close(); s.Close();
} }
/// <summary>
/// Writes the current terrain heightmap to disk, in the format of a 65536 entry float[] array
/// </summary>
/// <param name="filename">The desired output filename</param>
public void writeToFileF32(string filename) public void writeToFileF32(string filename)
{ {
System.IO.FileInfo file = new System.IO.FileInfo(filename); System.IO.FileInfo file = new System.IO.FileInfo(filename);
@ -198,6 +206,10 @@ namespace OpenSim.Terrain
s.Close(); s.Close();
} }
/// <summary>
/// Sets the random seed to be used by procedural functions which involve random numbers.
/// </summary>
/// <param name="val">The desired seed</param>
public void setSeed(int val) public void setSeed(int val)
{ {
heightmap.seed = val; heightmap.seed = val;
@ -252,12 +264,24 @@ namespace OpenSim.Terrain
tainted++; tainted++;
} }
/// <summary>
/// Multiplies the heightfield by val
/// </summary>
/// <param name="meep">The heightfield</param>
/// <param name="val">The multiplier</param>
/// <returns></returns>
public static TerrainEngine operator *(TerrainEngine meep, Double val) { public static TerrainEngine operator *(TerrainEngine meep, Double val) {
meep.heightmap *= val; meep.heightmap *= val;
meep.tainted++; meep.tainted++;
return meep; return meep;
} }
/// <summary>
/// Returns the height at the coordinates x,y
/// </summary>
/// <param name="x">X Coordinate</param>
/// <param name="y">Y Coordinate</param>
/// <returns></returns>
public float this[int x, int y] public float this[int x, int y]
{ {
get get