aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-02-16 14:36:08 +0000
committerJustin Clark-Casey (justincc)2010-02-16 14:36:08 +0000
commit052f2b3e275b60777c51ca0274f33abce869c55d (patch)
treea42df99e94f411822c8f889fcd944af72b333874 /OpenSim/Region/Framework
parentminor: update CONTRIBUTORS.txt (diff)
downloadopensim-SC-052f2b3e275b60777c51ca0274f33abce869c55d.zip
opensim-SC-052f2b3e275b60777c51ca0274f33abce869c55d.tar.gz
opensim-SC-052f2b3e275b60777c51ca0274f33abce869c55d.tar.bz2
opensim-SC-052f2b3e275b60777c51ca0274f33abce869c55d.tar.xz
minor: Make SOG.DelinkFromGroup() return the newly delinked scene object instead of void
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs35
2 files changed, 26 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 1547f9a..5e798c0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Framework.Scenes
262 /// Returns a new unallocated local ID 262 /// Returns a new unallocated local ID
263 /// </summary> 263 /// </summary>
264 /// <returns>A brand new local ID</returns> 264 /// <returns>A brand new local ID</returns>
265 protected internal uint AllocateLocalId() 265 public uint AllocateLocalId()
266 { 266 {
267 uint myID; 267 uint myID;
268 268
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
509 509
510 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) 510 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
511 m_rootPart.ParentID = 0; 511 m_rootPart.ParentID = 0;
512 if (m_rootPart.LocalId==0) 512 if (m_rootPart.LocalId == 0)
513 m_rootPart.LocalId = m_scene.AllocateLocalId(); 513 m_rootPart.LocalId = m_scene.AllocateLocalId();
514 514
515 // No need to lock here since the object isn't yet in a scene 515 // No need to lock here since the object isn't yet in a scene
@@ -1468,6 +1468,9 @@ namespace OpenSim.Region.Framework.Scenes
1468 /// <param name="part"></param> 1468 /// <param name="part"></param>
1469 internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) 1469 internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags)
1470 { 1470 {
1471// m_log.DebugFormat(
1472// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
1473
1471 if (m_rootPart.UUID == part.UUID) 1474 if (m_rootPart.UUID == part.UUID)
1472 { 1475 {
1473 if (IsAttachment) 1476 if (IsAttachment)
@@ -2284,7 +2287,6 @@ namespace OpenSim.Region.Framework.Scenes
2284 2287
2285 AttachToBackup(); 2288 AttachToBackup();
2286 2289
2287
2288 // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the 2290 // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the
2289 // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and 2291 // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and
2290 // unmoved prims! 2292 // unmoved prims!
@@ -2299,9 +2301,10 @@ namespace OpenSim.Region.Framework.Scenes
2299 /// an independent SceneObjectGroup. 2301 /// an independent SceneObjectGroup.
2300 /// </summary> 2302 /// </summary>
2301 /// <param name="partID"></param> 2303 /// <param name="partID"></param>
2302 public void DelinkFromGroup(uint partID) 2304 /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns>
2305 public SceneObjectGroup DelinkFromGroup(uint partID)
2303 { 2306 {
2304 DelinkFromGroup(partID, true); 2307 return DelinkFromGroup(partID, true);
2305 } 2308 }
2306 2309
2307 /// <summary> 2310 /// <summary>
@@ -2310,28 +2313,39 @@ namespace OpenSim.Region.Framework.Scenes
2310 /// </summary> 2313 /// </summary>
2311 /// <param name="partID"></param> 2314 /// <param name="partID"></param>
2312 /// <param name="sendEvents"></param> 2315 /// <param name="sendEvents"></param>
2313 public void DelinkFromGroup(uint partID, bool sendEvents) 2316 /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns>
2317 public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents)
2314 { 2318 {
2315 SceneObjectPart linkPart = GetChildPart(partID); 2319 SceneObjectPart linkPart = GetChildPart(partID);
2316 2320
2317 if (linkPart != null) 2321 if (linkPart != null)
2318 { 2322 {
2319 DelinkFromGroup(linkPart, sendEvents); 2323 return DelinkFromGroup(linkPart, sendEvents);
2320 } 2324 }
2321 else 2325 else
2322 { 2326 {
2323 m_log.InfoFormat("[SCENE OBJECT GROUP]: " + 2327 m_log.WarnFormat("[SCENE OBJECT GROUP]: " +
2324 "DelinkFromGroup(): Child prim {0} not found in object {1}, {2}", 2328 "DelinkFromGroup(): Child prim {0} not found in object {1}, {2}",
2325 partID, LocalId, UUID); 2329 partID, LocalId, UUID);
2330
2331 return null;
2326 } 2332 }
2327 } 2333 }
2328 2334
2329 public void DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents) 2335 /// <summary>
2336 /// Delink the given prim from this group. The delinked prim is established as
2337 /// an independent SceneObjectGroup.
2338 /// </summary>
2339 /// <param name="partID"></param>
2340 /// <param name="sendEvents"></param>
2341 /// <returns>The object group of the newly delinked prim.</returns>
2342 public SceneObjectGroup DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents)
2330 { 2343 {
2331 linkPart.ClearUndoState();
2332// m_log.DebugFormat( 2344// m_log.DebugFormat(
2333// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", 2345// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
2334// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); 2346// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
2347
2348 linkPart.ClearUndoState();
2335 2349
2336 Quaternion worldRot = linkPart.GetWorldRotation(); 2350 Quaternion worldRot = linkPart.GetWorldRotation();
2337 2351
@@ -2384,6 +2398,8 @@ namespace OpenSim.Region.Framework.Scenes
2384 2398
2385 //HasGroupChanged = true; 2399 //HasGroupChanged = true;
2386 //ScheduleGroupForFullUpdate(); 2400 //ScheduleGroupForFullUpdate();
2401
2402 return objectGroup;
2387 } 2403 }
2388 2404
2389 /// <summary> 2405 /// <summary>
@@ -2422,7 +2438,6 @@ namespace OpenSim.Region.Framework.Scenes
2422 2438
2423 part.LinkNum = linkNum; 2439 part.LinkNum = linkNum;
2424 2440
2425
2426 part.OffsetPosition = part.GroupPosition - AbsolutePosition; 2441 part.OffsetPosition = part.GroupPosition - AbsolutePosition;
2427 2442
2428 Quaternion rootRotation = m_rootPart.RotationOffset; 2443 Quaternion rootRotation = m_rootPart.RotationOffset;