add a SimpleAngularDistance Updates prioritazition scheme. Results don't look that great so don't use it still.

This commit is contained in:
UbitUmarov
2016-08-09 21:46:19 +01:00
parent 6c00016447
commit 6f5f6431a4
3 changed files with 97 additions and 11 deletions

View File

@@ -1586,12 +1586,22 @@ namespace OpenSim.Region.Framework.Scenes
return m_boundsCenter;
}
private float m_areaFactor;
public float getAreaFactor()
{
// math is done in GetBoundsRadius();
if(m_boundsRadius == null)
GetBoundsRadius();
return m_areaFactor;
}
public float GetBoundsRadius()
{
// this may need more threading work
if(m_boundsRadius == null)
{
float res = 0;
float areaF = 0;
SceneObjectPart p;
SceneObjectPart[] parts;
float partR;
@@ -1613,12 +1623,19 @@ namespace OpenSim.Region.Framework.Scenes
}
if(partR > res)
res = partR;
if(p.maxSimpleArea() > areaF)
areaF = p.maxSimpleArea();
}
if(parts.Length > 1)
{
offset /= parts.Length; // basicly geometric center
offset = offset * RootPart.RotationOffset;
}
areaF = 10.0f / areaF; // scale it
areaF = Util.Clamp(areaF, 0.001f, 1000f); // clamp it
m_areaFactor = (float)Math.Sqrt(areaF);
m_boundsCenter = offset;
m_boundsRadius = res;
return res;