diff options
author | UbitUmarov | 2016-08-09 21:46:19 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-09 21:46:19 +0100 |
commit | 6f5f6431a45cad8e23c2251d661691d905fc08f7 (patch) | |
tree | 8d47a09e2fd5bbe0e3a05d286bbef29bda2b628b /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | add a simple prim area estimator (diff) | |
download | opensim-SC-6f5f6431a45cad8e23c2251d661691d905fc08f7.zip opensim-SC-6f5f6431a45cad8e23c2251d661691d905fc08f7.tar.gz opensim-SC-6f5f6431a45cad8e23c2251d661691d905fc08f7.tar.bz2 opensim-SC-6f5f6431a45cad8e23c2251d661691d905fc08f7.tar.xz |
add a SimpleAngularDistance Updates prioritazition scheme. Results don't look that great so don't use it still.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index efc1413..e17ef2b 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; |