From 88d68e68c19107701ca8fbfb73413e0ea978b862 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 29 Jul 2012 15:40:31 +0200 Subject: [PATCH] Return world rotation on llGetObjectDetails()'s OBJECT_ROT --- .../Shared/Api/Implementation/LSL_Api.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fac249e5c9..cd72dc2d4b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -11846,11 +11846,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(new LSL_Vector(opos.X, opos.Y, opos.Z)); break; case ScriptBaseClass.OBJECT_ROT: -// Quaternion orot = obj.RotationOffset; -// ret.Add(new LSL_Rotation(orot.X, orot.Y, orot.Z, orot.W)); + { + Quaternion rot = Quaternion.Identity; - LSL_Rotation objrot = GetPartRot(obj); - ret.Add(objrot); + if (obj.ParentGroup.RootPart == obj) + rot = obj.ParentGroup.GroupRotation; + else + rot = obj.GetWorldRotation(); + + LSL_Rotation objrot = new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W); + ret.Add(objrot); + } break; case ScriptBaseClass.OBJECT_VELOCITY: Vector3 ovel = obj.Velocity;