Fix LSL animation state reporting and animation state transitions on crossing
parent
d8f6faa89e
commit
928e3e9e21
|
@ -867,7 +867,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
IsChildAgent = false;
|
||||
|
||||
Animator.TrySetMovementAnimation("SIT");
|
||||
// Animator.TrySetMovementAnimation("SIT");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -111,6 +111,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
protected Timer m_ShoutSayTimer;
|
||||
protected int m_SayShoutCount = 0;
|
||||
|
||||
private Dictionary<string, string> MovementAnimationsForLSL =
|
||||
new Dictionary<string, string> {
|
||||
{"FLY", "Flying"},
|
||||
{"FLYSLOW", "FlyingSlow"},
|
||||
{"HOVER_UP", "Hovering Up"},
|
||||
{"HOVER_DOWN", "Hovering Down"},
|
||||
{"HOVER", "Hovering"},
|
||||
{"LAND", "Landing"},
|
||||
{"FALLDOWN", "Falling Down"},
|
||||
{"PREJUMP", "PreJumping"},
|
||||
{"JUMP", "Jumping"},
|
||||
{"STANDUP", "Standing Up"},
|
||||
{"SOFT_LAND", "Soft Landing"},
|
||||
{"STAND", "Standing"},
|
||||
{"CROUCHWALK", "CrouchWalking"},
|
||||
{"RUN", "Running"},
|
||||
{"WALK", "Walking"},
|
||||
{"CROUCH", "Crouching"},
|
||||
{"TURNLEFT", "Turning Left"},
|
||||
{"TURNRIGHT", "Turning Right"}
|
||||
};
|
||||
|
||||
public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
|
||||
{
|
||||
m_ShoutSayTimer = new Timer(1000);
|
||||
|
@ -2523,7 +2545,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
else
|
||||
{
|
||||
vel = m_host.Velocity;
|
||||
vel = m_host.ParentGroup.RootPart.Velocity;
|
||||
}
|
||||
|
||||
return new LSL_Vector(vel.X, vel.Y, vel.Z);
|
||||
|
@ -4820,14 +4842,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
if (m_host.RegionHandle == presence.RegionHandle)
|
||||
{
|
||||
Dictionary<UUID, string> animationstateNames = DefaultAvatarAnimations.AnimStateNames;
|
||||
|
||||
if (presence != null)
|
||||
{
|
||||
AnimationSet currentAnims = presence.Animator.Animations;
|
||||
string currentAnimationState = String.Empty;
|
||||
if (animationstateNames.TryGetValue(currentAnims.DefaultAnimation.AnimID, out currentAnimationState))
|
||||
return currentAnimationState;
|
||||
if (presence.SitGround)
|
||||
return "Sitting on Ground";
|
||||
if (presence.ParentID != 0 || presence.ParentUUID != UUID.Zero)
|
||||
return "Sitting";
|
||||
|
||||
string movementAnimation = presence.Animator.CurrentMovementAnimation;
|
||||
string lslMovementAnimation;
|
||||
|
||||
if (MovementAnimationsForLSL.TryGetValue(movementAnimation, out lslMovementAnimation))
|
||||
return lslMovementAnimation;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue