aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2012-07-16 11:03:12 +0200
committerMelanie2012-07-16 11:03:12 +0200
commit12049e1120559a36ea5fd0453a36210808d04363 (patch)
treed720eb7fd3dad3e516c1efe9aca6b52673d1bc5e
parentRemove instrumentation and fix the message delivery issue (diff)
downloadopensim-SC_OLD-12049e1120559a36ea5fd0453a36210808d04363.zip
opensim-SC_OLD-12049e1120559a36ea5fd0453a36210808d04363.tar.gz
opensim-SC_OLD-12049e1120559a36ea5fd0453a36210808d04363.tar.bz2
opensim-SC_OLD-12049e1120559a36ea5fd0453a36210808d04363.tar.xz
Allow setting linked avatar positions from within a prim not the one sat on
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs29
1 files changed, 18 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5bade25..595dd8a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2470,8 +2470,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2470 2470
2471 public LSL_Rotation llGetLocalRot() 2471 public LSL_Rotation llGetLocalRot()
2472 { 2472 {
2473 return GetPartLocalRot(m_host);
2474 }
2475
2476 private LSL_Rotation GetPartLocalRot(SceneObjectPart part)
2477 {
2473 m_host.AddScriptLPS(1); 2478 m_host.AddScriptLPS(1);
2474 Quaternion rot = m_host.RotationOffset; 2479 Quaternion rot = part.RotationOffset;
2475 return new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W); 2480 return new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W);
2476 } 2481 }
2477 2482
@@ -8029,10 +8034,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8029 8034
8030 LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION; 8035 LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION;
8031 LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR; 8036 LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR;
8032 if (llGetLinkNumber() > 1) 8037 if (part.LinkNum > 1)
8033 { 8038 {
8034 localRot = llGetLocalRot(); 8039 localRot = GetPartLocalRot(part);
8035 localPos = llGetLocalPos(); 8040 localPos = GetPartLocalPos(part);
8036 } 8041 }
8037 8042
8038 v -= localPos; 8043 v -= localPos;
@@ -8054,17 +8059,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8054 if (remain < 1) 8059 if (remain < 1)
8055 return; 8060 return;
8056 8061
8062 LSL_Rotation r;
8063 r = rules.GetQuaternionItem(idx++);
8064
8065 SceneObjectPart part = World.GetSceneObjectPart(av.ParentID);
8066 if (part == null)
8067 break;
8068
8057 LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION; 8069 LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION;
8058 LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR; 8070 LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR;
8059 8071
8060 if (llGetLinkNumber() > 1) 8072 if (part.LinkNum > 1)
8061 { 8073 localRot = GetPartLocalRot(part);
8062 localRot = llGetLocalRot();
8063 localPos = llGetLocalPos();
8064 }
8065 8074
8066 LSL_Rotation r;
8067 r = rules.GetQuaternionItem(idx++);
8068 r = r * llGetRootRotation() / localRot; 8075 r = r * llGetRootRotation() / localRot;
8069 av.Rotation = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); 8076 av.Rotation = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s);
8070 av.SendAvatarDataToAllAgents(); 8077 av.SendAvatarDataToAllAgents();