diff options
author | dahlia | 2011-05-06 16:56:54 -0700 |
---|---|---|
committer | dahlia | 2011-05-06 16:56:54 -0700 |
commit | eaa33cf478070bcc45f43c84a3145e8f2e016ea9 (patch) | |
tree | b646392994882f81dfca73dda617b96378fae13c /OpenSim/Region/Framework/Scenes | |
parent | refactor: simplify ConfigSettings (diff) | |
download | opensim-SC-eaa33cf478070bcc45f43c84a3145e8f2e016ea9.zip opensim-SC-eaa33cf478070bcc45f43c84a3145e8f2e016ea9.tar.gz opensim-SC-eaa33cf478070bcc45f43c84a3145e8f2e016ea9.tar.bz2 opensim-SC-eaa33cf478070bcc45f43c84a3145e8f2e016ea9.tar.xz |
adjust avatar terse update packet filter distance error threshold based on avatar speed
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ae4bd17..f6295b1 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2430,8 +2430,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2430 | float speed = Velocity.Length(); | 2430 | float speed = Velocity.Length(); |
2431 | float velocidyDiff = Vector3.Distance(lastVelocitySentToAllClients, Velocity); | 2431 | float velocidyDiff = Vector3.Distance(lastVelocitySentToAllClients, Velocity); |
2432 | 2432 | ||
2433 | // assuming 5 ms. worst case precision for timer, use 2x that | ||
2434 | // for distance error threshold | ||
2435 | float distanceErrorThreshold = speed * 0.01f; | ||
2436 | |||
2433 | if (speed < 0.01f // allow rotation updates if avatar position is unchanged | 2437 | if (speed < 0.01f // allow rotation updates if avatar position is unchanged |
2434 | || Math.Abs(distanceError) > 0.25f // arbitrary distance error threshold | 2438 | || Math.Abs(distanceError) > distanceErrorThreshold |
2435 | || velocidyDiff > 0.01f) // did velocity change from last update? | 2439 | || velocidyDiff > 0.01f) // did velocity change from last update? |
2436 | { | 2440 | { |
2437 | m_perfMonMS = currentTick; | 2441 | m_perfMonMS = currentTick; |