aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Environment/Scenes/AnimationSet.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs42
3 files changed, 44 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AnimationSet.cs b/OpenSim/Region/Environment/Scenes/AnimationSet.cs
index 0b7188a..df25173 100644
--- a/OpenSim/Region/Environment/Scenes/AnimationSet.cs
+++ b/OpenSim/Region/Environment/Scenes/AnimationSet.cs
@@ -38,6 +38,10 @@ namespace OpenSim.Region.Environment.Scenes
38 private Animation m_defaultAnimation = new Animation(); 38 private Animation m_defaultAnimation = new Animation();
39 private List<Animation> m_animations = new List<Animation>(); 39 private List<Animation> m_animations = new List<Animation>();
40 40
41 public Animation DefaultAnimation
42 {
43 get { return m_defaultAnimation; }
44 }
41 public AnimationSet() 45 public AnimationSet()
42 { 46 {
43 ResetDefaultAnimation(); 47 ResetDefaultAnimation();
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 321e164..f36e3aa 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -462,6 +462,11 @@ namespace OpenSim.Region.Environment.Scenes
462 get { return m_knownChildRegions; } 462 get { return m_knownChildRegions; }
463 } 463 }
464 464
465 public AnimationSet Animations
466 {
467 get { return m_animations; }
468 }
469
465 #endregion 470 #endregion
466 471
467 #region Constructor(s) 472 #region Constructor(s)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 060fde2..1462922 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4628,10 +4628,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4628 4628
4629 /// <summary> 4629 /// <summary>
4630 /// Not fully implemented yet. Still to do:- 4630 /// Not fully implemented yet. Still to do:-
4631 /// AGENT_SITTING
4632 /// AGENT_ON_OBJECT
4633 /// AGENT_IN_AIR
4634 /// AGENT_CROUCHING
4635 /// AGENT_BUSY 4631 /// AGENT_BUSY
4636 /// Remove as they are done 4632 /// Remove as they are done
4637 /// </summary> 4633 /// </summary>
@@ -4639,8 +4635,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4639 { 4635 {
4640 m_host.AddScriptLPS(1); 4636 m_host.AddScriptLPS(1);
4641 4637
4642 // This is partial implementation.
4643
4644 UUID key = new UUID(); 4638 UUID key = new UUID();
4645 if (!UUID.TryParse(id, out key)) 4639 if (!UUID.TryParse(id, out key))
4646 { 4640 {
@@ -4655,6 +4649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4655 return 0; 4649 return 0;
4656 } 4650 }
4657 4651
4652 // note: in OpenSim, sitting seems to cancel AGENT_ALWAYS_RUN, unlike SL
4658 if (agent.SetAlwaysRun) 4653 if (agent.SetAlwaysRun)
4659 { 4654 {
4660 flags |= ScriptBaseClass.AGENT_ALWAYS_RUN; 4655 flags |= ScriptBaseClass.AGENT_ALWAYS_RUN;
@@ -4670,6 +4665,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4670 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0) 4665 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0)
4671 { 4666 {
4672 flags |= ScriptBaseClass.AGENT_FLYING; 4667 flags |= ScriptBaseClass.AGENT_FLYING;
4668 flags |= ScriptBaseClass.AGENT_IN_AIR; // flying always implies in-air, even if colliding with e.g. a wall
4673 } 4669 }
4674 4670
4675 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AWAY) != 0) 4671 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AWAY) != 0)
@@ -4677,6 +4673,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4677 flags |= ScriptBaseClass.AGENT_AWAY; 4673 flags |= ScriptBaseClass.AGENT_AWAY;
4678 } 4674 }
4679 4675
4676 // seems to get unset, even if in mouselook, when avatar is sitting on a prim???
4680 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) 4677 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
4681 { 4678 {
4682 flags |= ScriptBaseClass.AGENT_MOUSELOOK; 4679 flags |= ScriptBaseClass.AGENT_MOUSELOOK;
@@ -4688,12 +4685,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4688 } 4685 }
4689 4686
4690 string agentMovementAnimation = agent.GetMovementAnimation(); 4687 string agentMovementAnimation = agent.GetMovementAnimation();
4688
4689 if (agentMovementAnimation == "CROUCH")
4690 {
4691 flags |= ScriptBaseClass.AGENT_CROUCHING;
4692 }
4693
4691 if (agentMovementAnimation == "WALK" || agentMovementAnimation == "CROUCHWALK") 4694 if (agentMovementAnimation == "WALK" || agentMovementAnimation == "CROUCHWALK")
4692 { 4695 {
4693 flags |= ScriptBaseClass.AGENT_WALKING; 4696 flags |= ScriptBaseClass.AGENT_WALKING;
4694 } 4697 }
4695 4698
4696 //NotImplemented("llGetAgentInfo"); 4699 // not colliding implies in air. Note: flying also implies in-air, even if colliding (see above)
4700
4701 // note: AGENT_IN_AIR and AGENT_WALKING seem to be mutually exclusive states in SL.
4702
4703 // note: this may need some tweaking when walking downhill. you "fall down" for a brief instant
4704 // and don't collide when walking downhill, which instantly registers as in-air, briefly. should
4705 // there be some minimum non-collision threshold time before claiming the avatar is in-air?
4706 if ((flags & ScriptBaseClass.AGENT_WALKING) == 0 &&
4707 agent.PhysicsActor != null &&
4708 !agent.PhysicsActor.IsColliding)
4709 {
4710 flags |= ScriptBaseClass.AGENT_IN_AIR;
4711 }
4712
4713 if (agent.ParentID != 0)
4714 {
4715 flags |= ScriptBaseClass.AGENT_ON_OBJECT;
4716 flags |= ScriptBaseClass.AGENT_SITTING;
4717 }
4718
4719 if (agent.Animations.DefaultAnimation.AnimID == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"])
4720 {
4721 flags |= ScriptBaseClass.AGENT_SITTING;
4722 }
4723
4724 //NotImplemented("llGetAgentInfo");
4697 4725
4698 return flags; 4726 return flags;
4699 } 4727 }