aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs50
1 files changed, 11 insertions, 39 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6d906b7..6204b4f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2351,16 +2351,6 @@ namespace OpenSim.Region.Framework.Scenes
2351 /// <param name="objectGroup">The group of prims which should be linked to this group</param> 2351 /// <param name="objectGroup">The group of prims which should be linked to this group</param>
2352 public void LinkToGroup(SceneObjectGroup objectGroup) 2352 public void LinkToGroup(SceneObjectGroup objectGroup)
2353 { 2353 {
2354 // Make sure we have sent any pending unlinks or stuff.
2355 //if (objectGroup.RootPart.UpdateFlag > 0)
2356 //{
2357 // m_log.WarnFormat(
2358 // "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.",
2359 // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
2360
2361 // objectGroup.RootPart.SendScheduledUpdates();
2362 //}
2363
2364// m_log.DebugFormat( 2354// m_log.DebugFormat(
2365// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", 2355// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
2366// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); 2356// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
@@ -2384,45 +2374,27 @@ namespace OpenSim.Region.Framework.Scenes
2384 linkPart.RotationOffset = newRot; 2374 linkPart.RotationOffset = newRot;
2385 2375
2386 linkPart.ParentID = m_rootPart.LocalId; 2376 linkPart.ParentID = m_rootPart.LocalId;
2377
2387 if (m_rootPart.LinkNum == 0) 2378 if (m_rootPart.LinkNum == 0)
2388 m_rootPart.LinkNum = 1; 2379 m_rootPart.LinkNum = 1;
2389 2380
2390 lock (m_parts.SyncRoot) 2381 lock (m_parts.SyncRoot)
2391 { 2382 {
2392 m_parts.Add(linkPart.UUID, linkPart); 2383 int linkNum = PrimCount + 1;
2393
2394 // Insert in terms of link numbers, the new links
2395 // before the current ones (with the exception of
2396 // the root prim. Shuffle the old ones up
2397 SceneObjectPart[] parts = m_parts.GetArray();
2398 for (int i = 0; i < parts.Length; i++)
2399 {
2400 SceneObjectPart part = parts[i];
2401 if (part.LinkNum != 1)
2402 {
2403 // Don't update root prim link number
2404 part.LinkNum += objectGroup.PrimCount;
2405 }
2406 }
2407 }
2408 2384
2409 linkPart.LinkNum = 2; 2385 m_parts.Add(linkPart.UUID, linkPart);
2410 2386
2411 linkPart.SetParent(this); 2387 linkPart.SetParent(this);
2412 linkPart.CreateSelected = true; 2388 linkPart.CreateSelected = true;
2413 2389
2414 lock (m_parts.SyncRoot) 2390 linkPart.LinkNum = linkNum++;
2415 {
2416 //if (linkPart.PhysActor != null)
2417 //{
2418 // m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
2419 2391
2420 //linkPart.PhysActor = null;
2421 //}
2422
2423 //TODO: rest of parts
2424 int linkNum = 3;
2425 SceneObjectPart[] ogParts = objectGroup.Parts; 2392 SceneObjectPart[] ogParts = objectGroup.Parts;
2393 Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
2394 {
2395 return a.LinkNum - b.LinkNum;
2396 });
2397
2426 for (int i = 0; i < ogParts.Length; i++) 2398 for (int i = 0; i < ogParts.Length; i++)
2427 { 2399 {
2428 SceneObjectPart part = ogParts[i]; 2400 SceneObjectPart part = ogParts[i];