Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Movement/StandCommand.cs
axial 18da8ad9b4 Fixed(?) StandCommand in TestClient.
I'm not sure if this actually works, but it compiles now, which is a start!


git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1112 52acb1d6-8a22-11de-b505-999d5b087335
2007-04-10 11:23:10 +00:00

48 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.TestClient
{
public class StandCommand: Command
{
public StandCommand(TestClient testClient)
{
Name = "stand";
Description = "Stand";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
Client.Self.Status.StandUp = true;
stand(Client);
return "Standing up.";
}
void stand(SecondLife client)
{
SendAgentUpdate(client, (uint)MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP);
}
const float DRAW_DISTANCE = 96.0f;
void SendAgentUpdate(SecondLife client, uint ControlID)
{
AgentUpdatePacket p = new AgentUpdatePacket();
p.AgentData.Far = DRAW_DISTANCE;
//LLVector3 myPos = client.Self.Position;
p.AgentData.CameraCenter = new LLVector3(0, 0, 0);
p.AgentData.CameraAtAxis = new LLVector3(0, 0, 0);
p.AgentData.CameraLeftAxis = new LLVector3(0, 0, 0);
p.AgentData.CameraUpAxis = new LLVector3(0, 0, 0);
p.AgentData.HeadRotation = new LLQuaternion(0, 0, 0, 1); ;
p.AgentData.BodyRotation = new LLQuaternion(0, 0, 0, 1); ;
p.AgentData.AgentID = client.Network.AgentID;
p.AgentData.SessionID = client.Network.SessionID;
p.AgentData.ControlFlags = ControlID;
client.Network.SendPacket(p);
}
}
}