Add check to always push terse updates for presences that have new velocities of zero.

0.7.5-pf-bulletsim
Robert Adams 2012-12-27 16:03:14 -08:00
parent e57c0e6731
commit 5afab9bcfe
1 changed files with 8 additions and 3 deletions

View File

@ -2335,9 +2335,14 @@ namespace OpenSim.Region.Framework.Scenes
// storing a requested force instead of an actual traveling velocity // storing a requested force instead of an actual traveling velocity
// Throw away duplicate or insignificant updates // Throw away duplicate or insignificant updates
if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || if (
!Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || // If the velocity has become zero, send it no matter what.
!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) (Velocity != m_lastVelocity && Velocity == Vector3.Zero)
// otherwise, if things have changed reasonably, send the update
|| (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)
|| !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE)
|| !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)))
{ {
SendTerseUpdateToAllClients(); SendTerseUpdateToAllClients();