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 else
{ {
//NonPhysicalGrabMovement(pos); NonPhysicalGrabMovement(pos);
} }
} }
else 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) public void NonPhysicalGrabMovement(Vector3 pos)
{ {
AbsolutePosition = pos; if(!IsAttachment && ScriptCount() == 0)
m_rootPart.SendTerseUpdateToAllClients(); UpdateGroupPosition(pos);
} }
/// <summary> /// <summary>
@ -2781,16 +2788,27 @@ namespace OpenSim.Region.Framework.Scenes
} }
else else
{ {
//NonPhysicalSpinMovement(pos); NonPhysicalSpinMovement(newOrientation);
} }
} }
else 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> /// <summary>
/// Set the name of a prim /// Set the name of a prim
/// </summary> /// </summary>