diff options
author | Justin Clark-Casey (justincc) | 2013-03-14 22:42:11 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-03-14 22:42:11 +0000 |
commit | 2a81eb8d45b4c2b1866479eec1bc906d0d6cf1a7 (patch) | |
tree | 6b2621d1a092f0404d85616c958e46b3a680420e /OpenSim | |
parent | Fix minor race condition in llGetGeometricCenter() if this was changing whils... (diff) | |
download | opensim-SC_OLD-2a81eb8d45b4c2b1866479eec1bc906d0d6cf1a7.zip opensim-SC_OLD-2a81eb8d45b4c2b1866479eec1bc906d0d6cf1a7.tar.gz opensim-SC_OLD-2a81eb8d45b4c2b1866479eec1bc906d0d6cf1a7.tar.bz2 opensim-SC_OLD-2a81eb8d45b4c2b1866479eec1bc906d0d6cf1a7.tar.xz |
Fix minor race conditions in LSL_Api.GetPrimParams() for PRIM_POSITION, PRIM_SIZE and PRIM_ROT_LOCAL
This function is used by all the various ll*Params() and os*Params() functions
Diffstat (limited to 'OpenSim')
-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 deaaa8a..8d5eea3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -8054,23 +8054,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8054 | break; | 8054 | break; |
8055 | 8055 | ||
8056 | case (int)ScriptBaseClass.PRIM_POSITION: | 8056 | case (int)ScriptBaseClass.PRIM_POSITION: |
8057 | LSL_Vector v = new LSL_Vector(part.AbsolutePosition.X, | 8057 | LSL_Vector v = new LSL_Vector(part.AbsolutePosition); |
8058 | part.AbsolutePosition.Y, | 8058 | |
8059 | part.AbsolutePosition.Z); | ||
8060 | // For some reason, the part.AbsolutePosition.* values do not change if the | 8059 | // For some reason, the part.AbsolutePosition.* values do not change if the |
8061 | // linkset is rotated; they always reflect the child prim's world position | 8060 | // linkset is rotated; they always reflect the child prim's world position |
8062 | // as though the linkset is unrotated. This is incompatible behavior with SL's | 8061 | // as though the linkset is unrotated. This is incompatible behavior with SL's |
8063 | // implementation, so will break scripts imported from there (not to mention it | 8062 | // implementation, so will break scripts imported from there (not to mention it |
8064 | // makes it more difficult to determine a child prim's actual inworld position). | 8063 | // makes it more difficult to determine a child prim's actual inworld position). |
8065 | if (part.ParentID != 0) | 8064 | if (!part.IsRoot) |
8066 | v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition(); | 8065 | { |
8066 | LSL_Vector rootPos = new LSL_Vector(m_host.ParentGroup.AbsolutePosition); | ||
8067 | v = ((v - rootPos) * llGetRootRotation()) + rootPos; | ||
8068 | } | ||
8069 | |||
8067 | res.Add(v); | 8070 | res.Add(v); |
8068 | break; | 8071 | break; |
8069 | 8072 | ||
8070 | case (int)ScriptBaseClass.PRIM_SIZE: | 8073 | case (int)ScriptBaseClass.PRIM_SIZE: |
8071 | res.Add(new LSL_Vector(part.Scale.X, | 8074 | res.Add(new LSL_Vector(part.Scale)); |
8072 | part.Scale.Y, | ||
8073 | part.Scale.Z)); | ||
8074 | break; | 8075 | break; |
8075 | 8076 | ||
8076 | case (int)ScriptBaseClass.PRIM_ROTATION: | 8077 | case (int)ScriptBaseClass.PRIM_ROTATION: |
@@ -8384,8 +8385,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8384 | case (int)ScriptBaseClass.PRIM_DESC: | 8385 | case (int)ScriptBaseClass.PRIM_DESC: |
8385 | res.Add(new LSL_String(part.Description)); | 8386 | res.Add(new LSL_String(part.Description)); |
8386 | break; | 8387 | break; |
8387 | case (int)ScriptBaseClass.PRIM_ROT_LOCAL: | 8388 | case (int)ScriptBaseClass.PRIM_ROT_LOCAL: |
8388 | res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W)); | 8389 | res.Add(new LSL_Rotation(part.RotationOffset)); |
8389 | break; | 8390 | break; |
8390 | case (int)ScriptBaseClass.PRIM_POS_LOCAL: | 8391 | case (int)ScriptBaseClass.PRIM_POS_LOCAL: |
8391 | res.Add(new LSL_Vector(GetPartLocalPos(part))); | 8392 | res.Add(new LSL_Vector(GetPartLocalPos(part))); |