From f11720d71fee66b7dc902c3a6632e571824e2288 Mon Sep 17 00:00:00 2001 From: AliciaRaven Date: Mon, 20 Apr 2015 05:36:39 +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 now. 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. Signed-off-by: Michael Cerquoni --- .../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..75da29953e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2672,20 +2672,26 @@ namespace OpenSim.Region.Framework.Scenes } else { - //NonPhysicalGrabMovement(pos); + NonPhysicalGrabMovement(pos); } } else { - //NonPhysicalGrabMovement(pos); + NonPhysicalGrabMovement(pos); } } } + /// + /// Apply possition for grabbing non-physical linksets (ctrl+drag) + /// + /// New Position public void NonPhysicalGrabMovement(Vector3 pos) { - AbsolutePosition = pos; - m_rootPart.SendTerseUpdateToAllClients(); + if((m_rootPart.Flags & PrimFlags.Scripted) == 0) + { + UpdateGroupPosition(pos); + } } /// @@ -2781,16 +2787,28 @@ 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) + /// + /// New Rotation + private void NonPhysicalSpinMovement(Quaternion newOrientation) + { + if ((m_rootPart.Flags & PrimFlags.Scripted) == 0) + { + UpdateGroupRotationR(newOrientation); + } + } + /// /// Set the name of a prim ///