diff options
author | UbitUmarov | 2015-12-17 18:15:33 +0000 |
---|---|---|
committer | UbitUmarov | 2015-12-17 18:15:33 +0000 |
commit | 01b4b25cdb18d495fe27619fd2817d86490da3ee (patch) | |
tree | 9cc62a631849aa68580989fe4265280a0b01ceb3 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | save a expensive call to CameraPosition (diff) | |
download | opensim-SC_OLD-01b4b25cdb18d495fe27619fd2817d86490da3ee.zip opensim-SC_OLD-01b4b25cdb18d495fe27619fd2817d86490da3ee.tar.gz opensim-SC_OLD-01b4b25cdb18d495fe27619fd2817d86490da3ee.tar.bz2 opensim-SC_OLD-01b4b25cdb18d495fe27619fd2817d86490da3ee.tar.xz |
current priority code uses avatar position not camera, so fix reprioritizer. This may need to be reviewed in future.. it should be camera
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 553e293..6a4675e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -349,6 +349,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
349 | 349 | ||
350 | protected int m_reprioritizationLastTime; | 350 | protected int m_reprioritizationLastTime; |
351 | protected bool m_reprioritizationBusy; | 351 | protected bool m_reprioritizationBusy; |
352 | protected Vector3 m_reprioritizationLastPosition; | ||
352 | 353 | ||
353 | private Quaternion m_headrotation = Quaternion.Identity; | 354 | private Quaternion m_headrotation = Quaternion.Identity; |
354 | 355 | ||
@@ -522,7 +523,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
522 | /// <summary> | 523 | /// <summary> |
523 | /// Position of agent's camera in world (region cordinates) | 524 | /// Position of agent's camera in world (region cordinates) |
524 | /// </summary> | 525 | /// </summary> |
525 | protected Vector3 m_lastCameraPosition; | 526 | // protected Vector3 m_lastCameraPosition; |
526 | 527 | ||
527 | private Vector4 m_lastCameraCollisionPlane = new Vector4(0f, 0f, 0f, 1); | 528 | private Vector4 m_lastCameraCollisionPlane = new Vector4(0f, 0f, 0f, 1); |
528 | private bool m_doingCamRayCast = false; | 529 | private bool m_doingCamRayCast = false; |
@@ -1028,7 +1029,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1028 | m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>(); | 1029 | m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>(); |
1029 | 1030 | ||
1030 | AbsolutePosition = posLastMove = posLastSignificantMove = CameraPosition = | 1031 | AbsolutePosition = posLastMove = posLastSignificantMove = CameraPosition = |
1031 | m_lastCameraPosition = ControllingClient.StartPos; | 1032 | m_reprioritizationLastPosition = ControllingClient.StartPos; |
1032 | 1033 | ||
1033 | // disable updates workjobs for now | 1034 | // disable updates workjobs for now |
1034 | childUpdatesBusy = true; | 1035 | childUpdatesBusy = true; |
@@ -2042,7 +2043,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2042 | if (m_teleportFlags > 0 && !isNPC || m_currentParcelHide) | 2043 | if (m_teleportFlags > 0 && !isNPC || m_currentParcelHide) |
2043 | SendInitialDataToMe(); | 2044 | SendInitialDataToMe(); |
2044 | 2045 | ||
2045 | m_lastCameraPosition = CameraPosition; | 2046 | // priority uses avatar position only |
2047 | m_reprioritizationLastPosition = AbsolutePosition; | ||
2046 | m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it | 2048 | m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it |
2047 | m_reprioritizationBusy = false; | 2049 | m_reprioritizationBusy = false; |
2048 | 2050 | ||
@@ -3879,9 +3881,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3879 | int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime); | 3881 | int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime); |
3880 | if(tdiff < Scene.ReprioritizationInterval) | 3882 | if(tdiff < Scene.ReprioritizationInterval) |
3881 | return; | 3883 | return; |
3882 | 3884 | // priority uses avatar position | |
3883 | Vector3 pos = CameraPosition; | 3885 | Vector3 pos = AbsolutePosition; |
3884 | Vector3 diff = pos - m_lastCameraPosition; | 3886 | Vector3 diff = pos - m_reprioritizationLastPosition; |
3885 | float limit; | 3887 | float limit; |
3886 | if(IsChildAgent) | 3888 | if(IsChildAgent) |
3887 | limit = (float)Scene.ChildReprioritizationDistance; | 3889 | limit = (float)Scene.ChildReprioritizationDistance; |
@@ -3893,7 +3895,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3893 | return; | 3895 | return; |
3894 | 3896 | ||
3895 | m_reprioritizationBusy = true; | 3897 | m_reprioritizationBusy = true; |
3896 | m_lastCameraPosition = pos; | 3898 | m_reprioritizationLastPosition = pos; |
3897 | 3899 | ||
3898 | Util.FireAndForget( | 3900 | Util.FireAndForget( |
3899 | o => | 3901 | o => |