diff options
author | Robert Adams | 2016-01-18 06:58:41 -0800 |
---|---|---|
committer | Robert Adams | 2016-01-18 06:58:41 -0800 |
commit | b02f29300d4b060d5d98b6a753e33f556941359e (patch) | |
tree | 43773baa970125f3d5eb4074512ff6b8c18e0081 /OpenSim/Region/Framework/Scenes | |
parent | BulletSim: fix Mantis 7798: land collisions not working. (diff) | |
download | opensim-SC-b02f29300d4b060d5d98b6a753e33f556941359e.zip opensim-SC-b02f29300d4b060d5d98b6a753e33f556941359e.tar.gz opensim-SC-b02f29300d4b060d5d98b6a753e33f556941359e.tar.bz2 opensim-SC-b02f29300d4b060d5d98b6a753e33f556941359e.tar.xz |
Code cleanup to terse update sending as given in a patch in Mantis 7813.
Thanks tqlion!
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-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 | } |