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.
0.6.0-stable
Charles Krinke 2008-10-22 23:07:45 +00:00
parent 2e8730055b
commit f919b86156
2 changed files with 40 additions and 1 deletions

View File

@ -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)

View File

@ -4626,6 +4626,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0;
}
/// <summary>
/// Not fully implemented yet. Still to do:-
/// AGENT_SITTING
/// AGENT_ON_OBJECT
/// AGENT_IN_AIR
/// AGENT_CROUCHING
/// AGENT_BUSY
/// Remove as they are done
/// </summary>
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);
}