diff options
author | Kitto Flora | 2010-05-07 15:16:59 -0400 |
---|---|---|
committer | Kitto Flora | 2010-05-07 15:16:59 -0400 |
commit | bc7d84b75c8443b82301717ceb603d6c1fbee931 (patch) | |
tree | bceb1bf07c14dd75d4508a1c93e5271dfff183c7 /OpenSim/Region/Framework/Scenes/SceneGraph.cs | |
parent | Fix Mouse+WASD makes Av rise; Fix PREJUMP. (diff) | |
parent | Merge branch 'master' of ssh://3dhosting.de/var/git/careminster (diff) | |
download | opensim-SC-bc7d84b75c8443b82301717ceb603d6c1fbee931.zip opensim-SC-bc7d84b75c8443b82301717ceb603d6c1fbee931.tar.gz opensim-SC-bc7d84b75c8443b82301717ceb603d6c1fbee931.tar.bz2 opensim-SC-bc7d84b75c8443b82301717ceb603d6c1fbee931.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index bbcb85e..090f379 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1655,20 +1655,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1655 | /// <param name="client"></param> | 1655 | /// <param name="client"></param> |
1656 | /// <param name="parentPrim"></param> | 1656 | /// <param name="parentPrim"></param> |
1657 | /// <param name="childPrims"></param> | 1657 | /// <param name="childPrims"></param> |
1658 | protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) | 1658 | protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children) |
1659 | { | 1659 | { |
1660 | Monitor.Enter(m_updateLock); | 1660 | Monitor.Enter(m_updateLock); |
1661 | try | 1661 | try |
1662 | { | 1662 | { |
1663 | SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); | 1663 | SceneObjectGroup parentGroup = root.ParentGroup; |
1664 | 1664 | ||
1665 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); | 1665 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); |
1666 | if (parentGroup != null) | 1666 | if (parentGroup != null) |
1667 | { | 1667 | { |
1668 | // We do this in reverse to get the link order of the prims correct | 1668 | // We do this in reverse to get the link order of the prims correct |
1669 | for (int i = childPrimIds.Count - 1; i >= 0; i--) | 1669 | for (int i = children.Count - 1; i >= 0; i--) |
1670 | { | 1670 | { |
1671 | SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); | 1671 | SceneObjectGroup child = children[i].ParentGroup; |
1672 | |||
1672 | if (child != null) | 1673 | if (child != null) |
1673 | { | 1674 | { |
1674 | // Make sure no child prim is set for sale | 1675 | // Make sure no child prim is set for sale |
@@ -1701,17 +1702,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1701 | parentGroup.HasGroupChanged = true; | 1702 | parentGroup.HasGroupChanged = true; |
1702 | parentGroup.ScheduleGroupForFullUpdate(); | 1703 | parentGroup.ScheduleGroupForFullUpdate(); |
1703 | 1704 | ||
1704 | // if (client != null) | ||
1705 | // { | ||
1706 | // parentGroup.GetProperties(client); | ||
1707 | // } | ||
1708 | // else | ||
1709 | // { | ||
1710 | // foreach (ScenePresence p in GetScenePresences()) | ||
1711 | // { | ||
1712 | // parentGroup.GetProperties(p.ControllingClient); | ||
1713 | // } | ||
1714 | // } | ||
1715 | } | 1705 | } |
1716 | finally | 1706 | finally |
1717 | { | 1707 | { |
@@ -1723,12 +1713,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1723 | /// Delink a linkset | 1713 | /// Delink a linkset |
1724 | /// </summary> | 1714 | /// </summary> |
1725 | /// <param name="prims"></param> | 1715 | /// <param name="prims"></param> |
1726 | protected internal void DelinkObjects(List<uint> primIds) | 1716 | protected internal void DelinkObjects(List<SceneObjectPart> prims) |
1727 | { | ||
1728 | DelinkObjects(primIds, true); | ||
1729 | } | ||
1730 | |||
1731 | protected internal void DelinkObjects(List<uint> primIds, bool sendEvents) | ||
1732 | { | 1717 | { |
1733 | Monitor.Enter(m_updateLock); | 1718 | Monitor.Enter(m_updateLock); |
1734 | try | 1719 | try |
@@ -1738,9 +1723,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1738 | List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>(); | 1723 | List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>(); |
1739 | // Look them all up in one go, since that is comparatively expensive | 1724 | // Look them all up in one go, since that is comparatively expensive |
1740 | // | 1725 | // |
1741 | foreach (uint primID in primIds) | 1726 | foreach (SceneObjectPart part in prims) |
1742 | { | 1727 | { |
1743 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); | ||
1744 | if (part != null) | 1728 | if (part != null) |
1745 | { | 1729 | { |
1746 | if (part.ParentGroup.Children.Count != 1) // Skip single | 1730 | if (part.ParentGroup.Children.Count != 1) // Skip single |
@@ -1755,17 +1739,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1755 | affectedGroups.Add(group); | 1739 | affectedGroups.Add(group); |
1756 | } | 1740 | } |
1757 | } | 1741 | } |
1758 | else | ||
1759 | { | ||
1760 | m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID); | ||
1761 | } | ||
1762 | } | 1742 | } |
1763 | 1743 | ||
1764 | foreach (SceneObjectPart child in childParts) | 1744 | foreach (SceneObjectPart child in childParts) |
1765 | { | 1745 | { |
1766 | // Unlink all child parts from their groups | 1746 | // Unlink all child parts from their groups |
1767 | // | 1747 | // |
1768 | child.ParentGroup.DelinkFromGroup(child, sendEvents); | 1748 | child.ParentGroup.DelinkFromGroup(child, true); |
1769 | } | 1749 | } |
1770 | 1750 | ||
1771 | foreach (SceneObjectPart root in rootParts) | 1751 | foreach (SceneObjectPart root in rootParts) |
@@ -1820,12 +1800,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1820 | List<uint> linkIDs = new List<uint>(); | 1800 | List<uint> linkIDs = new List<uint>(); |
1821 | 1801 | ||
1822 | foreach (SceneObjectPart newChild in newSet) | 1802 | foreach (SceneObjectPart newChild in newSet) |
1823 | { | ||
1824 | newChild.UpdateFlag = 0; | 1803 | newChild.UpdateFlag = 0; |
1825 | linkIDs.Add(newChild.LocalId); | ||
1826 | } | ||
1827 | 1804 | ||
1828 | LinkObjects(null, newRoot.LocalId, linkIDs); | 1805 | LinkObjects(newRoot, newSet); |
1829 | if (!affectedGroups.Contains(newRoot.ParentGroup)) | 1806 | if (!affectedGroups.Contains(newRoot.ParentGroup)) |
1830 | affectedGroups.Add(newRoot.ParentGroup); | 1807 | affectedGroups.Add(newRoot.ParentGroup); |
1831 | } | 1808 | } |