As per the LL grid, for attachments make llGetObjectDetails() OBJECT_VELOCITY return the avatar's velocity and not always Vector3.Zero.

This completes http://opensimulator.org/mantis/view.php?id=7177
bullet-2.82
Justin Clark-Casey (justincc) 2014-08-30 00:58:47 +01:00
parent 4d8bc007e2
commit bb7c88805a
1 changed files with 15 additions and 1 deletions

View File

@ -11335,7 +11335,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break;
case ScriptBaseClass.OBJECT_VELOCITY:
ret.Add(new LSL_Vector(obj.Velocity));
Vector3 vel = Vector3.Zero;
if (obj.ParentGroup.IsAttachment)
{
ScenePresence sp = World.GetScenePresence(obj.ParentGroup.AttachedAvatar);
if (sp != null)
vel = sp.Velocity;
}
else
{
vel = obj.Velocity;
}
ret.Add(vel);
break;
case ScriptBaseClass.OBJECT_OWNER:
ret.Add(new LSL_String(obj.OwnerID.ToString()));