mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Merge branch 'master' into varregion
This commit is contained in:
@@ -296,6 +296,11 @@ namespace OpenSim
|
||||
"Change the scale of a named prim",
|
||||
HandleEditScale);
|
||||
|
||||
m_console.Commands.AddCommand("Objects", false, "rotate scene",
|
||||
"rotate scene <degrees>",
|
||||
"Rotates all scene objects around x:128, y:128",
|
||||
HandleRotateScene);
|
||||
|
||||
m_console.Commands.AddCommand("Users", false, "kick user",
|
||||
"kick user <first> <last> [--force] [message]",
|
||||
"Kick a user off the simulator",
|
||||
@@ -505,6 +510,45 @@ namespace OpenSim
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleRotateScene(string module, string[] args)
|
||||
{
|
||||
string usage = "Usage: rotate scene <angle in degrees> [centerX centerY] (centerX and centerY are optional and default to Constants.RegionSize / 2";
|
||||
|
||||
float centerX = Constants.RegionSize * 0.5f;
|
||||
float centerY = Constants.RegionSize * 0.5f;
|
||||
|
||||
if (args.Length < 3 || args.Length == 4)
|
||||
{
|
||||
MainConsole.Instance.Output(usage);
|
||||
return;
|
||||
}
|
||||
|
||||
float angle = (float)(Convert.ToSingle(args[2]) / 180.0 * Math.PI);
|
||||
OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, angle);
|
||||
|
||||
if (args.Length > 4)
|
||||
{
|
||||
centerX = Convert.ToSingle(args[3]);
|
||||
centerY = Convert.ToSingle(args[4]);
|
||||
}
|
||||
|
||||
Vector3 center = new Vector3(centerX, centerY, 0.0f);
|
||||
|
||||
SceneManager.ForEachSelectedScene(delegate(Scene scene)
|
||||
{
|
||||
scene.ForEachSOG(delegate(SceneObjectGroup sog)
|
||||
{
|
||||
if (sog.AttachmentPoint == 0)
|
||||
{
|
||||
sog.RootPart.UpdateRotation(rot * sog.GroupRotation);
|
||||
Vector3 offset = sog.AbsolutePosition - center;
|
||||
offset *= rot;
|
||||
sog.UpdateGroupPosition(center + offset);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new region based on the parameters specified. This will ask the user questions on the console
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user