mirror of
https://github.com/TechplexEngineer/plexview.git
synced 2026-08-15 09:32:08 +00:00
I wish I could figure out how to have PlexVie be out of the LibOMV tree but its just not working die to a DLL not found exception about libopenjpeg. (Yes the dll is in the bin folder) This will do for now
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace OpenMetaverse.TestClient.Commands.Movement
|
|
{
|
|
class MovetoCommand : Command
|
|
{
|
|
public MovetoCommand(TestClient client)
|
|
{
|
|
Name = "moveto";
|
|
Description = "Moves the avatar to the specified global position using simulator autopilot. Usage: moveto x y z";
|
|
Category = CommandCategory.Movement;
|
|
}
|
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
|
{
|
|
if (args.Length != 3)
|
|
return "Usage: moveto x y z";
|
|
|
|
uint regionX, regionY;
|
|
Utils.LongToUInts(Client.Network.CurrentSim.Handle, out regionX, out regionY);
|
|
|
|
double x, y, z;
|
|
if (!Double.TryParse(args[0], out x) ||
|
|
!Double.TryParse(args[1], out y) ||
|
|
!Double.TryParse(args[2], out z))
|
|
{
|
|
return "Usage: moveto x y z";
|
|
}
|
|
|
|
// Convert the local coordinates to global ones by adding the region handle parts to x and y
|
|
x += (double)regionX;
|
|
y += (double)regionY;
|
|
|
|
Client.Self.AutoPilot(x, y, z);
|
|
|
|
return String.Format("Attempting to move to <{0},{1},{2}>", x, y, z);
|
|
}
|
|
}
|
|
}
|