diff options
author | dahlia | 2013-11-26 17:18:44 -0800 |
---|---|---|
committer | dahlia | 2013-11-26 17:18:44 -0800 |
commit | 5a9ec0748b901051ce0ec54e332ae4af002d570e (patch) | |
tree | 1e19d7d5da7fbcc53cb7e198648ac8e272e5dbbe /OpenSim/Region/Application | |
parent | Corrected case to get columns from Regions table from PostgreSQL http://opens... (diff) | |
download | opensim-SC_OLD-5a9ec0748b901051ce0ec54e332ae4af002d570e.zip opensim-SC_OLD-5a9ec0748b901051ce0ec54e332ae4af002d570e.tar.gz opensim-SC_OLD-5a9ec0748b901051ce0ec54e332ae4af002d570e.tar.bz2 opensim-SC_OLD-5a9ec0748b901051ce0ec54e332ae4af002d570e.tar.xz |
add a "rotate scene" console command. Seems to work for prims/sculpts/mesh but not for foliage, don't know why. Also doesn't work on terrain. Successive use of this command will likely introduce floating point error accumulation. Back up your region before using it :)
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e31c3fc..beb546d 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -296,6 +296,11 @@ namespace OpenSim | |||
296 | "Change the scale of a named prim", | 296 | "Change the scale of a named prim", |
297 | HandleEditScale); | 297 | HandleEditScale); |
298 | 298 | ||
299 | m_console.Commands.AddCommand("Objects", false, "rotate scene", | ||
300 | "rotate scene <degrees>", | ||
301 | "Rotates all scene objects around x:128, y:128", | ||
302 | HandleRotateScene); | ||
303 | |||
299 | m_console.Commands.AddCommand("Users", false, "kick user", | 304 | m_console.Commands.AddCommand("Users", false, "kick user", |
300 | "kick user <first> <last> [--force] [message]", | 305 | "kick user <first> <last> [--force] [message]", |
301 | "Kick a user off the simulator", | 306 | "Kick a user off the simulator", |
@@ -505,6 +510,34 @@ namespace OpenSim | |||
505 | } | 510 | } |
506 | } | 511 | } |
507 | 512 | ||
513 | private void HandleRotateScene(string module, string[] args) | ||
514 | { | ||
515 | string usage = "Usage: rotate scene <angle in degrees>"; | ||
516 | |||
517 | if (args.Length != 3) | ||
518 | { | ||
519 | MainConsole.Instance.Output(usage); | ||
520 | return; | ||
521 | } | ||
522 | |||
523 | float angle = (float)(Convert.ToSingle(args[2]) / 180.0 * Math.PI); | ||
524 | OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, angle); | ||
525 | |||
526 | SceneManager.ForEachSelectedScene(delegate(Scene scene) | ||
527 | { | ||
528 | scene.ForEachSOG(delegate(SceneObjectGroup sog) | ||
529 | { | ||
530 | if (sog.AttachmentPoint == 0) | ||
531 | { | ||
532 | sog.RootPart.UpdateRotation(rot * sog.GroupRotation); | ||
533 | Vector3 offset = sog.AbsolutePosition - new Vector3(128.0f, 128.0f, 0.0f); | ||
534 | offset *= rot; | ||
535 | sog.UpdateGroupPosition(new Vector3(128.0f, 128.0f, 0.0f) + offset); | ||
536 | } | ||
537 | }); | ||
538 | }); | ||
539 | } | ||
540 | |||
508 | /// <summary> | 541 | /// <summary> |
509 | /// Creates a new region based on the parameters specified. This will ask the user questions on the console | 542 | /// Creates a new region based on the parameters specified. This will ask the user questions on the console |
510 | /// </summary> | 543 | /// </summary> |