* Added 'rescale' command for normalising a terrain between two values
0.1-prestable
Adam Frisby 2007-04-20 14:49:24 +00:00
parent 84700807c7
commit ae8824985c
2 changed files with 10 additions and 0 deletions

View File

@ -540,6 +540,7 @@ namespace OpenSim
m_console.WriteLine("terrain seed <seed> - sets the random seed value to <seed>");
m_console.WriteLine("terrain load <type> <filename> - loads a terrain from disk, type can be 'F32', 'F64' or 'IMG'");
m_console.WriteLine("terrain save <type> <filename> - saves a terrain to disk, type can be 'F32' or 'F64'");
m_console.WriteLine("terrain rescale <min> <max> - rescales a terrain to be between <min> and <max> meters high");
break;
case "seed":
@ -550,6 +551,10 @@ namespace OpenSim
LocalWorld.Terrain.hills();
break;
case "rescale":
LocalWorld.Terrain.setRange(Convert.ToSingle(args[1]), Convert.ToSingle(args[2]));
break;
case "load":
switch (args[1].ToLower())
{

View File

@ -82,6 +82,11 @@ namespace OpenSim.Terrain
return heights;
}
public void setRange(float min, float max)
{
heightmap.normalise((double)min, (double)max);
}
/// <summary>
/// Loads a file consisting of 256x256 doubles and imports it as an array into the map.
/// </summary>