From d91f33b87b4578eb5e5a9ef22f383ed598cc28e2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 9 Jul 2007 19:56:22 +0000 Subject: Re-applied dalien patch (#175) and included bin\data with avataranimations.xml --- OpenSim/Region/ClientStack/ClientView.API.cs | 15 ++++++++++ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 33 +++++++++++++++++++--- 2 files changed, 44 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 5866b45..48d5b9d 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -528,6 +528,21 @@ namespace OpenSim.Region.ClientStack OutPacket(avp); } + public void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) + { + AvatarAnimationPacket ani = new AvatarAnimationPacket(); + ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; + ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); + 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; + this.OutPacket(ani); + } + #endregion #region Avatar Packet/data sending Methods diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index d335699..b0e7710 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -122,6 +122,8 @@ namespace OpenSim.Region.Environment.Scenes } Wearables = AvatarWearable.DefaultWearables; + Animations = new ScenePresence.AvatarAnimations(); + Animations.LoadAnims(); this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); @@ -274,9 +276,27 @@ namespace OpenSim.Region.Environment.Scenes { this.AddNewMovement(agent_control_v3, q); } - + UpdateMovementAnimations(update_movementflag); } + protected void UpdateMovementAnimations(bool update_movementflag) + { + if (update_movementflag) + { + if (movementflag != 0) { + if (this._physActor.Flying) { + this.SendAnimPack(Animations.AnimsLLUUID["FLY"], 1); + } else { + this.SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); + } + } else { + this.SendAnimPack(Animations.AnimsLLUUID["STAND"], 1); + } + } + + } + + protected void AddNewMovement(Vector3 vec, Quaternion rotation) { NewForce newVelocity = new NewForce(); @@ -403,8 +423,13 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendAnimPack(LLUUID animID, int seq) { - - + this.current_anim = animID; + this.anim_seq = anim_seq; + List avatars = this.m_world.RequestAvatarList(); + for (int i = 0; i < avatars.Count; i++) + { + avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId); + } } /// @@ -412,7 +437,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendAnimPack() { - + this.SendAnimPack(this.current_anim, this.anim_seq); } #endregion -- cgit v1.1