From 72d20b794a245f0e9b9e1f968b50067db2910b6c Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 Sep 2012 21:54:02 +0100 Subject: Revert "made setting rotation match Second Life" This reverts commit f7b88d1c40ba06c62491d8d32809fe6c1c4d360d. --- .../Shared/Api/Implementation/LSL_Api.cs | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c47893e..efeca26 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2314,7 +2314,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); } @@ -7846,12 +7862,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; @@ -8188,6 +8214,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; -- cgit v1.1