mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
add a SimpleAngularDistance Updates prioritazition scheme. Results don't look that great so don't use it still.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user