diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 676a940..1d93e9b 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,45 @@ 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> [centerX centerY] (centerX and centerY are optional and default to Constants.RegionSize / 2"; | ||
516 | |||
517 | float centerX = Constants.RegionSize * 0.5f; | ||
518 | float centerY = Constants.RegionSize * 0.5f; | ||
519 | |||
520 | if (args.Length < 3 || args.Length == 4) | ||
521 | { | ||
522 | MainConsole.Instance.Output(usage); | ||
523 | return; | ||
524 | } | ||
525 | |||
526 | float angle = (float)(Convert.ToSingle(args[2]) / 180.0 * Math.PI); | ||
527 | OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, angle); | ||
528 | |||
529 | if (args.Length > 4) | ||
530 | { | ||
531 | centerX = Convert.ToSingle(args[3]); | ||
532 | centerY = Convert.ToSingle(args[4]); | ||
533 | } | ||
534 | |||
535 | Vector3 center = new Vector3(centerX, centerY, 0.0f); | ||
536 | |||
537 | SceneManager.ForEachSelectedScene(delegate(Scene scene) | ||
538 | { | ||
539 | scene.ForEachSOG(delegate(SceneObjectGroup sog) | ||
540 | { | ||
541 | if (sog.AttachmentPoint == 0) | ||
542 | { | ||
543 | sog.RootPart.UpdateRotation(rot * sog.GroupRotation); | ||
544 | Vector3 offset = sog.AbsolutePosition - center; | ||
545 | offset *= rot; | ||
546 | sog.UpdateGroupPosition(center + offset); | ||
547 | } | ||
548 | }); | ||
549 | }); | ||
550 | } | ||
551 | |||
508 | /// <summary> | 552 | /// <summary> |
509 | /// Creates a new region based on the parameters specified. This will ask the user questions on the console | 553 | /// Creates a new region based on the parameters specified. This will ask the user questions on the console |
510 | /// </summary> | 554 | /// </summary> |