From f919b861564a6153fd290ee46ead51f660f08834 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 22 Oct 2008 23:07:45 +0000 Subject: 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. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 21 +++++++++++++++++++++ .../Shared/Api/Implementation/LSL_Api.cs | 20 +++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) 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 } } + public bool HasAttachments() + { + return m_attachments.Count > 0; + } + + public bool HasScriptedAttachments() + { + lock (m_attachments) + { + foreach (SceneObjectGroup gobj in m_attachments) + { + if (gobj != null) + { + if (gobj.RootPart.ContainsScripts()) + return true; + } + } + } + return false; + } + public void RemoveAttachment(SceneObjectGroup gobj) { 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 return 0; } + /// + /// Not fully implemented yet. Still to do:- + /// AGENT_SITTING + /// AGENT_ON_OBJECT + /// AGENT_IN_AIR + /// AGENT_CROUCHING + /// AGENT_BUSY + /// Remove as they are done + /// public LSL_Integer llGetAgentInfo(string id) { m_host.AddScriptLPS(1); @@ -4651,6 +4660,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api flags |= ScriptBaseClass.AGENT_ALWAYS_RUN; } + if (agent.HasAttachments()) + { + flags |= ScriptBaseClass.AGENT_ATTACHMENTS; + if (agent.HasScriptedAttachments()) + flags |= ScriptBaseClass.AGENT_SCRIPTED; + } + if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0) { flags |= ScriptBaseClass.AGENT_FLYING; @@ -4900,9 +4916,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // in edit appearance in SL to find the ones that affected the height and how // much they affected it. float avatarHeight = 1.23077f // Shortest possible avatar height - + 0.516945f * (float)parms[25] / 255.0f // Body length + + 0.516945f * (float)parms[25] / 255.0f // Body height + 0.072514f * (float)parms[120] / 255.0f // Head size + 0.3836f * (float)parms[125] / 255.0f // Leg length + + 0.08f * (float)parms[77] / 255.0f // Shoe heel height + + 0.07f * (float)parms[78] / 255.0f // Shoe platform height + 0.076f * (float)parms[148] / 255.0f; // Neck length agentSize = new LSL_Vector(0.45, 0.6, avatarHeight); } -- cgit v1.1