From ac7add070eb3d8e0ef3b42ff79005c1964df6eee Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 13 Nov 2006 07:46:22 +0000 Subject: [PATCH] Added an Animate() function, and less debugging noise in CopyBot git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@573 52acb1d6-8a22-11de-b505-999d5b087335 --- libsecondlife-cs/Avatar.cs | 26 ++++++++++++++++++++++++++ libsecondlife-cs/ObjectManager.cs | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/libsecondlife-cs/Avatar.cs b/libsecondlife-cs/Avatar.cs index d0531ab2..70a89dd8 100644 --- a/libsecondlife-cs/Avatar.cs +++ b/libsecondlife-cs/Avatar.cs @@ -545,6 +545,32 @@ namespace libsecondlife Client.Network.SendPacket((Packet)money); } + /// + /// Send an AgentAnimation packet that will toggle animations on or off + /// + /// A list of animation UUIDs, and whether to + /// turn that animation on or off + public void Animate(Dictionary animations) + { + AgentAnimationPacket animate = new AgentAnimationPacket(); + + animate.AgentData.AgentID = Client.Network.AgentID; + animate.AgentData.SessionID = Client.Network.SessionID; + animate.AnimationList = new AgentAnimationPacket.AnimationListBlock[animations.Count]; + int i = 0; + + foreach (KeyValuePair animation in animations) + { + animate.AnimationList[i] = new AgentAnimationPacket.AnimationListBlock(); + animate.AnimationList[i].AnimID = animation.Key; + animate.AnimationList[i].StartAnim = animation.Value; + + i++; + } + + Client.Network.SendPacket(animate); + } + /// /// Use the autopilot sim function to move the avatar to a new position /// diff --git a/libsecondlife-cs/ObjectManager.cs b/libsecondlife-cs/ObjectManager.cs index a4680ecc..861b28c5 100644 --- a/libsecondlife-cs/ObjectManager.cs +++ b/libsecondlife-cs/ObjectManager.cs @@ -51,6 +51,8 @@ namespace libsecondlife public LLQuaternion Rotation; /// public LLVector3 RotationVelocity; + /// + public TextureEntry Textures; } /// @@ -75,6 +77,8 @@ namespace libsecondlife public LLQuaternion Rotation; /// public LLVector3 RotationVelocity; + /// + public TextureEntry Textures; } /// @@ -783,6 +787,7 @@ namespace libsecondlife avupdate.Acceleration = Acceleration; avupdate.Rotation = Rotation; avupdate.RotationVelocity = RotationVelocity; + avupdate.Textures = new TextureEntry(block.TextureEntry, 0, block.TextureEntry.Length); if (OnAvatarMoved != null) { @@ -804,6 +809,7 @@ namespace libsecondlife primupdate.Acceleration = Acceleration; primupdate.Rotation = Rotation; primupdate.RotationVelocity = RotationVelocity; + primupdate.Textures = new TextureEntry(block.TextureEntry, 0, block.TextureEntry.Length); if (OnPrimMoved != null) {