ignore camera on culling for now
parent
7131703244
commit
981980150c
|
@ -4012,13 +4012,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
bool doCulling = m_scene.ObjectsCullingByDistance;
|
bool doCulling = m_scene.ObjectsCullingByDistance;
|
||||||
float cullingrange = 64.0f;
|
float cullingrange = 64.0f;
|
||||||
HashSet<SceneObjectGroup> GroupsNeedFullUpdate = new HashSet<SceneObjectGroup>();
|
HashSet<SceneObjectGroup> GroupsNeedFullUpdate = new HashSet<SceneObjectGroup>();
|
||||||
Vector3 mycamera = Vector3.Zero;
|
// Vector3 mycamera = Vector3.Zero;
|
||||||
Vector3 mypos = Vector3.Zero;
|
Vector3 mypos = Vector3.Zero;
|
||||||
ScenePresence mysp = (ScenePresence)SceneAgent;
|
ScenePresence mysp = (ScenePresence)SceneAgent;
|
||||||
if(mysp != null && !mysp.IsDeleted)
|
if(mysp != null && !mysp.IsDeleted)
|
||||||
{
|
{
|
||||||
cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance +16f;
|
cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance +16f;
|
||||||
mycamera = mysp.CameraPosition;
|
// mycamera = mysp.CameraPosition;
|
||||||
mypos = mysp.AbsolutePosition;
|
mypos = mysp.AbsolutePosition;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4116,10 +4116,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
if(!inview)
|
if(!inview)
|
||||||
{
|
{
|
||||||
Vector3 partpos = grp.AbsolutePosition;
|
Vector3 partpos = grp.AbsolutePosition;
|
||||||
float dcam = (partpos - mycamera).LengthSquared();
|
// float dcam = (partpos - mycamera).LengthSquared();
|
||||||
float dpos = (partpos - mypos).LengthSquared();
|
float dpos = (partpos - mypos).LengthSquared();
|
||||||
if(dcam < dpos)
|
// if(dcam < dpos)
|
||||||
dpos = dcam;
|
// dpos = dcam;
|
||||||
dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius();
|
dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius();
|
||||||
if(dpos > cullingrange)
|
if(dpos > cullingrange)
|
||||||
continue;
|
continue;
|
||||||
|
@ -4386,13 +4386,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
CheckGroupsInViewOverRun = false;
|
CheckGroupsInViewOverRun = false;
|
||||||
|
|
||||||
float cullingrange = 64.0f;
|
float cullingrange = 64.0f;
|
||||||
Vector3 mycamera = Vector3.Zero;
|
// Vector3 mycamera = Vector3.Zero;
|
||||||
Vector3 mypos = Vector3.Zero;
|
Vector3 mypos = Vector3.Zero;
|
||||||
ScenePresence mysp = (ScenePresence)SceneAgent;
|
ScenePresence mysp = (ScenePresence)SceneAgent;
|
||||||
if(mysp != null && !mysp.IsDeleted)
|
if(mysp != null && !mysp.IsDeleted)
|
||||||
{
|
{
|
||||||
cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
|
cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
|
||||||
mycamera = mysp.CameraPosition;
|
// mycamera = mysp.CameraPosition;
|
||||||
mypos = mysp.AbsolutePosition;
|
mypos = mysp.AbsolutePosition;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4410,15 +4410,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
if(!IsActive)
|
if(!IsActive)
|
||||||
return;
|
return;
|
||||||
if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment)
|
|
||||||
|
if (e != null && e is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
SceneObjectGroup grp = (SceneObjectGroup)e;
|
SceneObjectGroup grp = (SceneObjectGroup)e;
|
||||||
Vector3 grppos = grp.AbsolutePosition;
|
if(grp.IsDeleted || grp.IsAttachment)
|
||||||
|
continue;
|
||||||
|
|
||||||
float dcam = (grppos - mycamera).LengthSquared();
|
Vector3 grppos = grp.AbsolutePosition;
|
||||||
|
// float dcam = (grppos - mycamera).LengthSquared();
|
||||||
float dpos = (grppos - mypos).LengthSquared();
|
float dpos = (grppos - mypos).LengthSquared();
|
||||||
if(dcam < dpos)
|
// if(dcam < dpos)
|
||||||
dpos = dcam;
|
// dpos = dcam;
|
||||||
|
|
||||||
dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius();
|
dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius();
|
||||||
|
|
||||||
|
@ -4436,6 +4439,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
SendKillObject(kills);
|
SendKillObject(kills);
|
||||||
kills.Clear();
|
kills.Clear();
|
||||||
Thread.Sleep(50);
|
Thread.Sleep(50);
|
||||||
|
if(mysp != null && !mysp.IsDeleted)
|
||||||
|
{
|
||||||
|
cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
|
||||||
|
// mycamera = mysp.CameraPosition;
|
||||||
|
mypos = mysp.AbsolutePosition;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CheckGroupsInViewBusy= false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue