diff options
author | Justin Clark-Casey (justincc) | 2014-04-30 18:04:47 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-04-30 18:04:47 +0100 |
commit | 253110293a785b6dda94147cbfc3343fb8ca0434 (patch) | |
tree | 74bdc4c7070fb7c8db6b459cad78522d00d79b73 /OpenSim/Region | |
parent | minor: convert back some tabs to spaces that got into ScenePresence via recen... (diff) | |
download | opensim-SC_OLD-253110293a785b6dda94147cbfc3343fb8ca0434.zip opensim-SC_OLD-253110293a785b6dda94147cbfc3343fb8ca0434.tar.gz opensim-SC_OLD-253110293a785b6dda94147cbfc3343fb8ca0434.tar.bz2 opensim-SC_OLD-253110293a785b6dda94147cbfc3343fb8ca0434.tar.xz |
Add "terrain show" console command which outputs terrain height for a given region co-ordinate.
For debug purposes.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 3901482..ae6fdac 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -39,6 +39,7 @@ using Mono.Addins; | |||
39 | 39 | ||
40 | using OpenSim.Data; | 40 | using OpenSim.Data; |
41 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
42 | using OpenSim.Framework.Console; | ||
42 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | 43 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; |
43 | using OpenSim.Region.CoreModules.World.Terrain.FileLoaders; | 44 | using OpenSim.Region.CoreModules.World.Terrain.FileLoaders; |
44 | using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; | 45 | using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; |
@@ -1203,6 +1204,21 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1203 | } | 1204 | } |
1204 | } | 1205 | } |
1205 | 1206 | ||
1207 | private void InterfaceShow(Object[] args) | ||
1208 | { | ||
1209 | Vector2 point; | ||
1210 | |||
1211 | if (!ConsoleUtil.TryParseConsole2DVector((string)args[0], null, out point)) | ||
1212 | { | ||
1213 | Console.WriteLine("ERROR: {0} is not a valid vector", args[0]); | ||
1214 | return; | ||
1215 | } | ||
1216 | |||
1217 | double height = m_channel[(int)point.X, (int)point.Y]; | ||
1218 | |||
1219 | Console.WriteLine("Terrain height at {0} is {1}", point, height); | ||
1220 | } | ||
1221 | |||
1206 | private void InterfaceShowDebugStats(Object[] args) | 1222 | private void InterfaceShowDebugStats(Object[] args) |
1207 | { | 1223 | { |
1208 | double max = Double.MinValue; | 1224 | double max = Double.MinValue; |
@@ -1355,6 +1371,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1355 | new Command("stats", CommandIntentions.COMMAND_STATISTICAL, InterfaceShowDebugStats, | 1371 | new Command("stats", CommandIntentions.COMMAND_STATISTICAL, InterfaceShowDebugStats, |
1356 | "Shows some information about the regions heightmap for debugging purposes."); | 1372 | "Shows some information about the regions heightmap for debugging purposes."); |
1357 | 1373 | ||
1374 | Command showCommand = | ||
1375 | new Command("show", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceShow, | ||
1376 | "Shows terrain height at a given co-ordinate."); | ||
1377 | showCommand.AddArgument("point", "point in <x>,<y> format with no spaces (e.g. 45,45)", "String"); | ||
1378 | |||
1358 | Command experimentalBrushesCommand = | 1379 | Command experimentalBrushesCommand = |
1359 | new Command("newbrushes", CommandIntentions.COMMAND_HAZARDOUS, InterfaceEnableExperimentalBrushes, | 1380 | new Command("newbrushes", CommandIntentions.COMMAND_HAZARDOUS, InterfaceEnableExperimentalBrushes, |
1360 | "Enables experimental brushes which replace the standard terrain brushes. WARNING: This is a debug setting and may be removed at any time."); | 1381 | "Enables experimental brushes which replace the standard terrain brushes. WARNING: This is a debug setting and may be removed at any time."); |
@@ -1376,6 +1397,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1376 | m_commander.RegisterCommand("bake", bakeRegionCommand); | 1397 | m_commander.RegisterCommand("bake", bakeRegionCommand); |
1377 | m_commander.RegisterCommand("revert", revertRegionCommand); | 1398 | m_commander.RegisterCommand("revert", revertRegionCommand); |
1378 | m_commander.RegisterCommand("newbrushes", experimentalBrushesCommand); | 1399 | m_commander.RegisterCommand("newbrushes", experimentalBrushesCommand); |
1400 | m_commander.RegisterCommand("show", showCommand); | ||
1379 | m_commander.RegisterCommand("stats", showDebugStatsCommand); | 1401 | m_commander.RegisterCommand("stats", showDebugStatsCommand); |
1380 | m_commander.RegisterCommand("effect", pluginRunCommand); | 1402 | m_commander.RegisterCommand("effect", pluginRunCommand); |
1381 | m_commander.RegisterCommand("flip", flipCommand); | 1403 | m_commander.RegisterCommand("flip", flipCommand); |