aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSignpostMarv2012-07-04 00:53:16 +0100
committerJustin Clark-Casey (justincc)2012-07-05 00:16:31 +0100
commit510e809abae3c126d68ffe2b0645b4697f5b56b2 (patch)
tree1bda77969cdc9421de230b6ff169dfe4aa196f44
parentAdd OSSL function osForceAttachToAvatarFromInventory() (diff)
downloadopensim-SC_OLD-510e809abae3c126d68ffe2b0645b4697f5b56b2.zip
opensim-SC_OLD-510e809abae3c126d68ffe2b0645b4697f5b56b2.tar.gz
opensim-SC_OLD-510e809abae3c126d68ffe2b0645b4697f5b56b2.tar.bz2
opensim-SC_OLD-510e809abae3c126d68ffe2b0645b4697f5b56b2.tar.xz
porting console commands from raw2sculpt 3.2
-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 2eac0fa..3f848ed 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -1108,6 +1108,32 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1108 CheckForTerrainUpdates(); 1108 CheckForTerrainUpdates();
1109 } 1109 }
1110 1110
1111 private void InterfaceMinTerrain(Object[] args)
1112 {
1113 int x, y;
1114 for (x = 0; x < m_channel.Width; x++)
1115 {
1116 for (y = 0; y < m_channel.Height; y++)
1117 {
1118 m_channel[x, y] = Math.Max((double)args[0], m_channel[x, y]);
1119 }
1120 }
1121 CheckForTerrainUpdates();
1122 }
1123
1124 private void InterfaceMaxTerrain(Object[] args)
1125 {
1126 int x, y;
1127 for (x = 0; x < m_channel.Width; x++)
1128 {
1129 for (y = 0; y < m_channel.Height; y++)
1130 {
1131 m_channel[x, y] = Math.Min((double)args[0], m_channel[x, y]);
1132 }
1133 }
1134 CheckForTerrainUpdates();
1135 }
1136
1111 private void InterfaceShowDebugStats(Object[] args) 1137 private void InterfaceShowDebugStats(Object[] args)
1112 { 1138 {
1113 double max = Double.MinValue; 1139 double max = Double.MinValue;
@@ -1248,6 +1274,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1248 rescaleCommand.AddArgument("min", "min terrain height after rescaling", "Double"); 1274 rescaleCommand.AddArgument("min", "min terrain height after rescaling", "Double");
1249 rescaleCommand.AddArgument("max", "max terrain height after rescaling", "Double"); 1275 rescaleCommand.AddArgument("max", "max terrain height after rescaling", "Double");
1250 1276
1277 Command minCommand = new Command("min", CommandIntentions.COMMAND_HAZARDOUS, InterfaceMinTerrain, "Sets the minimum terrain height to the specified value.");
1278 minCommand.AddArgument("min", "terrain height to use as minimum", "Double");
1279
1280 Command maxCommand = new Command("max", CommandIntentions.COMMAND_HAZARDOUS, InterfaceMaxTerrain, "Sets the maximum terrain height to the specified value.");
1281 maxCommand.AddArgument("min", "terrain height to use as maximum", "Double");
1282
1251 1283
1252 // Debug 1284 // Debug
1253 Command showDebugStatsCommand = 1285 Command showDebugStatsCommand =
@@ -1279,6 +1311,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1279 m_commander.RegisterCommand("effect", pluginRunCommand); 1311 m_commander.RegisterCommand("effect", pluginRunCommand);
1280 m_commander.RegisterCommand("flip", flipCommand); 1312 m_commander.RegisterCommand("flip", flipCommand);
1281 m_commander.RegisterCommand("rescale", rescaleCommand); 1313 m_commander.RegisterCommand("rescale", rescaleCommand);
1314 m_commander.RegisterCommand("min", minCommand);
1315 m_commander.RegisterCommand("max", maxCommand);
1282 1316
1283 // Add this to our scene so scripts can call these functions 1317 // Add this to our scene so scripts can call these functions
1284 m_scene.RegisterModuleCommander(m_commander); 1318 m_scene.RegisterModuleCommander(m_commander);