diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 142d643..fa35691 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3557,31 +3557,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3557 | if (Appearance.AvatarSize != m_lastSize) | 3557 | if (Appearance.AvatarSize != m_lastSize) |
3558 | SendAvatarDataToAllAgents(); | 3558 | SendAvatarDataToAllAgents(); |
3559 | 3559 | ||
3560 | if (!IsSatOnObject) | 3560 | // Send terse position update if not sitting and position, velocity, or rotation |
3561 | { | 3561 | // has changed significantly from last sent update |
3562 | // this does need to be more complex later | 3562 | if (!IsSatOnObject && ( |
3563 | Vector3 vel = Velocity; | 3563 | !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) |
3564 | Vector3 dpos = m_pos - m_lastPosition; | 3564 | || !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) |
3565 | if( Math.Abs(vel.X - m_lastVelocity.X) > VELOCITY_TOLERANCE || | 3565 | || !m_pos.ApproxEquals(m_lastPosition, POSITION_LARGETOLERANCE) |
3566 | Math.Abs(vel.Y - m_lastVelocity.Y) > VELOCITY_TOLERANCE || | 3566 | || (!m_pos.ApproxEquals(m_lastPosition, POSITION_SMALLTOLERANCE) && Velocity.LengthSquared() < LOWVELOCITYSQ ) |
3567 | Math.Abs(vel.Z - m_lastVelocity.Z) > VELOCITY_TOLERANCE || | 3567 | ) ) |
3568 | 3568 | { | |
3569 | Math.Abs(m_bodyRot.X - m_lastRotation.X) > ROTATION_TOLERANCE || | 3569 | SendTerseUpdateToAllClients(); |
3570 | Math.Abs(m_bodyRot.Y - m_lastRotation.Y) > ROTATION_TOLERANCE || | ||
3571 | Math.Abs(m_bodyRot.Z - m_lastRotation.Z) > ROTATION_TOLERANCE || | ||
3572 | |||
3573 | Math.Abs(dpos.X) > POSITION_LARGETOLERANCE || | ||
3574 | Math.Abs(dpos.Y) > POSITION_LARGETOLERANCE || | ||
3575 | Math.Abs(dpos.Z) > POSITION_LARGETOLERANCE || | ||
3576 | |||
3577 | ( (Math.Abs(dpos.X) > POSITION_SMALLTOLERANCE || | ||
3578 | Math.Abs(dpos.Y) > POSITION_SMALLTOLERANCE || | ||
3579 | Math.Abs(dpos.Z) > POSITION_SMALLTOLERANCE) | ||
3580 | && vel.LengthSquared() < LOWVELOCITYSQ | ||
3581 | )) | ||
3582 | { | ||
3583 | SendTerseUpdateToAllClients(); | ||
3584 | } | ||
3585 | } | 3570 | } |
3586 | CheckForSignificantMovement(); | 3571 | CheckForSignificantMovement(); |
3587 | } | 3572 | } |