Replacing te linking code with the code from Avination. Link sets prims are now

numbered properly even when sets are linked to sets.
remove-scene-viewer
Melanie 2011-11-05 00:09:37 +00:00
parent d7815ace4a
commit c803ed28c3
2 changed files with 12 additions and 36 deletions

View File

@ -1669,7 +1669,7 @@ namespace OpenSim.Region.Framework.Scenes
List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
// We do this in reverse to get the link order of the prims correct
for (int i = children.Count - 1; i >= 0; i--)
for (int i = 0 ; i < children.Count ; i++)
{
SceneObjectGroup child = children[i].ParentGroup;

View File

@ -1963,16 +1963,6 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="objectGroup">The group of prims which should be linked to this group</param>
public void LinkToGroup(SceneObjectGroup objectGroup)
{
// Make sure we have sent any pending unlinks or stuff.
//if (objectGroup.RootPart.UpdateFlag > 0)
//{
// m_log.WarnFormat(
// "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.",
// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
// objectGroup.RootPart.SendScheduledUpdates();
//}
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
@ -1983,6 +1973,7 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion oldRootRotation = linkPart.RotationOffset;
linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
linkPart.ParentID = m_rootPart.LocalId;
linkPart.GroupPosition = AbsolutePosition;
Vector3 axPos = linkPart.OffsetPosition;
@ -1995,42 +1986,27 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.RotationOffset = newRot;
linkPart.ParentID = m_rootPart.LocalId;
if (m_rootPart.LinkNum == 0)
m_rootPart.LinkNum = 1;
lock (m_parts.SyncRoot)
{
int linkNum = PrimCount + 1;
m_parts.Add(linkPart.UUID, linkPart);
// Insert in terms of link numbers, the new links
// before the current ones (with the exception of
// the root prim. Shuffle the old ones up
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (part.LinkNum != 1)
{
// Don't update root prim link number
part.LinkNum += objectGroup.PrimCount;
}
}
linkPart.LinkNum = 2;
linkPart.SetParent(this);
linkPart.CreateSelected = true;
//if (linkPart.PhysActor != null)
//{
// m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
linkPart.LinkNum = linkNum++;
//linkPart.PhysActor = null;
//}
//TODO: rest of parts
int linkNum = 3;
SceneObjectPart[] ogParts = objectGroup.Parts;
Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
{
return a.LinkNum - b.LinkNum;
});
for (int i = 0; i < ogParts.Length; i++)
{
SceneObjectPart part = ogParts[i];
@ -2044,7 +2020,7 @@ namespace OpenSim.Region.Framework.Scenes
objectGroup.IsDeleted = true;
objectGroup.m_parts.Clear();
// Can't do this yet since backup still makes use of the root part without any synchronization
// objectGroup.m_rootPart = null;