diff options
author | Diva Canto | 2013-07-20 13:42:39 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-21 09:00:57 -0700 |
commit | 3919c805054e6ce240c72436414ecee18a6c2947 (patch) | |
tree | 81457a560daf103883b112170ff944b88b3861c8 | |
parent | Manage AgentUpdates more sanely: (diff) | |
download | opensim-SC-3919c805054e6ce240c72436414ecee18a6c2947.zip opensim-SC-3919c805054e6ce240c72436414ecee18a6c2947.tar.gz opensim-SC-3919c805054e6ce240c72436414ecee18a6c2947.tar.bz2 opensim-SC-3919c805054e6ce240c72436414ecee18a6c2947.tar.xz |
A couple of small optimizations over the previous commit
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 |
2 files changed, 11 insertions, 9 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 */ |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5543964..2359f55 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1735,7 +1735,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1735 | /// <summary> | 1735 | /// <summary> |
1736 | /// This is the event handler for client cameras. If a client is moving, or moving the camera, this event is triggering. | 1736 | /// This is the event handler for client cameras. If a client is moving, or moving the camera, this event is triggering. |
1737 | /// </summary> | 1737 | /// </summary> |
1738 | public void HandleAgentCamerasUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | 1738 | private void HandleAgentCamerasUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) |
1739 | { | 1739 | { |
1740 | //m_log.DebugFormat( | 1740 | //m_log.DebugFormat( |
1741 | // "[SCENE PRESENCE]: In {0} received agent camera update from {1}, flags {2}", | 1741 | // "[SCENE PRESENCE]: In {0} received agent camera update from {1}, flags {2}", |