Enable grab feature (Ctrl+Drag) for non-physical link-sets and add code to handle spin (Ctrl+Shift+Drag)

This patch fixes permission issues with dragging scripted objects. As on LL grid, scripted prims can not be dragged. Also after dragging, the group was not marked as updated. This meant that after the region was restarted the group would revert to its original position. This version fixes issues where scripts in child prims were not detected and also blocks grab for attachments.

Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
fsassets
AliciaRaven 2015-05-04 04:10:08 +01:00 committed by BlueWall
parent 7566d22a18
commit cb586d1158
1 changed files with 24 additions and 6 deletions

View File

@ -2672,20 +2672,27 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
//NonPhysicalGrabMovement(pos);
NonPhysicalGrabMovement(pos);
}
}
else
{
//NonPhysicalGrabMovement(pos);
NonPhysicalGrabMovement(pos);
}
}
}
/// <summary>
/// Apply possition for grabbing non-physical linksets (Ctrl+Drag)
/// This MUST be blocked for linksets that contain touch scripts because the viewer triggers grab on the touch
/// event (Viewer Bug?) This would allow anyone to drag a linkset with a touch script. SL behaviour is also to
/// block grab on prims with touch events.
/// </summary>
/// <param name="pos">New Position</param>
public void NonPhysicalGrabMovement(Vector3 pos)
{
AbsolutePosition = pos;
m_rootPart.SendTerseUpdateToAllClients();
if(!IsAttachment && ScriptCount() == 0)
UpdateGroupPosition(pos);
}
/// <summary>
@ -2781,16 +2788,27 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
//NonPhysicalSpinMovement(pos);
NonPhysicalSpinMovement(newOrientation);
}
}
else
{
//NonPhysicalSpinMovement(pos);
NonPhysicalSpinMovement(newOrientation);
}
}
}
/// <summary>
/// Apply rotation for spinning non-physical linksets (Ctrl+Shift+Drag)
/// As with dragging, scripted objects must be blocked from spinning
/// </summary>
/// <param name="newOrientation">New Rotation</param>
private void NonPhysicalSpinMovement(Quaternion newOrientation)
{
if(!IsAttachment && ScriptCount() == 0)
UpdateGroupRotationR(newOrientation);
}
/// <summary>
/// Set the name of a prim
/// </summary>