aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-05-30 22:04:59 +0100
committerJustin Clark-Casey (justincc)2014-05-30 22:12:23 +0100
commita755c57b440f153df8cb50674260f31e5b26c172 (patch)
treede7ffbf859d6862c7e8ec9e073327961a3cfeaf5
parentAdd a 0 parameter overload for RestClient.Request() for use when no auth is r... (diff)
downloadopensim-SC-a755c57b440f153df8cb50674260f31e5b26c172.zip
opensim-SC-a755c57b440f153df8cb50674260f31e5b26c172.tar.gz
opensim-SC-a755c57b440f153df8cb50674260f31e5b26c172.tar.bz2
opensim-SC-a755c57b440f153df8cb50674260f31e5b26c172.tar.xz
Fix issue with BulletSim avatar level flight jitter by commenting out RawVelocity update threshold for now in BSCharacter.UpdateProperties().
For some reason as yet unidentified (feedback?) a threshold above 0.4 here causes the RawVelocity to move between a lower and upper bound rather than remaining constant. The RawVelocity increased until it triggered the threshold update, at which point it started to decrease until it again triggered the threshhold update. This delta-v was enough to exceed the checks in ScenePresence.SendTerseUpdateToAllClients() and produce jittery avatar flight because of the fluctuating velocity. With a threshold of 0.4 (or 0, as with ODE), the RawVelocity remains constant in BulletSim and so avatar flight becomes mostly smooth - remaining occasional glitches appear to be a result of errors in distance extraploation. There are no obvious problems with commenting out the threshold. Misterblue, if this is wrong or I've missed some subtlety here, please feel free to revert and/or correct. The same considerations may or may not apply to object velocity updates.
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index dfcd2bf..9b56fb4 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -744,7 +744,18 @@ public sealed class BSCharacter : BSPhysObject
744 // and will send agent updates to the clients if velocity changes by more than 744 // and will send agent updates to the clients if velocity changes by more than
745 // 0.001m/s. Bullet introduces a lot of jitter in the velocity which causes many 745 // 0.001m/s. Bullet introduces a lot of jitter in the velocity which causes many
746 // extra updates. 746 // extra updates.
747 if (!entprop.Velocity.ApproxEquals(RawVelocity, 0.1f)) 747 //
748 // XXX: Contrary to the above comment, setting an update threshold here above 0.4 actually introduces jitter to
749 // avatar movement rather than removes it. The larger the threshold, the bigger the jitter.
750 // This is most noticeable in level flight and can be seen with
751 // the "show updates" option in a viewer. With an update threshold, the RawVelocity cycles between a lower
752 // bound and an upper bound, where the difference between the two is enough to trigger a large delta v update
753 // and subsequently trigger an update in ScenePresence.SendTerseUpdateToAllClients(). The cause of this cycle (feedback?)
754 // has not yet been identified.
755 //
756 // If there is a threshold below 0.4 or no threshold check at all (as in ODE), then RawVelocity stays constant and extra
757 // updates are not triggered in ScenePresence.SendTerseUpdateToAllClients().
758// if (!entprop.Velocity.ApproxEquals(RawVelocity, 0.1f))
748 RawVelocity = entprop.Velocity; 759 RawVelocity = entprop.Velocity;
749 760
750 _acceleration = entprop.Acceleration; 761 _acceleration = entprop.Acceleration;