aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-08-19 03:05:25 +0100
committerUbitUmarov2016-08-19 03:05:25 +0100
commit7ba3fb7b5d9c883b7a99d19f893ff6d43689b629 (patch)
tree1ea4937e30520d440979ab02e92882f6f54a3e73 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
parentfix entity update flags update (diff)
parent catch some NULL refs (diff)
downloadopensim-SC-7ba3fb7b5d9c883b7a99d19f893ff6d43689b629.zip
opensim-SC-7ba3fb7b5d9c883b7a99d19f893ff6d43689b629.tar.gz
opensim-SC-7ba3fb7b5d9c883b7a99d19f893ff6d43689b629.tar.bz2
opensim-SC-7ba3fb7b5d9c883b7a99d19f893ff6d43689b629.tar.xz
merge issue
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs55
1 files changed, 34 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index efc1413..df6a1cf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1586,12 +1586,22 @@ namespace OpenSim.Region.Framework.Scenes
1586 return m_boundsCenter; 1586 return m_boundsCenter;
1587 } 1587 }
1588 1588
1589 private float m_areaFactor;
1590 public float getAreaFactor()
1591 {
1592 // math is done in GetBoundsRadius();
1593 if(m_boundsRadius == null)
1594 GetBoundsRadius();
1595 return m_areaFactor;
1596 }
1597
1589 public float GetBoundsRadius() 1598 public float GetBoundsRadius()
1590 { 1599 {
1591 // this may need more threading work 1600 // this may need more threading work
1592 if(m_boundsRadius == null) 1601 if(m_boundsRadius == null)
1593 { 1602 {
1594 float res = 0; 1603 float res = 0;
1604 float areaF = 0;
1595 SceneObjectPart p; 1605 SceneObjectPart p;
1596 SceneObjectPart[] parts; 1606 SceneObjectPart[] parts;
1597 float partR; 1607 float partR;
@@ -1613,12 +1623,19 @@ namespace OpenSim.Region.Framework.Scenes
1613 } 1623 }
1614 if(partR > res) 1624 if(partR > res)
1615 res = partR; 1625 res = partR;
1626 if(p.maxSimpleArea() > areaF)
1627 areaF = p.maxSimpleArea();
1616 } 1628 }
1617 if(parts.Length > 1) 1629 if(parts.Length > 1)
1618 { 1630 {
1619 offset /= parts.Length; // basicly geometric center 1631 offset /= parts.Length; // basicly geometric center
1620 offset = offset * RootPart.RotationOffset; 1632 offset = offset * RootPart.RotationOffset;
1621 } 1633 }
1634
1635 areaF = 10.0f / areaF; // scale it
1636 areaF = Util.Clamp(areaF, 0.001f, 1000f); // clamp it
1637
1638 m_areaFactor = (float)Math.Sqrt(areaF);
1622 m_boundsCenter = offset; 1639 m_boundsCenter = offset;
1623 m_boundsRadius = res; 1640 m_boundsRadius = res;
1624 return res; 1641 return res;
@@ -2048,41 +2065,37 @@ namespace OpenSim.Region.Framework.Scenes
2048 { 2065 {
2049 // We need to keep track of this state in case this group is still queued for backup. 2066 // We need to keep track of this state in case this group is still queued for backup.
2050 IsDeleted = true; 2067 IsDeleted = true;
2051 HasGroupChanged = true;
2052 2068
2053 DetachFromBackup(); 2069 DetachFromBackup();
2054 2070
2071 if(Scene == null) // should not happen unless restart/shutdown ?
2072 return;
2073
2055 SceneObjectPart[] parts = m_parts.GetArray(); 2074 SceneObjectPart[] parts = m_parts.GetArray();
2056 for (int i = 0; i < parts.Length; i++) 2075 for (int i = 0; i < parts.Length; i++)
2057 { 2076 {
2058 SceneObjectPart part = parts[i]; 2077 SceneObjectPart part = parts[i];
2059 2078
2060 if (Scene != null) 2079 Scene.ForEachScenePresence(delegate(ScenePresence avatar)
2061 { 2080 {
2062 Scene.ForEachScenePresence(delegate(ScenePresence avatar) 2081 if (!avatar.IsChildAgent && avatar.ParentID == LocalId)
2063 { 2082 avatar.StandUp();
2064 if (!avatar.IsChildAgent && avatar.ParentID == LocalId)
2065 avatar.StandUp();
2066 2083
2067 if (!silent) 2084 if (!silent)
2085 {
2086 part.ClearUpdateSchedule();
2087 if (part == m_rootPart)
2068 { 2088 {
2069 part.ClearUpdateSchedule(); 2089 if (!IsAttachment
2070 if (part == m_rootPart) 2090 || AttachedAvatar == avatar.ControllingClient.AgentId
2091 || !HasPrivateAttachmentPoint)
2071 { 2092 {
2072 if (!IsAttachment 2093 // Send a kill object immediately
2073 || AttachedAvatar == avatar.ControllingClient.AgentId 2094 avatar.ControllingClient.SendKillObject(new List<uint> { part.LocalId });
2074 || !HasPrivateAttachmentPoint)
2075 {
2076 // Send a kill object immediately
2077 avatar.ControllingClient.SendKillObject(new List<uint> { part.LocalId });
2078 // Also, send a terse update; in case race conditions make the object pop again in the client,
2079 // this update will send another kill object
2080 m_rootPart.SendTerseUpdateToClient(avatar.ControllingClient);
2081 }
2082 } 2095 }
2083 } 2096 }
2084 }); 2097 }
2085 } 2098 });
2086 } 2099 }
2087 } 2100 }
2088 2101