aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2016-07-13 14:18:06 +0100
committerUbitUmarov2016-07-13 14:18:06 +0100
commit981980150c1c495bce8a2ce8bef5848a2ede1b5f (patch)
tree83100287f8dbc08c9501a43e58be5f9fb01dc614
parentugly culling (diff)
downloadopensim-SC_OLD-981980150c1c495bce8a2ce8bef5848a2ede1b5f.zip
opensim-SC_OLD-981980150c1c495bce8a2ce8bef5848a2ede1b5f.tar.gz
opensim-SC_OLD-981980150c1c495bce8a2ce8bef5848a2ede1b5f.tar.bz2
opensim-SC_OLD-981980150c1c495bce8a2ce8bef5848a2ede1b5f.tar.xz
ignore camera on culling for now
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs38
1 files changed, 26 insertions, 12 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 5d70dc2..0a7f1a8 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -4012,13 +4012,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4012 bool doCulling = m_scene.ObjectsCullingByDistance; 4012 bool doCulling = m_scene.ObjectsCullingByDistance;
4013 float cullingrange = 64.0f; 4013 float cullingrange = 64.0f;
4014 HashSet<SceneObjectGroup> GroupsNeedFullUpdate = new HashSet<SceneObjectGroup>(); 4014 HashSet<SceneObjectGroup> GroupsNeedFullUpdate = new HashSet<SceneObjectGroup>();
4015 Vector3 mycamera = Vector3.Zero; 4015// Vector3 mycamera = Vector3.Zero;
4016 Vector3 mypos = Vector3.Zero; 4016 Vector3 mypos = Vector3.Zero;
4017 ScenePresence mysp = (ScenePresence)SceneAgent; 4017 ScenePresence mysp = (ScenePresence)SceneAgent;
4018 if(mysp != null && !mysp.IsDeleted) 4018 if(mysp != null && !mysp.IsDeleted)
4019 { 4019 {
4020 cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance +16f; 4020 cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance +16f;
4021 mycamera = mysp.CameraPosition; 4021// mycamera = mysp.CameraPosition;
4022 mypos = mysp.AbsolutePosition; 4022 mypos = mysp.AbsolutePosition;
4023 } 4023 }
4024 else 4024 else
@@ -4116,10 +4116,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4116 if(!inview) 4116 if(!inview)
4117 { 4117 {
4118 Vector3 partpos = grp.AbsolutePosition; 4118 Vector3 partpos = grp.AbsolutePosition;
4119 float dcam = (partpos - mycamera).LengthSquared(); 4119// float dcam = (partpos - mycamera).LengthSquared();
4120 float dpos = (partpos - mypos).LengthSquared(); 4120 float dpos = (partpos - mypos).LengthSquared();
4121 if(dcam < dpos) 4121// if(dcam < dpos)
4122 dpos = dcam; 4122// dpos = dcam;
4123 dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius(); 4123 dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius();
4124 if(dpos > cullingrange) 4124 if(dpos > cullingrange)
4125 continue; 4125 continue;
@@ -4386,13 +4386,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4386 CheckGroupsInViewOverRun = false; 4386 CheckGroupsInViewOverRun = false;
4387 4387
4388 float cullingrange = 64.0f; 4388 float cullingrange = 64.0f;
4389 Vector3 mycamera = Vector3.Zero; 4389// Vector3 mycamera = Vector3.Zero;
4390 Vector3 mypos = Vector3.Zero; 4390 Vector3 mypos = Vector3.Zero;
4391 ScenePresence mysp = (ScenePresence)SceneAgent; 4391 ScenePresence mysp = (ScenePresence)SceneAgent;
4392 if(mysp != null && !mysp.IsDeleted) 4392 if(mysp != null && !mysp.IsDeleted)
4393 { 4393 {
4394 cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f; 4394 cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
4395 mycamera = mysp.CameraPosition; 4395// mycamera = mysp.CameraPosition;
4396 mypos = mysp.AbsolutePosition; 4396 mypos = mysp.AbsolutePosition;
4397 } 4397 }
4398 else 4398 else
@@ -4410,15 +4410,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4410 { 4410 {
4411 if(!IsActive) 4411 if(!IsActive)
4412 return; 4412 return;
4413 if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment) 4413
4414 if (e != null && e is SceneObjectGroup)
4414 { 4415 {
4415 SceneObjectGroup grp = (SceneObjectGroup)e; 4416 SceneObjectGroup grp = (SceneObjectGroup)e;
4416 Vector3 grppos = grp.AbsolutePosition; 4417 if(grp.IsDeleted || grp.IsAttachment)
4418 continue;
4417 4419
4418 float dcam = (grppos - mycamera).LengthSquared(); 4420 Vector3 grppos = grp.AbsolutePosition;
4421// float dcam = (grppos - mycamera).LengthSquared();
4419 float dpos = (grppos - mypos).LengthSquared(); 4422 float dpos = (grppos - mypos).LengthSquared();
4420 if(dcam < dpos) 4423// if(dcam < dpos)
4421 dpos = dcam; 4424// dpos = dcam;
4422 4425
4423 dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius(); 4426 dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius();
4424 4427
@@ -4436,6 +4439,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4436 SendKillObject(kills); 4439 SendKillObject(kills);
4437 kills.Clear(); 4440 kills.Clear();
4438 Thread.Sleep(50); 4441 Thread.Sleep(50);
4442 if(mysp != null && !mysp.IsDeleted)
4443 {
4444 cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
4445// mycamera = mysp.CameraPosition;
4446 mypos = mysp.AbsolutePosition;
4447 }
4448 else
4449 {
4450 CheckGroupsInViewBusy= false;
4451 return;
4452 }
4439 } 4453 }
4440 } 4454 }
4441 } 4455 }