From 359f9efc768d701460491b64b75660bf3c145419 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 Sep 2012 21:51:54 +0100 Subject: [PATCH 1/3] Revert "formatting" This reverts commit fb211c64fd9d335f4879549023870b1e28416f74. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 1 file changed, 2 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 1d2ef40367..6f4bc8b1ea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2083,7 +2083,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetRot(LSL_Rotation rot) { m_host.AddScriptLPS(1); - SetRot(m_host, rot); + SetRot(m_host, rot); ScriptSleep(200); } @@ -7280,7 +7280,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (remain < 1) return null; - SetRot(part, rules.GetQuaternionItem(idx++)); + SetRot(part, rules.GetQuaternionItem(idx++)); break; From 29218cdb3169b70e047acc372433769ece3ffae1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 Sep 2012 21:52:03 +0100 Subject: [PATCH 2/3] Revert "no need to assign rotation to a variable now" This reverts commit a3d140b57c5e2ae0f3334d59b82e116d40199b49. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6f4bc8b1ea..9f952d10a9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7280,7 +7280,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (remain < 1) return null; - SetRot(part, rules.GetQuaternionItem(idx++)); + LSL_Rotation q = rules.GetQuaternionItem(idx++); + SetRot(part, q); break; From d297eb39e57f9dc70abe43839e263af19b5777e2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 Sep 2012 21:52:12 +0100 Subject: [PATCH 3/3] Revert "made setting rotation match Second Life" Second Life seems to have introduced a bug, as we have confirmation that SL behavior changed recently and changed in contradiction to their stated intention This appears to be another of the bugs SL is notorious for. Signpost and I have decided to back this out until SL's intention becomes clear. This reverts commit f7b88d1c40ba06c62491d8d32809fe6c1c4d360d. --- .../Shared/Api/Implementation/LSL_Api.cs | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9f952d10a9..be22cb4fee 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2083,7 +2083,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetRot(LSL_Rotation rot) { m_host.AddScriptLPS(1); + + // try to let this work as in SL... + if (m_host.ParentID == 0) + { + // special case: If we are root, rotate complete SOG to new rotation SetRot(m_host, rot); + } + else + { + // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. + SceneObjectPart rootPart = m_host.ParentGroup.RootPart; + if (rootPart != null) // better safe than sorry + { + SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot); + } + } + ScriptSleep(200); } @@ -7276,12 +7292,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_ROTATION: - case (int)ScriptBaseClass.PRIM_ROT_LOCAL: if (remain < 1) return null; LSL_Rotation q = rules.GetQuaternionItem(idx++); + // try to let this work as in SL... + if (part.ParentID == 0) + { + // special case: If we are root, rotate complete SOG to new rotation SetRot(part, q); + } + else + { + // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. + SceneObjectPart rootPart = part.ParentGroup.RootPart; + SetRot(part, rootPart.RotationOffset * (Quaternion)q); + } break; @@ -7588,6 +7614,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api string primDesc = rules.GetLSLStringItem(idx++); part.Description = primDesc; break; + case (int)ScriptBaseClass.PRIM_ROT_LOCAL: + if (remain < 1) + return null; + SetRot(part, rules.GetQuaternionItem(idx++)); + break; case (int)ScriptBaseClass.PRIM_OMEGA: if (remain < 3) return null;