As per the LL grid, for attachments make llGetObjectDetails() OBJECT_ROT return the avatar's rotation.

This is already the behaviour of OBJECT_POS.
Partially satisfies http://opensimulator.org/mantis/view.php?id=7177
bullet-2.82
Justin Clark-Casey (justincc) 2014-08-30 00:48:59 +01:00
parent a02dae566c
commit 0cc3cdfb4e
1 changed files with 14 additions and 5 deletions

View File

@ -11313,17 +11313,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z)); ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z));
break; break;
case ScriptBaseClass.OBJECT_ROT: case ScriptBaseClass.OBJECT_ROT:
{ Quaternion rot = Quaternion.Identity;
Quaternion rot = Quaternion.Identity;
if (obj.ParentGroup.IsAttachment)
{
ScenePresence sp = World.GetScenePresence(obj.ParentGroup.AttachedAvatar);
if (sp != null)
rot = sp.GetWorldRotation();
}
else
{
if (obj.ParentGroup.RootPart == obj) if (obj.ParentGroup.RootPart == obj)
rot = obj.ParentGroup.GroupRotation; rot = obj.ParentGroup.GroupRotation;
else else
rot = obj.GetWorldRotation(); rot = obj.GetWorldRotation();
LSL_Rotation objrot = new LSL_Rotation(rot);
ret.Add(objrot);
} }
LSL_Rotation objrot = new LSL_Rotation(rot);
ret.Add(objrot);
break; break;
case ScriptBaseClass.OBJECT_VELOCITY: case ScriptBaseClass.OBJECT_VELOCITY:
ret.Add(new LSL_Vector(obj.Velocity)); ret.Add(new LSL_Vector(obj.Velocity));