aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorMelanie2012-06-02 02:01:48 +0100
committerMelanie2012-06-02 02:01:48 +0100
commit8e735efff0849c45dd24ae15dfdf34f7959701c5 (patch)
tree55b5f15068782e2dba04deb4d0e8b1ff90140cba /OpenSim/Region/ScriptEngine/Shared
parentMerge branch 'master' into careminster (diff)
parentFix LSL animation state reporting and animation state transitions on crossing (diff)
downloadopensim-SC-8e735efff0849c45dd24ae15dfdf34f7959701c5.zip
opensim-SC-8e735efff0849c45dd24ae15dfdf34f7959701c5.tar.gz
opensim-SC-8e735efff0849c45dd24ae15dfdf34f7959701c5.tar.bz2
opensim-SC-8e735efff0849c45dd24ae15dfdf34f7959701c5.tar.xz
Merge branch 'avination' into careminster
Conflicts: OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs40
1 files changed, 33 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 2700495..3b8efd5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -116,6 +116,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
116 protected Timer m_ShoutSayTimer; 116 protected Timer m_ShoutSayTimer;
117 protected int m_SayShoutCount = 0; 117 protected int m_SayShoutCount = 0;
118 118
119 private Dictionary<string, string> MovementAnimationsForLSL =
120 new Dictionary<string, string> {
121 {"FLY", "Flying"},
122 {"FLYSLOW", "FlyingSlow"},
123 {"HOVER_UP", "Hovering Up"},
124 {"HOVER_DOWN", "Hovering Down"},
125 {"HOVER", "Hovering"},
126 {"LAND", "Landing"},
127 {"FALLDOWN", "Falling Down"},
128 {"PREJUMP", "PreJumping"},
129 {"JUMP", "Jumping"},
130 {"STANDUP", "Standing Up"},
131 {"SOFT_LAND", "Soft Landing"},
132 {"STAND", "Standing"},
133 {"CROUCHWALK", "CrouchWalking"},
134 {"RUN", "Running"},
135 {"WALK", "Walking"},
136 {"CROUCH", "Crouching"},
137 {"TURNLEFT", "Turning Left"},
138 {"TURNRIGHT", "Turning Right"}
139 };
140
119 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) 141 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
120 { 142 {
121 m_ShoutSayTimer = new Timer(1000); 143 m_ShoutSayTimer = new Timer(1000);
@@ -2485,7 +2507,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2485 } 2507 }
2486 else 2508 else
2487 { 2509 {
2488 vel = m_host.Velocity; 2510 vel = m_host.ParentGroup.RootPart.Velocity;
2489 } 2511 }
2490 2512
2491 return new LSL_Vector(vel.X, vel.Y, vel.Z); 2513 return new LSL_Vector(vel.X, vel.Y, vel.Z);
@@ -4652,14 +4674,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4652 4674
4653 if (m_host.RegionHandle == presence.RegionHandle) 4675 if (m_host.RegionHandle == presence.RegionHandle)
4654 { 4676 {
4655 Dictionary<UUID, string> animationstateNames = DefaultAvatarAnimations.AnimStateNames;
4656
4657 if (presence != null) 4677 if (presence != null)
4658 { 4678 {
4659 AnimationSet currentAnims = presence.Animator.Animations; 4679 if (presence.SitGround)
4660 string currentAnimationState = String.Empty; 4680 return "Sitting on Ground";
4661 if (animationstateNames.TryGetValue(currentAnims.DefaultAnimation.AnimID, out currentAnimationState)) 4681 if (presence.ParentID != 0 || presence.ParentUUID != UUID.Zero)
4662 return currentAnimationState; 4682 return "Sitting";
4683
4684 string movementAnimation = presence.Animator.CurrentMovementAnimation;
4685 string lslMovementAnimation;
4686
4687 if (MovementAnimationsForLSL.TryGetValue(movementAnimation, out lslMovementAnimation))
4688 return lslMovementAnimation;
4663 } 4689 }
4664 } 4690 }
4665 4691