aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
diff options
context:
space:
mode:
authorDiva Canto2013-07-20 13:42:39 -0700
committerDiva Canto2013-07-21 09:00:57 -0700
commit3919c805054e6ce240c72436414ecee18a6c2947 (patch)
tree81457a560daf103883b112170ff944b88b3861c8 /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
parentManage AgentUpdates more sanely: (diff)
downloadopensim-SC_OLD-3919c805054e6ce240c72436414ecee18a6c2947.zip
opensim-SC_OLD-3919c805054e6ce240c72436414ecee18a6c2947.tar.gz
opensim-SC_OLD-3919c805054e6ce240c72436414ecee18a6c2947.tar.bz2
opensim-SC_OLD-3919c805054e6ce240c72436414ecee18a6c2947.tar.xz
A couple of small optimizations over the previous commit
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs18
1 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 6c58aac..2907580 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -5587,6 +5587,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5587 /// <param name='x'></param> 5587 /// <param name='x'></param>
5588 public bool CheckAgentUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) 5588 public bool CheckAgentUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
5589 { 5589 {
5590 // Compute these only once, when this function is called from down below
5591 qdelta1 = 1 - (float)Math.Pow(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation), 2);
5592 //qdelta2 = 1 - (float)Math.Pow(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation), 2);
5593 vdelta1 = Vector3.Distance(x.CameraAtAxis, m_thisAgentUpdateArgs.CameraAtAxis);
5594 vdelta2 = Vector3.Distance(x.CameraCenter, m_thisAgentUpdateArgs.CameraCenter);
5595 vdelta3 = Vector3.Distance(x.CameraLeftAxis, m_thisAgentUpdateArgs.CameraLeftAxis);
5596 vdelta4 = Vector3.Distance(x.CameraUpAxis, m_thisAgentUpdateArgs.CameraUpAxis);
5597
5590 return CheckAgentMovementUpdateSignificance(x) || CheckAgentCameraUpdateSignificance(x); 5598 return CheckAgentMovementUpdateSignificance(x) || CheckAgentCameraUpdateSignificance(x);
5591 } 5599 }
5592 5600
@@ -5596,10 +5604,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5596 /// <remarks>Can only be called by one thread at a time</remarks> 5604 /// <remarks>Can only be called by one thread at a time</remarks>
5597 /// <returns></returns> 5605 /// <returns></returns>
5598 /// <param name='x'></param> 5606 /// <param name='x'></param>
5599 public bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) 5607 private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
5600 { 5608 {
5601 qdelta1 = 1 - (float)Math.Pow(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation), 2);
5602 qdelta2 = 1 - (float)Math.Pow(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation), 2);
5603 if ( 5609 if (
5604 (qdelta1 > QDELTA) || 5610 (qdelta1 > QDELTA) ||
5605 // Ignoring head rotation altogether, because it's not being used for anything interesting up the stack 5611 // Ignoring head rotation altogether, because it's not being used for anything interesting up the stack
@@ -5626,12 +5632,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5626 /// <remarks>Can only be called by one thread at a time</remarks> 5632 /// <remarks>Can only be called by one thread at a time</remarks>
5627 /// <returns></returns> 5633 /// <returns></returns>
5628 /// <param name='x'></param> 5634 /// <param name='x'></param>
5629 public bool CheckAgentCameraUpdateSignificance(AgentUpdatePacket.AgentDataBlock x) 5635 private bool CheckAgentCameraUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
5630 { 5636 {
5631 vdelta1 = Vector3.Distance(x.CameraAtAxis, m_thisAgentUpdateArgs.CameraAtAxis);
5632 vdelta2 = Vector3.Distance(x.CameraCenter, m_thisAgentUpdateArgs.CameraCenter);
5633 vdelta3 = Vector3.Distance(x.CameraLeftAxis, m_thisAgentUpdateArgs.CameraLeftAxis);
5634 vdelta4 = Vector3.Distance(x.CameraUpAxis, m_thisAgentUpdateArgs.CameraUpAxis);
5635 if ( 5637 if (
5636 /* These 4 are the worst offenders! 5638 /* These 4 are the worst offenders!
5637 * With Singularity, there is a bug where sometimes the spam on these doesn't stop */ 5639 * With Singularity, there is a bug where sometimes the spam on these doesn't stop */