diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index fe9dd9b..c5a6171 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
546 | 546 | ||
547 | if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) | 547 | if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) |
548 | m_rootPart.ParentID = 0; | 548 | m_rootPart.ParentID = 0; |
549 | if (m_rootPart.LocalId==0) | 549 | if (m_rootPart.LocalId == 0) |
550 | m_rootPart.LocalId = m_scene.AllocateLocalId(); | 550 | m_rootPart.LocalId = m_scene.AllocateLocalId(); |
551 | 551 | ||
552 | // No need to lock here since the object isn't yet in a scene | 552 | // No need to lock here since the object isn't yet in a scene |
@@ -1505,6 +1505,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1505 | /// <param name="part"></param> | 1505 | /// <param name="part"></param> |
1506 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) | 1506 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) |
1507 | { | 1507 | { |
1508 | // m_log.DebugFormat( | ||
1509 | // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | ||
1510 | |||
1508 | if (m_rootPart.UUID == part.UUID) | 1511 | if (m_rootPart.UUID == part.UUID) |
1509 | { | 1512 | { |
1510 | if (IsAttachment) | 1513 | if (IsAttachment) |
@@ -2297,7 +2300,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2297 | 2300 | ||
2298 | AttachToBackup(); | 2301 | AttachToBackup(); |
2299 | 2302 | ||
2300 | |||
2301 | // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the | 2303 | // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the |
2302 | // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and | 2304 | // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and |
2303 | // unmoved prims! | 2305 | // unmoved prims! |
@@ -2312,9 +2314,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2312 | /// an independent SceneObjectGroup. | 2314 | /// an independent SceneObjectGroup. |
2313 | /// </summary> | 2315 | /// </summary> |
2314 | /// <param name="partID"></param> | 2316 | /// <param name="partID"></param> |
2315 | public void DelinkFromGroup(uint partID) | 2317 | /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns> |
2318 | public SceneObjectGroup DelinkFromGroup(uint partID) | ||
2316 | { | 2319 | { |
2317 | DelinkFromGroup(partID, true); | 2320 | return DelinkFromGroup(partID, true); |
2318 | } | 2321 | } |
2319 | 2322 | ||
2320 | /// <summary> | 2323 | /// <summary> |
@@ -2323,28 +2326,39 @@ namespace OpenSim.Region.Framework.Scenes | |||
2323 | /// </summary> | 2326 | /// </summary> |
2324 | /// <param name="partID"></param> | 2327 | /// <param name="partID"></param> |
2325 | /// <param name="sendEvents"></param> | 2328 | /// <param name="sendEvents"></param> |
2326 | public void DelinkFromGroup(uint partID, bool sendEvents) | 2329 | /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns> |
2330 | public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents) | ||
2327 | { | 2331 | { |
2328 | SceneObjectPart linkPart = GetChildPart(partID); | 2332 | SceneObjectPart linkPart = GetChildPart(partID); |
2329 | 2333 | ||
2330 | if (linkPart != null) | 2334 | if (linkPart != null) |
2331 | { | 2335 | { |
2332 | DelinkFromGroup(linkPart, sendEvents); | 2336 | return DelinkFromGroup(linkPart, sendEvents); |
2333 | } | 2337 | } |
2334 | else | 2338 | else |
2335 | { | 2339 | { |
2336 | m_log.InfoFormat("[SCENE OBJECT GROUP]: " + | 2340 | m_log.WarnFormat("[SCENE OBJECT GROUP]: " + |
2337 | "DelinkFromGroup(): Child prim {0} not found in object {1}, {2}", | 2341 | "DelinkFromGroup(): Child prim {0} not found in object {1}, {2}", |
2338 | partID, LocalId, UUID); | 2342 | partID, LocalId, UUID); |
2343 | |||
2344 | return null; | ||
2339 | } | 2345 | } |
2340 | } | 2346 | } |
2341 | 2347 | ||
2342 | public void DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents) | 2348 | /// <summary> |
2349 | /// Delink the given prim from this group. The delinked prim is established as | ||
2350 | /// an independent SceneObjectGroup. | ||
2351 | /// </summary> | ||
2352 | /// <param name="partID"></param> | ||
2353 | /// <param name="sendEvents"></param> | ||
2354 | /// <returns>The object group of the newly delinked prim.</returns> | ||
2355 | public SceneObjectGroup DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents) | ||
2343 | { | 2356 | { |
2344 | linkPart.ClearUndoState(); | ||
2345 | // m_log.DebugFormat( | 2357 | // m_log.DebugFormat( |
2346 | // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", | 2358 | // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", |
2347 | // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); | 2359 | // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); |
2360 | |||
2361 | linkPart.ClearUndoState(); | ||
2348 | 2362 | ||
2349 | Quaternion worldRot = linkPart.GetWorldRotation(); | 2363 | Quaternion worldRot = linkPart.GetWorldRotation(); |
2350 | 2364 | ||
@@ -2397,6 +2411,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2397 | 2411 | ||
2398 | //HasGroupChanged = true; | 2412 | //HasGroupChanged = true; |
2399 | //ScheduleGroupForFullUpdate(); | 2413 | //ScheduleGroupForFullUpdate(); |
2414 | |||
2415 | return objectGroup; | ||
2400 | } | 2416 | } |
2401 | 2417 | ||
2402 | /// <summary> | 2418 | /// <summary> |
@@ -2435,7 +2451,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2435 | 2451 | ||
2436 | part.LinkNum = linkNum; | 2452 | part.LinkNum = linkNum; |
2437 | 2453 | ||
2438 | |||
2439 | part.OffsetPosition = part.GroupPosition - AbsolutePosition; | 2454 | part.OffsetPosition = part.GroupPosition - AbsolutePosition; |
2440 | 2455 | ||
2441 | Quaternion rootRotation = m_rootPart.RotationOffset; | 2456 | Quaternion rootRotation = m_rootPart.RotationOffset; |