aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs33
1 files changed, 32 insertions, 1 deletions
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
2314 public void llSetRot(LSL_Rotation rot) 2314 public void llSetRot(LSL_Rotation rot)
2315 { 2315 {
2316 m_host.AddScriptLPS(1); 2316 m_host.AddScriptLPS(1);
2317
2318 // try to let this work as in SL...
2319 if (m_host.ParentID == 0)
2320 {
2321 // special case: If we are root, rotate complete SOG to new rotation
2317 SetRot(m_host, rot); 2322 SetRot(m_host, rot);
2323 }
2324 else
2325 {
2326 // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask.
2327 SceneObjectPart rootPart = m_host.ParentGroup.RootPart;
2328 if (rootPart != null) // better safe than sorry
2329 {
2330 SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot);
2331 }
2332 }
2333
2318 ScriptSleep(200); 2334 ScriptSleep(200);
2319 } 2335 }
2320 2336
@@ -7846,12 +7862,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7846 7862
7847 break; 7863 break;
7848 case (int)ScriptBaseClass.PRIM_ROTATION: 7864 case (int)ScriptBaseClass.PRIM_ROTATION:
7849 case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
7850 if (remain < 1) 7865 if (remain < 1)
7851 return null; 7866 return null;
7852 7867
7853 LSL_Rotation q = rules.GetQuaternionItem(idx++); 7868 LSL_Rotation q = rules.GetQuaternionItem(idx++);
7869 // try to let this work as in SL...
7870 if (part.ParentID == 0)
7871 {
7872 // special case: If we are root, rotate complete SOG to new rotation
7854 SetRot(part, q); 7873 SetRot(part, q);
7874 }
7875 else
7876 {
7877 // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask.
7878 SceneObjectPart rootPart = part.ParentGroup.RootPart;
7879 SetRot(part, rootPart.RotationOffset * (Quaternion)q);
7880 }
7855 7881
7856 break; 7882 break;
7857 7883
@@ -8188,6 +8214,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8188 string primDesc = rules.GetLSLStringItem(idx++); 8214 string primDesc = rules.GetLSLStringItem(idx++);
8189 part.Description = primDesc; 8215 part.Description = primDesc;
8190 break; 8216 break;
8217 case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
8218 if (remain < 1)
8219 return null;
8220 SetRot(part, rules.GetQuaternionItem(idx++));
8221 break;
8191 case (int)ScriptBaseClass.PRIM_OMEGA: 8222 case (int)ScriptBaseClass.PRIM_OMEGA:
8192 if (remain < 3) 8223 if (remain < 3)
8193 return null; 8224 return null;