Make it possible to change avatar position update, rotation and velocity tolerances on the fly.

This is done via "debug scene set client-pos-upd, client-rot-upd, client-vel-upd".
For testing purposes.
This commit is contained in:
Justin Clark-Casey (justincc)
2014-07-29 03:13:10 +01:00
parent 3654ae8d8c
commit f54fccba1e
3 changed files with 79 additions and 29 deletions

View File

@@ -230,7 +230,22 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Temporarily setting to trigger appearance resends at 60 second intervals.
/// </summary>
public bool SendPeriodicAppearanceUpdates { get; set; }
public bool SendPeriodicAppearanceUpdates { get; set; }
/// <summary>
/// How much a client has to change position before updates are sent to viewers.
/// </summary>
public float ClientPositionUpdateTolerance { get; set; }
/// <summary>
/// How much a client has to rotate before updates are sent to viewers.
/// </summary>
public float ClientRotationUpdateTolerance { get; set; }
/// <summary>
/// How much a client has to change velocity before updates are sent to viewers.
/// </summary>
public float ClientVelocityUpdateTolerance { get; set; }
protected float m_defaultDrawDistance = 255.0f;
public float DefaultDrawDistance
@@ -1046,6 +1061,9 @@ namespace OpenSim.Region.Framework.Scenes
PeriodicBackup = true;
UseBackup = true;
ClientRotationUpdateTolerance = 0.01f;
ClientVelocityUpdateTolerance = 0.001f;
ClientPositionUpdateTolerance = 0.05f;
ChildReprioritizationDistance = 20.0;
m_eventManager = new EventManager();

View File

@@ -3182,10 +3182,6 @@ namespace OpenSim.Region.Framework.Scenes
public override void Update()
{
const float ROTATION_TOLERANCE = 0.01f;
const float VELOCITY_TOLERANCE = 0.001f;
const float POSITION_TOLERANCE = 0.05f;
if (IsChildAgent == false)
{
// NOTE: Velocity is not the same as m_velocity. Velocity will attempt to
@@ -3202,9 +3198,9 @@ namespace OpenSim.Region.Framework.Scenes
if (!updateClients)
updateClients
= !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)
|| !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE)
|| !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE);
= !Rotation.ApproxEquals(m_lastRotation, Scene.ClientRotationUpdateTolerance)
|| !Velocity.ApproxEquals(m_lastVelocity, Scene.ClientVelocityUpdateTolerance)
|| !m_pos.ApproxEquals(m_lastPosition, Scene.ClientPositionUpdateTolerance);
if (updateClients)
{