From 135e0ea853203cbad5790ac9f0b21d67f8828af8 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 7 Dec 2012 13:47:58 +0000 Subject: *TEST* add some avatar skeleton information and use it to calculate avatar height and bounding box. Change LSL acording. --- .../Shared/Api/Implementation/LSL_Api.cs | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6b63d94..7593395 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3013,7 +3013,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } bool result = money.ObjectGiveMoney( - m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, UUID.Zero); + m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount); if (result) return 1; @@ -6384,7 +6384,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - agentSize = new LSL_Vector(0.45, 0.6, avatar.Appearance.AvatarHeight); +// agentSize = new LSL_Vector(0.45f, 0.6f, avatar.Appearance.AvatarHeight); + Vector3 s = avatar.Appearance.AvatarSize; + agentSize = new LSL_Vector(s.X, s.Y, s.Z); } return agentSize; } @@ -8591,8 +8593,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // and standing avatar since server 1.36 LSL_Vector lower; LSL_Vector upper; + + Vector3 box = presence.Appearance.AvatarBoxSize * 0.5f; + if (presence.Animator.Animations.ImplicitDefaultAnimation.AnimID == DefaultAvatarAnimations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) +/* { // This is for ground sitting avatars float height = presence.Appearance.AvatarHeight / 2.66666667f; @@ -8610,6 +8616,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Adjust to the documented error offsets (see LSL Wiki) lower += new LSL_Vector(0.05f, 0.05f, 0.05f); upper -= new LSL_Vector(0.05f, 0.05f, 0.05f); +*/ + { + // This is for ground sitting avatars TODO! + lower = new LSL_Vector(-box.X - 0.1125, -box.Y, box.Z * -1.0f); + upper = new LSL_Vector(box.X + 0.1125, box.Y, box.Z * -1.0f); + } + else + { + // This is for standing/flying avatars + lower = new LSL_Vector(-box.X, -box.Y, -box.Z); + upper = new LSL_Vector(box.X, box.Y, box.Z); + } if (lower.x > upper.x) lower.x = upper.x; @@ -12529,7 +12547,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } bool result = money.ObjectGiveMoney( - m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn); + m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount); if (result) { @@ -12931,7 +12949,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_SIZE: // as in llGetAgentSize above - res.Add(new LSL_Vector(0.45f, 0.6f, avatar.Appearance.AvatarHeight)); +// res.Add(new LSL_Vector(0.45f, 0.6f, avatar.Appearance.AvatarHeight)); + Vector3 s = avatar.Appearance.AvatarSize; + res.Add(new LSL_Vector(s.X, s.Y, s.Z)); + break; case (int)ScriptBaseClass.PRIM_ROTATION: -- cgit v1.1