Refactored animation handling in ScenePresence. Now maintains a list of current animations.

* Fixes weirdness when typing and sitting at the same time
* Should fix bug #32 (getting stuck in edit appearance pose)
* Crouchwalk and possibly jump may need more looking into
This commit is contained in:
Jeff Ames
2007-12-10 15:08:44 +00:00
parent 611327e104
commit 40fd37f95a
6 changed files with 135 additions and 98 deletions

View File

@@ -392,6 +392,7 @@ namespace OpenSim.Region.ClientStack
public event AgentSit OnAgentSit;
public event AvatarPickerRequest OnAvatarPickerRequest;
public event StartAnim OnStartAnim;
public event StopAnim OnStopAnim;
public event Action<IClientAPI> OnRequestAvatarsData;
public event LinkObjects OnLinkObjects;
public event DelinkObjects OnDelinkObjects;
@@ -1265,7 +1266,7 @@ namespace OpenSim.Region.ClientStack
OutPacket(avp, ThrottleOutPacketType.Task);
}
public void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId)
public void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId)
{
AvatarAnimationPacket ani = new AvatarAnimationPacket();
ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1];
@@ -1273,10 +1274,15 @@ namespace OpenSim.Region.ClientStack
ani.AnimationSourceList[0].ObjectID = sourceAgentId;
ani.Sender = new AvatarAnimationPacket.SenderBlock();
ani.Sender.ID = sourceAgentId;
ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1];
ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock();
ani.AnimationList[0].AnimID = animID;
ani.AnimationList[0].AnimSequenceID = seq;
ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[animations.Length];
for (int i = 0; i < animations.Length; ++i)
{
ani.AnimationList[i] = new AvatarAnimationPacket.AnimationListBlock();
ani.AnimationList[i].AnimID = animations[i];
ani.AnimationList[i].AnimSequenceID = seqs[i];
}
OutPacket(ani, ThrottleOutPacketType.Task);
}
@@ -2485,6 +2491,13 @@ namespace OpenSim.Region.ClientStack
OnStartAnim(this, AgentAni.AnimationList[i].AnimID, 1);
}
}
else
{
if (OnStopAnim != null)
{
OnStopAnim(this, AgentAni.AnimationList[i].AnimID);
}
}
}
break;
case PacketType.AgentRequestSit: