From 3f6dfa92ab46bafbb1947f441aa1386d87c4576b Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 29 Jul 2012 16:05:35 +0100 Subject: Return world rotation on llGetObjectDetails()'s OBJECT_ROT --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 084bd41..c3b1f3d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -10446,7 +10446,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z)); break; case ScriptBaseClass.OBJECT_ROT: - ret.Add(new LSL_Rotation(obj.RotationOffset.X, obj.RotationOffset.Y, obj.RotationOffset.Z, obj.RotationOffset.W)); + { + Quaternion rot = Quaternion.Identity; + + 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: ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z)); -- cgit v1.1