mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
Applied animations patch (#175) submitted by dalien
This commit is contained in:
@@ -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
|
||||
/// <param name="seq"></param>
|
||||
public void SendAnimPack(LLUUID animID, int seq)
|
||||
{
|
||||
|
||||
|
||||
this.current_anim = animID;
|
||||
this.anim_seq = anim_seq;
|
||||
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
|
||||
for (int i = 0; i < avatars.Count; i++)
|
||||
{
|
||||
avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -412,7 +437,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
/// </summary>
|
||||
public void SendAnimPack()
|
||||
{
|
||||
|
||||
this.SendAnimPack(this.current_anim, this.anim_seq);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user