diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-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> |