aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-13 20:56:56 +0000
committerJustin Clarke Casey2008-10-13 20:56:56 +0000
commit308a0bc2e46d0a3ce805b0603392d50ca171b53d (patch)
tree53b41b1d2b893fda471441fb837b24a9475f3a42 /OpenSim/Region/ScriptEngine/Shared
parent* Remove warnings, including one which pointed out a bug (diff)
downloadopensim-SC-308a0bc2e46d0a3ce805b0603392d50ca171b53d.zip
opensim-SC-308a0bc2e46d0a3ce805b0603392d50ca171b53d.tar.gz
opensim-SC-308a0bc2e46d0a3ce805b0603392d50ca171b53d.tar.bz2
opensim-SC-308a0bc2e46d0a3ce805b0603392d50ca171b53d.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2249
* Calculate an agents height in LLGetAgentSize() from apperance parameters rather than physics avatar numbers * Another good looking patch from idb - thanks!
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 428aeb6..7993d95 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4636,6 +4636,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4636 return World.GetLandOwner((float)pos.x, (float)pos.y).ToString(); 4636 return World.GetLandOwner((float)pos.x, (float)pos.y).ToString();
4637 } 4637 }
4638 4638
4639 /// <summary>
4640 /// According to http://lslwiki.net/lslwiki/wakka.php?wakka=llGetAgentSize
4641 /// only the height of avatars vary and that says:-
4642 /// Width (x) and depth (y) are constant. (0.45m and 0.6m respectively).
4643 /// </summary>
4639 public LSL_Vector llGetAgentSize(string id) 4644 public LSL_Vector llGetAgentSize(string id)
4640 { 4645 {
4641 m_host.AddScriptLPS(1); 4646 m_host.AddScriptLPS(1);
@@ -4647,8 +4652,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4647 } 4652 }
4648 else 4653 else
4649 { 4654 {
4650 PhysicsVector size = avatar.PhysicsActor.Size; 4655 byte[] parms = avatar.Appearance.VisualParams;
4651 agentSize = new LSL_Vector(size.X, size.Y, size.Z); 4656 // The values here were arrived at from experimentation with the sliders
4657 // in edit appearance in SL to find the ones that affected the height and how
4658 // much they affected it.
4659 float avatarHeight = 1.23077f // Shortest possible avatar height
4660 + 0.516945f * (float)parms[25] / 255.0f // Body length
4661 + 0.072514f * (float)parms[120] / 255.0f // Head size
4662 + 0.3836f * (float)parms[125] / 255.0f // Leg length
4663 + 0.076f * (float)parms[148] / 255.0f; // Neck length
4664 agentSize = new LSL_Vector(0.45, 0.6, avatarHeight);
4652 } 4665 }
4653 return agentSize; 4666 return agentSize;
4654 } 4667 }