diff options
author | Robert Adams | 2013-01-18 11:39:24 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-18 11:39:24 -0800 |
commit | c6b6c94ccbbbd5226a377a510a988bedec7a418c (patch) | |
tree | 7abde96ff752d5e10dcbbe47ed6f6df63e75e643 /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |
parent | BulletSim: add logic to turn off pre-step actions when object goes (diff) | |
download | opensim-SC-c6b6c94ccbbbd5226a377a510a988bedec7a418c.zip opensim-SC-c6b6c94ccbbbd5226a377a510a988bedec7a418c.tar.gz opensim-SC-c6b6c94ccbbbd5226a377a510a988bedec7a418c.tar.bz2 opensim-SC-c6b6c94ccbbbd5226a377a510a988bedec7a418c.tar.xz |
BulletSim: reduce jitter in avatar velocity when walking or flying.
OpenSimulator is VERY sensitive to changes in avatar velocity and
will send an avatar update message when velocity changes more than
0.001m/s. This significantly reduces the number of avatar update messages by
smoothing the avatar velocity returned by Bullet.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 6d5e23f..478aeab 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -853,7 +853,14 @@ public sealed class BSCharacter : BSPhysObject | |||
853 | { | 853 | { |
854 | _position = entprop.Position; | 854 | _position = entprop.Position; |
855 | _orientation = entprop.Rotation; | 855 | _orientation = entprop.Rotation; |
856 | _velocity = entprop.Velocity; | 856 | |
857 | // Smooth velocity. OpenSimulator is very sensitive to changes in velocity of the avatar | ||
858 | // and will send agent updates to the clients if velocity changes by more than | ||
859 | // 0.001m/s. Bullet introduces a lot of jitter in the velocity which causes many | ||
860 | // extra updates. | ||
861 | if (!entprop.Velocity.ApproxEquals(_velocity, 0.1f)) | ||
862 | _velocity = entprop.Velocity; | ||
863 | |||
857 | _acceleration = entprop.Acceleration; | 864 | _acceleration = entprop.Acceleration; |
858 | _rotationalVelocity = entprop.RotationalVelocity; | 865 | _rotationalVelocity = entprop.RotationalVelocity; |
859 | 866 | ||