Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Movement/MoveToCommand.cs
Latif Khalifa ec5fc8de80 * Renamed AssetType.Object to AssetType.Primitive and AssetObject to AssetPrim to clear up confusion
* Big cleanup of group functions, moving things from MainAvatar to GroupManager, renaming BeginGet* to Request*, and adding new functions and callbacks
* Added an Autopilot function that takes doubles as input (very accurate autopilot)
* Added Settings.CONTINUOUS_AGENT_UPDATES which defaults to true
* Added quotes to the post-build event in VS2005
* Added empty AssetSound and AssetClothing, feel free to fill them in :-)
* Client.Self.*Name are read only properties now

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1357 52acb1d6-8a22-11de-b505-999d5b087335
2007-08-10 20:16:19 +00:00

35 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace libsecondlife.TestClient.Commands.Movement
{
class MovetoCommand : Command
{
public MovetoCommand(TestClient client)
{
Name = "moveto";
Description = "Moves the avatar to the specified global position using simulator autopilot.";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length != 3)
return "usage: moveto x y z";
uint regionX, regionY;
Helpers.LongToUInts(Client.Network.CurrentSim.Handle, out regionX, out regionY);
float x = Client.Self.Position.X + (ulong)regionX;
float y = Client.Self.Position.Y + (ulong)regionY;
float z = Client.Self.Position.Z;
float.TryParse(args[0], out x);
float.TryParse(args[1], out y);
float.TryParse(args[2], out z);
Client.Self.AutoPilot((ulong)x, (ulong)y, z);
return String.Format("Attempting to move to <{0},{1},{2}>", x, y, z);
}
}
}