diff options
author | Justin Clark-Casey (justincc) | 2011-11-05 01:42:20 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-05 01:42:20 +0000 |
commit | 8105794121a04ab14e40d24e2615b5661103bd56 (patch) | |
tree | 0785eae15284cc1fe84d85b1104e1ade3a1f8d84 /OpenSim/Region | |
parent | Fix NPC sitting for prims without a sit target. (diff) | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-8105794121a04ab14e40d24e2615b5661103bd56.zip opensim-SC-8105794121a04ab14e40d24e2615b5661103bd56.tar.gz opensim-SC-8105794121a04ab14e40d24e2615b5661103bd56.tar.bz2 opensim-SC-8105794121a04ab14e40d24e2615b5661103bd56.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 46 |
2 files changed, 12 insertions, 36 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a137bca..b2e5dc3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1669,7 +1669,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1669 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); | 1669 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); |
1670 | 1670 | ||
1671 | // We do this in reverse to get the link order of the prims correct | 1671 | // We do this in reverse to get the link order of the prims correct |
1672 | for (int i = children.Count - 1; i >= 0; i--) | 1672 | for (int i = 0 ; i < children.Count ; i++) |
1673 | { | 1673 | { |
1674 | SceneObjectGroup child = children[i].ParentGroup; | 1674 | SceneObjectGroup child = children[i].ParentGroup; |
1675 | 1675 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ef2682f..4d6c4cb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1963,16 +1963,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1963 | /// <param name="objectGroup">The group of prims which should be linked to this group</param> | 1963 | /// <param name="objectGroup">The group of prims which should be linked to this group</param> |
1964 | public void LinkToGroup(SceneObjectGroup objectGroup) | 1964 | public void LinkToGroup(SceneObjectGroup objectGroup) |
1965 | { | 1965 | { |
1966 | // Make sure we have sent any pending unlinks or stuff. | ||
1967 | //if (objectGroup.RootPart.UpdateFlag > 0) | ||
1968 | //{ | ||
1969 | // m_log.WarnFormat( | ||
1970 | // "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.", | ||
1971 | // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); | ||
1972 | |||
1973 | // objectGroup.RootPart.SendScheduledUpdates(); | ||
1974 | //} | ||
1975 | |||
1976 | // m_log.DebugFormat( | 1966 | // m_log.DebugFormat( |
1977 | // "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", | 1967 | // "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", |
1978 | // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); | 1968 | // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); |
@@ -1983,6 +1973,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1983 | Quaternion oldRootRotation = linkPart.RotationOffset; | 1973 | Quaternion oldRootRotation = linkPart.RotationOffset; |
1984 | 1974 | ||
1985 | linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; | 1975 | linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; |
1976 | linkPart.ParentID = m_rootPart.LocalId; | ||
1986 | linkPart.GroupPosition = AbsolutePosition; | 1977 | linkPart.GroupPosition = AbsolutePosition; |
1987 | Vector3 axPos = linkPart.OffsetPosition; | 1978 | Vector3 axPos = linkPart.OffsetPosition; |
1988 | 1979 | ||
@@ -1995,42 +1986,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
1995 | linkPart.RotationOffset = newRot; | 1986 | linkPart.RotationOffset = newRot; |
1996 | 1987 | ||
1997 | linkPart.ParentID = m_rootPart.LocalId; | 1988 | linkPart.ParentID = m_rootPart.LocalId; |
1989 | |||
1998 | if (m_rootPart.LinkNum == 0) | 1990 | if (m_rootPart.LinkNum == 0) |
1999 | m_rootPart.LinkNum = 1; | 1991 | m_rootPart.LinkNum = 1; |
2000 | 1992 | ||
2001 | lock (m_parts.SyncRoot) | 1993 | lock (m_parts.SyncRoot) |
2002 | { | 1994 | { |
2003 | m_parts.Add(linkPart.UUID, linkPart); | 1995 | int linkNum = PrimCount + 1; |
2004 | |||
2005 | // Insert in terms of link numbers, the new links | ||
2006 | // before the current ones (with the exception of | ||
2007 | // the root prim. Shuffle the old ones up | ||
2008 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
2009 | for (int i = 0; i < parts.Length; i++) | ||
2010 | { | ||
2011 | SceneObjectPart part = parts[i]; | ||
2012 | if (part.LinkNum != 1) | ||
2013 | { | ||
2014 | // Don't update root prim link number | ||
2015 | part.LinkNum += objectGroup.PrimCount; | ||
2016 | } | ||
2017 | } | ||
2018 | 1996 | ||
2019 | linkPart.LinkNum = 2; | 1997 | m_parts.Add(linkPart.UUID, linkPart); |
2020 | 1998 | ||
2021 | linkPart.SetParent(this); | 1999 | linkPart.SetParent(this); |
2022 | linkPart.CreateSelected = true; | 2000 | linkPart.CreateSelected = true; |
2023 | 2001 | ||
2024 | //if (linkPart.PhysActor != null) | 2002 | linkPart.LinkNum = linkNum++; |
2025 | //{ | ||
2026 | // m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor); | ||
2027 | |||
2028 | //linkPart.PhysActor = null; | ||
2029 | //} | ||
2030 | 2003 | ||
2031 | //TODO: rest of parts | ||
2032 | int linkNum = 3; | ||
2033 | SceneObjectPart[] ogParts = objectGroup.Parts; | 2004 | SceneObjectPart[] ogParts = objectGroup.Parts; |
2005 | Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b) | ||
2006 | { | ||
2007 | return a.LinkNum - b.LinkNum; | ||
2008 | }); | ||
2009 | |||
2034 | for (int i = 0; i < ogParts.Length; i++) | 2010 | for (int i = 0; i < ogParts.Length; i++) |
2035 | { | 2011 | { |
2036 | SceneObjectPart part = ogParts[i]; | 2012 | SceneObjectPart part = ogParts[i]; |
@@ -2044,7 +2020,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2044 | objectGroup.IsDeleted = true; | 2020 | objectGroup.IsDeleted = true; |
2045 | 2021 | ||
2046 | objectGroup.m_parts.Clear(); | 2022 | objectGroup.m_parts.Clear(); |
2047 | 2023 | ||
2048 | // Can't do this yet since backup still makes use of the root part without any synchronization | 2024 | // Can't do this yet since backup still makes use of the root part without any synchronization |
2049 | // objectGroup.m_rootPart = null; | 2025 | // objectGroup.m_rootPart = null; |
2050 | 2026 | ||