aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 5b03ac7..402b9fb 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -1110,6 +1110,32 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1110 CheckForTerrainUpdates(); 1110 CheckForTerrainUpdates();
1111 } 1111 }
1112 1112
1113 private void InterfaceMinTerrain(Object[] args)
1114 {
1115 int x, y;
1116 for (x = 0; x < m_channel.Width; x++)
1117 {
1118 for (y = 0; y < m_channel.Height; y++)
1119 {
1120 m_channel[x, y] = Math.Max((double)args[0], m_channel[x, y]);
1121 }
1122 }
1123 CheckForTerrainUpdates();
1124 }
1125
1126 private void InterfaceMaxTerrain(Object[] args)
1127 {
1128 int x, y;
1129 for (x = 0; x < m_channel.Width; x++)
1130 {
1131 for (y = 0; y < m_channel.Height; y++)
1132 {
1133 m_channel[x, y] = Math.Min((double)args[0], m_channel[x, y]);
1134 }
1135 }
1136 CheckForTerrainUpdates();
1137 }
1138
1113 private void InterfaceShowDebugStats(Object[] args) 1139 private void InterfaceShowDebugStats(Object[] args)
1114 { 1140 {
1115 double max = Double.MinValue; 1141 double max = Double.MinValue;
@@ -1250,6 +1276,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1250 rescaleCommand.AddArgument("min", "min terrain height after rescaling", "Double"); 1276 rescaleCommand.AddArgument("min", "min terrain height after rescaling", "Double");
1251 rescaleCommand.AddArgument("max", "max terrain height after rescaling", "Double"); 1277 rescaleCommand.AddArgument("max", "max terrain height after rescaling", "Double");
1252 1278
1279 Command minCommand = new Command("min", CommandIntentions.COMMAND_HAZARDOUS, InterfaceMinTerrain, "Sets the minimum terrain height to the specified value.");
1280 minCommand.AddArgument("min", "terrain height to use as minimum", "Double");
1281
1282 Command maxCommand = new Command("max", CommandIntentions.COMMAND_HAZARDOUS, InterfaceMaxTerrain, "Sets the maximum terrain height to the specified value.");
1283 maxCommand.AddArgument("min", "terrain height to use as maximum", "Double");
1284
1253 1285
1254 // Debug 1286 // Debug
1255 Command showDebugStatsCommand = 1287 Command showDebugStatsCommand =
@@ -1281,6 +1313,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1281 m_commander.RegisterCommand("effect", pluginRunCommand); 1313 m_commander.RegisterCommand("effect", pluginRunCommand);
1282 m_commander.RegisterCommand("flip", flipCommand); 1314 m_commander.RegisterCommand("flip", flipCommand);
1283 m_commander.RegisterCommand("rescale", rescaleCommand); 1315 m_commander.RegisterCommand("rescale", rescaleCommand);
1316 m_commander.RegisterCommand("min", minCommand);
1317 m_commander.RegisterCommand("max", maxCommand);
1284 1318
1285 // Add this to our scene so scripts can call these functions 1319 // Add this to our scene so scripts can call these functions
1286 m_scene.RegisterModuleCommander(m_commander); 1320 m_scene.RegisterModuleCommander(m_commander);