diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 1547f9a9b6..5e798c0669 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -262,7 +262,7 @@ namespace OpenSim.Region.Framework.Scenes /// Returns a new unallocated local ID /// /// A brand new local ID - protected internal uint AllocateLocalId() + public uint AllocateLocalId() { uint myID; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index af466593bc..94e64e474b 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;