mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
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.
This commit is contained in:
@@ -853,7 +853,14 @@ public sealed class BSCharacter : BSPhysObject
|
||||
{
|
||||
_position = entprop.Position;
|
||||
_orientation = entprop.Rotation;
|
||||
_velocity = entprop.Velocity;
|
||||
|
||||
// Smooth velocity. OpenSimulator is very sensitive to changes in velocity of the avatar
|
||||
// and will send agent updates to the clients if velocity changes by more than
|
||||
// 0.001m/s. Bullet introduces a lot of jitter in the velocity which causes many
|
||||
// extra updates.
|
||||
if (!entprop.Velocity.ApproxEquals(_velocity, 0.1f))
|
||||
_velocity = entprop.Velocity;
|
||||
|
||||
_acceleration = entprop.Acceleration;
|
||||
_rotationalVelocity = entprop.RotationalVelocity;
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ public abstract class BSPhysObject : PhysicsActor
|
||||
|
||||
// It can be confusing for an actor to know if it should move or update an object
|
||||
// depeneding on the setting of 'selected', 'physical, ...
|
||||
// This flag is the true test -- if true, the object is being acted on in the physical world
|
||||
// This flag is the true test -- if true, the object is being acted on in the physical world
|
||||
public abstract bool IsPhysicallyActive { get; }
|
||||
|
||||
// Materialness
|
||||
|
||||
Reference in New Issue
Block a user