From 099212167b2b3d5f8bdf529d24a6c47536716706 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 29 Aug 2014 23:40:21 +0100 Subject: Implement STATUS_BLOCK_GRAB_OBJECT in llSetStatus()/llGetStatus() and correct effect of STATUS_BLOCK_GRAB As per http://wiki.secondlife.com/wiki/LlSetStatus Setting STATUS_BLOCK_GRAB_OBJECT prevents or allows move of a physical linkset by grab on any prim. Setting STATUS_BLOCK_GRAB prevents or allows move of a physical linkset by grab on a particular prim. Previously, setting STATUS_BLOCK_GRAB would prevent drag via all prims of the linkset. --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 ++- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 16 ++++++++++++++-- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 18 +----------------- 3 files changed, 17 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 3678c7e..51f50d9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1446,8 +1446,9 @@ namespace OpenSim.Region.Framework.Scenes { if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) { - group.GrabMovement(offset, pos, remoteClient); + group.GrabMovement(objectID, offset, pos, remoteClient); } + // This is outside the above permissions condition // so that if the object is locked the client moving the object // get's it's position on the simulator even if it was the same as before diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e37bbd8..2aeccd8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -828,6 +828,12 @@ namespace OpenSim.Region.Framework.Scenes public UUID FromFolderID { get; set; } /// + /// If true then grabs are blocked no matter what the individual part BlockGrab setting. + /// + /// true if block grab override; otherwise, false. + public bool BlockGrabOverride { get; set; } + + /// /// IDs of all avatars sat on this scene object. /// /// @@ -2610,20 +2616,26 @@ namespace OpenSim.Region.Framework.Scenes /// If object is physical, apply force to move it around /// If object is not physical, just put it at the resulting location /// + /// Part ID to check for grab /// Always seems to be 0,0,0, so ignoring /// New position. We do the math here to turn it into a force /// - public void GrabMovement(Vector3 offset, Vector3 pos, IClientAPI remoteClient) + public void GrabMovement(UUID partID, Vector3 offset, Vector3 pos, IClientAPI remoteClient) { if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) { + SceneObjectPart part = GetPart(partID); + + if (part == null) + return; + PhysicsActor pa = m_rootPart.PhysActor; if (pa != null) { if (pa.IsPhysical) { - if (!m_rootPart.BlockGrab) + if (!BlockGrabOverride && !part.BlockGrab) { Vector3 llmoveforce = pos - AbsolutePosition; Vector3 grabforce = llmoveforce; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 05e3ee9..8785ca9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -186,7 +186,7 @@ namespace OpenSim.Region.Framework.Scenes public bool RETURN_AT_EDGE; - public bool BlockGrab; + public bool BlockGrab { get; set; } public bool StatusSandbox; @@ -2079,22 +2079,6 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.RootPart.RETURN_AT_EDGE = p; } - public bool GetBlockGrab() - { - if (ParentGroup.IsDeleted) - return false; - - return ParentGroup.RootPart.BlockGrab; - } - - public void SetBlockGrab(bool p) - { - if (ParentGroup.IsDeleted) - return; - - ParentGroup.RootPart.BlockGrab = p; - } - public void SetStatusSandbox(bool p) { if (ParentGroup.IsDeleted) -- cgit v1.1