From 052f2b3e275b60777c51ca0274f33abce869c55d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 16 Feb 2010 14:36:08 +0000 Subject: minor: Make SOG.DelinkFromGroup() return the newly delinked scene object instead of void --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 35 +++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index af46659..94e64e4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -509,7 +509,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) m_rootPart.ParentID = 0; - if (m_rootPart.LocalId==0) + if (m_rootPart.LocalId == 0) m_rootPart.LocalId = m_scene.AllocateLocalId(); // No need to lock here since the object isn't yet in a scene @@ -1468,6 +1468,9 @@ namespace OpenSim.Region.Framework.Scenes /// internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) { +// m_log.DebugFormat( +// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); + if (m_rootPart.UUID == part.UUID) { if (IsAttachment) @@ -2284,7 +2287,6 @@ namespace OpenSim.Region.Framework.Scenes AttachToBackup(); - // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and // unmoved prims! @@ -2299,9 +2301,10 @@ namespace OpenSim.Region.Framework.Scenes /// an independent SceneObjectGroup. /// /// - public void DelinkFromGroup(uint partID) + /// The object group of the newly delinked prim. Null if part could not be found + public SceneObjectGroup DelinkFromGroup(uint partID) { - DelinkFromGroup(partID, true); + return DelinkFromGroup(partID, true); } /// @@ -2310,28 +2313,39 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - public void DelinkFromGroup(uint partID, bool sendEvents) + /// The object group of the newly delinked prim. Null if part could not be found + public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents) { SceneObjectPart linkPart = GetChildPart(partID); if (linkPart != null) { - DelinkFromGroup(linkPart, sendEvents); + return DelinkFromGroup(linkPart, sendEvents); } else { - m_log.InfoFormat("[SCENE OBJECT GROUP]: " + + m_log.WarnFormat("[SCENE OBJECT GROUP]: " + "DelinkFromGroup(): Child prim {0} not found in object {1}, {2}", partID, LocalId, UUID); + + return null; } } - public void DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents) + /// + /// Delink the given prim from this group. The delinked prim is established as + /// an independent SceneObjectGroup. + /// + /// + /// + /// The object group of the newly delinked prim. + public SceneObjectGroup DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents) { - linkPart.ClearUndoState(); // m_log.DebugFormat( // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); + + linkPart.ClearUndoState(); Quaternion worldRot = linkPart.GetWorldRotation(); @@ -2384,6 +2398,8 @@ namespace OpenSim.Region.Framework.Scenes //HasGroupChanged = true; //ScheduleGroupForFullUpdate(); + + return objectGroup; } /// @@ -2422,7 +2438,6 @@ namespace OpenSim.Region.Framework.Scenes part.LinkNum = linkNum; - part.OffsetPosition = part.GroupPosition - AbsolutePosition; Quaternion rootRotation = m_rootPart.RotationOffset; -- cgit v1.1