diff options
author | Justin Clark-Casey (justincc) | 2012-04-06 22:41:35 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-06 22:41:35 +0100 |
commit | 3af1cd65f91db87778096196bfd985dc48c72d87 (patch) | |
tree | ca8e542edc80688286e0aa9ca8b7326c1af06add /OpenSim/Region/ScriptEngine/Shared | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-3af1cd65f91db87778096196bfd985dc48c72d87.zip opensim-SC-3af1cd65f91db87778096196bfd985dc48c72d87.tar.gz opensim-SC-3af1cd65f91db87778096196bfd985dc48c72d87.tar.bz2 opensim-SC-3af1cd65f91db87778096196bfd985dc48c72d87.tar.xz |
Fix llGetLinkPrimParams for PRIM_POS_LOCAL for child prims whether in scene or attachments.
Return relative position to root prim rather than 0,0,0.
Should fix same issue with llGetLocalPos()
http://opensimulator.org/mantis/view.php?id=5951
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a85a36e..ad73f47 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2022,27 +2022,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2022 | protected LSL_Vector GetPartLocalPos(SceneObjectPart part) | 2022 | protected LSL_Vector GetPartLocalPos(SceneObjectPart part) |
2023 | { | 2023 | { |
2024 | m_host.AddScriptLPS(1); | 2024 | m_host.AddScriptLPS(1); |
2025 | |||
2026 | Vector3 pos; | ||
2027 | |||
2025 | if (part.ParentID == 0) | 2028 | if (part.ParentID == 0) |
2026 | { | 2029 | { |
2027 | return new LSL_Vector(part.AbsolutePosition.X, | 2030 | pos = part.AbsolutePosition; |
2028 | part.AbsolutePosition.Y, | ||
2029 | part.AbsolutePosition.Z); | ||
2030 | } | 2031 | } |
2031 | else | 2032 | else |
2032 | { | 2033 | { |
2033 | if (m_host.IsRoot) | 2034 | if (part.IsRoot) |
2034 | { | 2035 | { |
2035 | return new LSL_Vector(m_host.AttachedPos.X, | 2036 | pos = part.AttachedPos; |
2036 | m_host.AttachedPos.Y, | ||
2037 | m_host.AttachedPos.Z); | ||
2038 | } | 2037 | } |
2039 | else | 2038 | else |
2040 | { | 2039 | { |
2041 | return new LSL_Vector(part.OffsetPosition.X, | 2040 | pos = part.OffsetPosition; |
2042 | part.OffsetPosition.Y, | ||
2043 | part.OffsetPosition.Z); | ||
2044 | } | 2041 | } |
2045 | } | 2042 | } |
2043 | |||
2044 | // m_log.DebugFormat("[LSL API]: Returning {0} in GetPartLocalPos()", pos); | ||
2045 | |||
2046 | return new LSL_Vector(pos.X, pos.Y, pos.Z); | ||
2046 | } | 2047 | } |
2047 | 2048 | ||
2048 | public void llSetRot(LSL_Rotation rot) | 2049 | public void llSetRot(LSL_Rotation rot) |