aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorCharles Krinke2008-10-22 23:07:45 +0000
committerCharles Krinke2008-10-22 23:07:45 +0000
commitf919b861564a6153fd290ee46ead51f660f08834 (patch)
tree8d340cb3c40880ff8177eeeb70f5113250c2a2cc /OpenSim
parent- Final fixes to the code coverage test (nant test-cov). (diff)
downloadopensim-SC_OLD-f919b861564a6153fd290ee46ead51f660f08834.zip
opensim-SC_OLD-f919b861564a6153fd290ee46ead51f660f08834.tar.gz
opensim-SC_OLD-f919b861564a6153fd290ee46ead51f660f08834.tar.bz2
opensim-SC_OLD-f919b861564a6153fd290ee46ead51f660f08834.tar.xz
Thank you kindly, Idb for a patch that:
Added AGENT_ATTACHMENTS and AGENT_SCRIPTED to llGetAgentInfo Added to llGetAgentSize to include shoes in avatar height calculation.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs21
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs20
2 files changed, 40 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 4346b08..321e164 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -2447,6 +2447,27 @@ namespace OpenSim.Region.Environment.Scenes
2447 } 2447 }
2448 } 2448 }
2449 2449
2450 public bool HasAttachments()
2451 {
2452 return m_attachments.Count > 0;
2453 }
2454
2455 public bool HasScriptedAttachments()
2456 {
2457 lock (m_attachments)
2458 {
2459 foreach (SceneObjectGroup gobj in m_attachments)
2460 {
2461 if (gobj != null)
2462 {
2463 if (gobj.RootPart.ContainsScripts())
2464 return true;
2465 }
2466 }
2467 }
2468 return false;
2469 }
2470
2450 public void RemoveAttachment(SceneObjectGroup gobj) 2471 public void RemoveAttachment(SceneObjectGroup gobj)
2451 { 2472 {
2452 lock (m_attachments) 2473 lock (m_attachments)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 9745ae6..060fde2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4626,6 +4626,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4626 return 0; 4626 return 0;
4627 } 4627 }
4628 4628
4629 /// <summary>
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
4636 /// Remove as they are done
4637 /// </summary>
4629 public LSL_Integer llGetAgentInfo(string id) 4638 public LSL_Integer llGetAgentInfo(string id)
4630 { 4639 {
4631 m_host.AddScriptLPS(1); 4640 m_host.AddScriptLPS(1);
@@ -4651,6 +4660,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4651 flags |= ScriptBaseClass.AGENT_ALWAYS_RUN; 4660 flags |= ScriptBaseClass.AGENT_ALWAYS_RUN;
4652 } 4661 }
4653 4662
4663 if (agent.HasAttachments())
4664 {
4665 flags |= ScriptBaseClass.AGENT_ATTACHMENTS;
4666 if (agent.HasScriptedAttachments())
4667 flags |= ScriptBaseClass.AGENT_SCRIPTED;
4668 }
4669
4654 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0) 4670 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0)
4655 { 4671 {
4656 flags |= ScriptBaseClass.AGENT_FLYING; 4672 flags |= ScriptBaseClass.AGENT_FLYING;
@@ -4900,9 +4916,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4900 // in edit appearance in SL to find the ones that affected the height and how 4916 // in edit appearance in SL to find the ones that affected the height and how
4901 // much they affected it. 4917 // much they affected it.
4902 float avatarHeight = 1.23077f // Shortest possible avatar height 4918 float avatarHeight = 1.23077f // Shortest possible avatar height
4903 + 0.516945f * (float)parms[25] / 255.0f // Body length 4919 + 0.516945f * (float)parms[25] / 255.0f // Body height
4904 + 0.072514f * (float)parms[120] / 255.0f // Head size 4920 + 0.072514f * (float)parms[120] / 255.0f // Head size
4905 + 0.3836f * (float)parms[125] / 255.0f // Leg length 4921 + 0.3836f * (float)parms[125] / 255.0f // Leg length
4922 + 0.08f * (float)parms[77] / 255.0f // Shoe heel height
4923 + 0.07f * (float)parms[78] / 255.0f // Shoe platform height
4906 + 0.076f * (float)parms[148] / 255.0f; // Neck length 4924 + 0.076f * (float)parms[148] / 255.0f; // Neck length
4907 agentSize = new LSL_Vector(0.45, 0.6, avatarHeight); 4925 agentSize = new LSL_Vector(0.45, 0.6, avatarHeight);
4908 } 4926 }