current priority code uses avatar position not camera, so fix reprioritizer. This may need to be reviewed in future.. it should be camera
parent
ed74fb5da4
commit
01b4b25cdb
|
@ -349,6 +349,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
protected int m_reprioritizationLastTime;
|
protected int m_reprioritizationLastTime;
|
||||||
protected bool m_reprioritizationBusy;
|
protected bool m_reprioritizationBusy;
|
||||||
|
protected Vector3 m_reprioritizationLastPosition;
|
||||||
|
|
||||||
private Quaternion m_headrotation = Quaternion.Identity;
|
private Quaternion m_headrotation = Quaternion.Identity;
|
||||||
|
|
||||||
|
@ -522,7 +523,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Position of agent's camera in world (region cordinates)
|
/// Position of agent's camera in world (region cordinates)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected Vector3 m_lastCameraPosition;
|
// protected Vector3 m_lastCameraPosition;
|
||||||
|
|
||||||
private Vector4 m_lastCameraCollisionPlane = new Vector4(0f, 0f, 0f, 1);
|
private Vector4 m_lastCameraCollisionPlane = new Vector4(0f, 0f, 0f, 1);
|
||||||
private bool m_doingCamRayCast = false;
|
private bool m_doingCamRayCast = false;
|
||||||
|
@ -1028,7 +1029,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
|
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
|
||||||
|
|
||||||
AbsolutePosition = posLastMove = posLastSignificantMove = CameraPosition =
|
AbsolutePosition = posLastMove = posLastSignificantMove = CameraPosition =
|
||||||
m_lastCameraPosition = ControllingClient.StartPos;
|
m_reprioritizationLastPosition = ControllingClient.StartPos;
|
||||||
|
|
||||||
// disable updates workjobs for now
|
// disable updates workjobs for now
|
||||||
childUpdatesBusy = true;
|
childUpdatesBusy = true;
|
||||||
|
@ -2042,7 +2043,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (m_teleportFlags > 0 && !isNPC || m_currentParcelHide)
|
if (m_teleportFlags > 0 && !isNPC || m_currentParcelHide)
|
||||||
SendInitialDataToMe();
|
SendInitialDataToMe();
|
||||||
|
|
||||||
m_lastCameraPosition = CameraPosition;
|
// priority uses avatar position only
|
||||||
|
m_reprioritizationLastPosition = AbsolutePosition;
|
||||||
m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it
|
m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it
|
||||||
m_reprioritizationBusy = false;
|
m_reprioritizationBusy = false;
|
||||||
|
|
||||||
|
@ -3879,9 +3881,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime);
|
int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime);
|
||||||
if(tdiff < Scene.ReprioritizationInterval)
|
if(tdiff < Scene.ReprioritizationInterval)
|
||||||
return;
|
return;
|
||||||
|
// priority uses avatar position
|
||||||
Vector3 pos = CameraPosition;
|
Vector3 pos = AbsolutePosition;
|
||||||
Vector3 diff = pos - m_lastCameraPosition;
|
Vector3 diff = pos - m_reprioritizationLastPosition;
|
||||||
float limit;
|
float limit;
|
||||||
if(IsChildAgent)
|
if(IsChildAgent)
|
||||||
limit = (float)Scene.ChildReprioritizationDistance;
|
limit = (float)Scene.ChildReprioritizationDistance;
|
||||||
|
@ -3893,7 +3895,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_reprioritizationBusy = true;
|
m_reprioritizationBusy = true;
|
||||||
m_lastCameraPosition = pos;
|
m_reprioritizationLastPosition = pos;
|
||||||
|
|
||||||
Util.FireAndForget(
|
Util.FireAndForget(
|
||||||
o =>
|
o =>
|
||||||
|
|
Loading…
Reference in New Issue