Terrain:
* Added 'rescale' command for normalising a terrain between two values0.1-prestable
parent
84700807c7
commit
ae8824985c
|
@ -540,6 +540,7 @@ namespace OpenSim
|
||||||
m_console.WriteLine("terrain seed <seed> - sets the random seed value to <seed>");
|
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 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 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;
|
break;
|
||||||
|
|
||||||
case "seed":
|
case "seed":
|
||||||
|
@ -550,6 +551,10 @@ namespace OpenSim
|
||||||
LocalWorld.Terrain.hills();
|
LocalWorld.Terrain.hills();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "rescale":
|
||||||
|
LocalWorld.Terrain.setRange(Convert.ToSingle(args[1]), Convert.ToSingle(args[2]));
|
||||||
|
break;
|
||||||
|
|
||||||
case "load":
|
case "load":
|
||||||
switch (args[1].ToLower())
|
switch (args[1].ToLower())
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,6 +82,11 @@ namespace OpenSim.Terrain
|
||||||
return heights;
|
return heights;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRange(float min, float max)
|
||||||
|
{
|
||||||
|
heightmap.normalise((double)min, (double)max);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads a file consisting of 256x256 doubles and imports it as an array into the map.
|
/// Loads a file consisting of 256x256 doubles and imports it as an array into the map.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue