From cb586d11582fa2641fe99edc6367edc800af0ba0 Mon Sep 17 00:00:00 2001 From: AliciaRaven Date: Mon, 4 May 2015 04:10:08 +0100 Subject: [PATCH] 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 --- .../Framework/Scenes/SceneObjectGroup.cs | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 0a1a226c36..866a43c1a9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2672,20 +2672,27 @@ namespace OpenSim.Region.Framework.Scenes } else { - //NonPhysicalGrabMovement(pos); + NonPhysicalGrabMovement(pos); } } else { - //NonPhysicalGrabMovement(pos); + NonPhysicalGrabMovement(pos); } } } + /// + /// 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. + /// + /// New Position public void NonPhysicalGrabMovement(Vector3 pos) { - AbsolutePosition = pos; - m_rootPart.SendTerseUpdateToAllClients(); + if(!IsAttachment && ScriptCount() == 0) + UpdateGroupPosition(pos); } /// @@ -2781,16 +2788,27 @@ namespace OpenSim.Region.Framework.Scenes } else { - //NonPhysicalSpinMovement(pos); + NonPhysicalSpinMovement(newOrientation); } } else { - //NonPhysicalSpinMovement(pos); + NonPhysicalSpinMovement(newOrientation); } } } + /// + /// Apply rotation for spinning non-physical linksets (Ctrl+Shift+Drag) + /// As with dragging, scripted objects must be blocked from spinning + /// + /// New Rotation + private void NonPhysicalSpinMovement(Quaternion newOrientation) + { + if(!IsAttachment && ScriptCount() == 0) + UpdateGroupRotationR(newOrientation); + } + /// /// Set the name of a prim ///