From f54fccba1e436c12e55da9dfa5ca089440783e16 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 29 Jul 2014 03:13:10 +0100
Subject: 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.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 20 +++++++++++++++++++-
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 10 +++-------
2 files changed, 22 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1639ee4..482e803 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -230,7 +230,22 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Temporarily setting to trigger appearance resends at 60 second intervals.
///
- public bool SendPeriodicAppearanceUpdates { get; set; }
+ public bool SendPeriodicAppearanceUpdates { get; set; }
+
+ ///
+ /// How much a client has to change position before updates are sent to viewers.
+ ///
+ public float ClientPositionUpdateTolerance { get; set; }
+
+ ///
+ /// How much a client has to rotate before updates are sent to viewers.
+ ///
+ public float ClientRotationUpdateTolerance { get; set; }
+
+ ///
+ /// How much a client has to change velocity before updates are sent to viewers.
+ ///
+ 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();
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 34c6f7c..18a0491 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -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)
{
--
cgit v1.1