diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ec4f62f..31ce2c4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7983,9 +7983,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7983 | LSL_Rotation r = rules.GetQuaternionItem(idx++); | 7983 | LSL_Rotation r = rules.GetQuaternionItem(idx++); |
7984 | Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested world rotation | 7984 | Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested world rotation |
7985 | 7985 | ||
7986 | Quaternion srot = sitpart.GetWorldRotation(); | 7986 | // need to replicate SL bug |
7987 | rot *= Quaternion.Conjugate(srot); // removed sit part world rotation | ||
7988 | 7987 | ||
7988 | SceneObjectGroup sitgrp = sitpart.ParentGroup; | ||
7989 | if (sitgrp != null && sitgrp.RootPart != sitpart) | ||
7990 | { | ||
7991 | rot *= sitgrp.RootPart.RotationOffset; | ||
7992 | } | ||
7993 | |||
7994 | Quaternion srot = sitpart.GetWorldRotation(); | ||
7995 | rot = Quaternion.Conjugate(srot) * rot; // removed sit part world rotation | ||
7989 | av.Rotation = rot; | 7996 | av.Rotation = rot; |
7990 | av.SendAvatarDataToAllAgents(); | 7997 | av.SendAvatarDataToAllAgents(); |
7991 | } | 7998 | } |
@@ -8003,7 +8010,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8003 | Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested offset rotation | 8010 | Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested offset rotation |
8004 | 8011 | ||
8005 | Quaternion srot = sitpart.RotationOffset; | 8012 | Quaternion srot = sitpart.RotationOffset; |
8006 | rot *= Quaternion.Conjugate(srot); // remove sit part offset rotation | 8013 | rot = Quaternion.Conjugate(srot) * rot; // remove sit part offset rotation |
8007 | 8014 | ||
8008 | av.Rotation = rot; | 8015 | av.Rotation = rot; |
8009 | av.SendAvatarDataToAllAgents(); | 8016 | av.SendAvatarDataToAllAgents(); |