diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 55 |
1 files changed, 21 insertions, 34 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 9c3486e..5ef14bf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -270,7 +270,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
270 | if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f; | 270 | if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f; |
271 | if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f; | 271 | if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f; |
272 | 272 | ||
273 | foreach (SceneObjectPart part in sceneObject.Children.Values) | 273 | foreach (SceneObjectPart part in sceneObject.Parts) |
274 | { | 274 | { |
275 | part.GroupPosition = npos; | 275 | part.GroupPosition = npos; |
276 | } | 276 | } |
@@ -370,9 +370,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
370 | if (Entities.ContainsKey(sceneObject.UUID)) | 370 | if (Entities.ContainsKey(sceneObject.UUID)) |
371 | return false; | 371 | return false; |
372 | 372 | ||
373 | List<SceneObjectPart> children; | 373 | SceneObjectPart[] children = sceneObject.Parts; |
374 | lock (sceneObject.Children) | ||
375 | children = new List<SceneObjectPart>(sceneObject.Children.Values); | ||
376 | 374 | ||
377 | // Clamp child prim sizes and add child prims to the m_numPrim count | 375 | // Clamp child prim sizes and add child prims to the m_numPrim count |
378 | if (m_parentScene.m_clampPrimSize) | 376 | if (m_parentScene.m_clampPrimSize) |
@@ -391,7 +389,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
391 | part.Shape.Scale = scale; | 389 | part.Shape.Scale = scale; |
392 | } | 390 | } |
393 | } | 391 | } |
394 | m_numPrim += children.Count; | 392 | m_numPrim += children.Length; |
395 | 393 | ||
396 | sceneObject.AttachToScene(m_parentScene); | 394 | sceneObject.AttachToScene(m_parentScene); |
397 | 395 | ||
@@ -448,15 +446,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
448 | 446 | ||
449 | lock (SceneObjectGroupsByFullID) | 447 | lock (SceneObjectGroupsByFullID) |
450 | { | 448 | { |
451 | foreach (SceneObjectPart part in grp.Children.Values) | 449 | SceneObjectPart[] parts = grp.Parts; |
452 | SceneObjectGroupsByFullID.Remove(part.UUID); | 450 | for (int i = 0; i < parts.Length; i++) |
451 | SceneObjectGroupsByFullID.Remove(parts[i].UUID); | ||
453 | SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID); | 452 | SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID); |
454 | } | 453 | } |
455 | 454 | ||
456 | lock (SceneObjectGroupsByLocalID) | 455 | lock (SceneObjectGroupsByLocalID) |
457 | { | 456 | { |
458 | foreach (SceneObjectPart part in grp.Children.Values) | 457 | SceneObjectPart[] parts = grp.Parts; |
459 | SceneObjectGroupsByLocalID.Remove(part.LocalId); | 458 | for (int i = 0; i < parts.Length; i++) |
459 | SceneObjectGroupsByLocalID.Remove(parts[i].LocalId); | ||
460 | SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId); | 460 | SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId); |
461 | } | 461 | } |
462 | 462 | ||
@@ -943,11 +943,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
943 | 943 | ||
944 | if (sog != null) | 944 | if (sog != null) |
945 | { | 945 | { |
946 | lock (sog.Children) | 946 | if (sog.ContainsPart(fullID)) |
947 | { | 947 | return sog; |
948 | if (sog.Children.ContainsKey(fullID)) | ||
949 | return sog; | ||
950 | } | ||
951 | 948 | ||
952 | lock (SceneObjectGroupsByFullID) | 949 | lock (SceneObjectGroupsByFullID) |
953 | SceneObjectGroupsByFullID.Remove(fullID); | 950 | SceneObjectGroupsByFullID.Remove(fullID); |
@@ -1021,7 +1018,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1021 | { | 1018 | { |
1022 | if (entity is SceneObjectGroup) | 1019 | if (entity is SceneObjectGroup) |
1023 | { | 1020 | { |
1024 | foreach (SceneObjectPart p in ((SceneObjectGroup)entity).GetParts()) | 1021 | foreach (SceneObjectPart p in ((SceneObjectGroup)entity).Parts) |
1025 | { | 1022 | { |
1026 | if (p.Name == name) | 1023 | if (p.Name == name) |
1027 | { | 1024 | { |
@@ -1686,14 +1683,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1686 | SceneObjectGroup group = root.ParentGroup; | 1683 | SceneObjectGroup group = root.ParentGroup; |
1687 | group.areUpdatesSuspended = true; | 1684 | group.areUpdatesSuspended = true; |
1688 | 1685 | ||
1689 | List<SceneObjectPart> newSet = null; | 1686 | List<SceneObjectPart> newSet = new List<SceneObjectPart>(group.Parts); |
1690 | int numChildren; | 1687 | int numChildren = newSet.Count; |
1691 | |||
1692 | lock (group.Children) | ||
1693 | { | ||
1694 | newSet = new List<SceneObjectPart>(group.Children.Values); | ||
1695 | numChildren = group.PrimCount; | ||
1696 | } | ||
1697 | 1688 | ||
1698 | if (numChildren == 1) | 1689 | if (numChildren == 1) |
1699 | break; | 1690 | break; |
@@ -1783,16 +1774,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1783 | if (ent is SceneObjectGroup) | 1774 | if (ent is SceneObjectGroup) |
1784 | { | 1775 | { |
1785 | SceneObjectGroup sog = ent as SceneObjectGroup; | 1776 | SceneObjectGroup sog = ent as SceneObjectGroup; |
1786 | 1777 | ||
1787 | lock (sog.Children) | 1778 | foreach (SceneObjectPart part in sog.Parts) |
1788 | { | 1779 | { |
1789 | foreach (KeyValuePair<UUID, SceneObjectPart> subent in sog.Children) | 1780 | if (part.LocalId == localID) |
1790 | { | 1781 | { |
1791 | if (subent.Value.LocalId == localID) | 1782 | objid = part.UUID; |
1792 | { | 1783 | obj = part; |
1793 | objid = subent.Key; | ||
1794 | obj = subent.Value; | ||
1795 | } | ||
1796 | } | 1784 | } |
1797 | } | 1785 | } |
1798 | } | 1786 | } |
@@ -1868,8 +1856,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1868 | copy.SetOwnerId(AgentID); | 1856 | copy.SetOwnerId(AgentID); |
1869 | copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID); | 1857 | copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID); |
1870 | 1858 | ||
1871 | List<SceneObjectPart> partList = | 1859 | SceneObjectPart[] partList = copy.Parts; |
1872 | new List<SceneObjectPart>(copy.Children.Values); | ||
1873 | 1860 | ||
1874 | if (m_parentScene.Permissions.PropagatePermissions()) | 1861 | if (m_parentScene.Permissions.PropagatePermissions()) |
1875 | { | 1862 | { |
@@ -1891,7 +1878,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1891 | // think it's selected, so it will never send a deselect... | 1878 | // think it's selected, so it will never send a deselect... |
1892 | copy.IsSelected = false; | 1879 | copy.IsSelected = false; |
1893 | 1880 | ||
1894 | m_numPrim += copy.Children.Count; | 1881 | m_numPrim += copy.Parts.Length; |
1895 | 1882 | ||
1896 | if (rot != Quaternion.Identity) | 1883 | if (rot != Quaternion.Identity) |
1897 | { | 1884 | { |