aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs67
2 files changed, 41 insertions, 29 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 34224a7..295569e 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -1373,7 +1373,8 @@ namespace OpenSim.Region.Environment.Scenes
1373 List<SceneObjectGroup> children = new List<SceneObjectGroup>(); 1373 List<SceneObjectGroup> children = new List<SceneObjectGroup>();
1374 if (parenPrim != null) 1374 if (parenPrim != null)
1375 { 1375 {
1376 for (int i = 0; i < childPrims.Count; i++) 1376 // We do this in reverse to get the link order of the prims correct
1377 for (int i = childPrims.Count - 1; i >= 0; i--)
1377 { 1378 {
1378 foreach (EntityBase ent in EntityList) 1379 foreach (EntityBase ent in EntityList)
1379 { 1380 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 02098b7..32c9255 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1830,29 +1830,42 @@ namespace OpenSim.Region.Environment.Scenes
1830 lock (m_parts) 1830 lock (m_parts)
1831 { 1831 {
1832 m_parts.Add(linkPart.UUID, linkPart); 1832 m_parts.Add(linkPart.UUID, linkPart);
1833 }
1834
1835 linkPart.LinkNum = m_parts.Count;
1836
1837 linkPart.SetParent(this);
1838 linkPart.AddFlag(PrimFlags.CreateSelected);
1839
1840 //if (linkPart.PhysActor != null)
1841 //{
1842 // m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
1843 1833
1844 //linkPart.PhysActor = null; 1834 // Insert in terms of link numbers, the new links
1845 //} 1835 // before the current ones (with the exception of
1846 1836 // the root prim. Shuffle the old ones up
1847 //TODO: rest of parts 1837 foreach (KeyValuePair<UUID, SceneObjectPart> kvp in m_parts)
1848 foreach (SceneObjectPart part in objectGroup.Children.Values) 1838 {
1849 { 1839 if (kvp.Value.LinkNum != 1) {
1850 if (part.UUID != objectGroup.m_rootPart.UUID) 1840 // Don't update root prim link number
1851 { 1841 kvp.Value.LinkNum += objectGroup.PrimCount;
1852 LinkNonRootPart(part, oldGroupPosition, oldRootRotation); 1842 }
1853 } 1843 }
1854 part.ClearUndoState(); 1844
1855 } 1845
1846 linkPart.LinkNum = 2;
1847
1848 linkPart.SetParent(this);
1849 linkPart.AddFlag(PrimFlags.CreateSelected);
1850
1851 //if (linkPart.PhysActor != null)
1852 //{
1853 // m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
1854
1855 //linkPart.PhysActor = null;
1856 //}
1857
1858 //TODO: rest of parts
1859 int linkNum = 3;
1860 foreach (SceneObjectPart part in objectGroup.Children.Values)
1861 {
1862 if (part.UUID != objectGroup.m_rootPart.UUID)
1863 {
1864 LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
1865 }
1866 part.ClearUndoState();
1867 }
1868 }
1856 1869
1857 m_scene.UnlinkSceneObject(objectGroup.UUID, true); 1870 m_scene.UnlinkSceneObject(objectGroup.UUID, true);
1858 objectGroup.Children.Clear(); 1871 objectGroup.Children.Clear();
@@ -1961,17 +1974,15 @@ namespace OpenSim.Region.Environment.Scenes
1961 m_isBackedUp = false; 1974 m_isBackedUp = false;
1962 } 1975 }
1963 1976
1964 private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation) 1977 private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation, int linkNum)
1965 { 1978 {
1966 part.SetParent(this); 1979 part.SetParent(this);
1967 part.ParentID = m_rootPart.LocalId; 1980 part.ParentID = m_rootPart.LocalId;
1968 1981
1969 lock (m_parts) 1982 // Caller locks m_parts for us
1970 { 1983 m_parts.Add(part.UUID, part);
1971 m_parts.Add(part.UUID, part);
1972 }
1973 1984
1974 part.LinkNum = m_parts.Count; 1985 part.LinkNum = linkNum;
1975 1986
1976 Vector3 oldPos = part.OffsetPosition; 1987 Vector3 oldPos = part.OffsetPosition;
1977 oldPos *= oldGroupRotation; 1988 oldPos *= oldGroupRotation;