aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs36
1 files changed, 23 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c1b62af..ba3aaae 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -279,8 +279,11 @@ namespace OpenSim.Region.Framework.Scenes
279 private bool MouseDown = false; 279 private bool MouseDown = false;
280 public Vector3 lastKnownAllowedPosition; 280 public Vector3 lastKnownAllowedPosition;
281 public bool sentMessageAboutRestrictedParcelFlyingDown; 281 public bool sentMessageAboutRestrictedParcelFlyingDown;
282
282 public Vector4 CollisionPlane = Vector4.UnitW; 283 public Vector4 CollisionPlane = Vector4.UnitW;
283 284
285 public Vector4 m_lastCollisionPlane = Vector4.UnitW;
286 private byte m_lastState;
284 private Vector3 m_lastPosition; 287 private Vector3 m_lastPosition;
285 private Quaternion m_lastRotation; 288 private Quaternion m_lastRotation;
286 private Vector3 m_lastVelocity; 289 private Vector3 m_lastVelocity;
@@ -2818,16 +2821,13 @@ namespace OpenSim.Region.Framework.Scenes
2818 CameraAtAxis = agentData.CameraAtAxis; 2821 CameraAtAxis = agentData.CameraAtAxis;
2819 CameraLeftAxis = agentData.CameraLeftAxis; 2822 CameraLeftAxis = agentData.CameraLeftAxis;
2820 CameraUpAxis = agentData.CameraUpAxis; 2823 CameraUpAxis = agentData.CameraUpAxis;
2821 Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis);
2822 CameraRotation = camRot;
2823
2824 // The Agent's Draw distance setting
2825 // When we get to the point of re-computing neighbors everytime this
2826 // changes, then start using the agent's drawdistance rather than the
2827 // region's draw distance.
2828
2829 DrawDistance = agentData.Far; 2824 DrawDistance = agentData.Far;
2830 2825
2826 CameraAtAxis.Normalize();
2827 CameraLeftAxis.Normalize();
2828 CameraUpAxis.Normalize();
2829 Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis);
2830 CameraRotation = camRot;
2831 2831
2832 // Check if Client has camera in 'follow cam' or 'build' mode. 2832 // Check if Client has camera in 'follow cam' or 'build' mode.
2833// Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); 2833// Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
@@ -3794,15 +3794,17 @@ namespace OpenSim.Region.Framework.Scenes
3794 // this does need to be more complex later 3794 // this does need to be more complex later
3795 Vector3 vel = Velocity; 3795 Vector3 vel = Velocity;
3796 Vector3 dpos = m_pos - m_lastPosition; 3796 Vector3 dpos = m_pos - m_lastPosition;
3797 if( Math.Abs(vel.X - m_lastVelocity.X) > VELOCITY_TOLERANCE || 3797 if( State != m_lastState ||
3798 Math.Abs(vel.X - m_lastVelocity.X) > VELOCITY_TOLERANCE ||
3798 Math.Abs(vel.Y - m_lastVelocity.Y) > VELOCITY_TOLERANCE || 3799 Math.Abs(vel.Y - m_lastVelocity.Y) > VELOCITY_TOLERANCE ||
3799 Math.Abs(vel.Z - m_lastVelocity.Z) > VELOCITY_TOLERANCE || 3800 Math.Abs(vel.Z - m_lastVelocity.Z) > VELOCITY_TOLERANCE ||
3800 3801
3801 Math.Abs(m_bodyRot.X - m_lastRotation.X) > ROTATION_TOLERANCE || 3802 Math.Abs(m_bodyRot.X - m_lastRotation.X) > ROTATION_TOLERANCE ||
3802 Math.Abs(m_bodyRot.Y - m_lastRotation.Y) > ROTATION_TOLERANCE || 3803 Math.Abs(m_bodyRot.Y - m_lastRotation.Y) > ROTATION_TOLERANCE ||
3803 Math.Abs(m_bodyRot.Z - m_lastRotation.Z) > ROTATION_TOLERANCE || 3804 Math.Abs(m_bodyRot.Z - m_lastRotation.Z) > ROTATION_TOLERANCE ||
3804 3805
3805 (vel == Vector3.Zero && m_lastVelocity != Vector3.Zero) || 3806 (vel == Vector3.Zero && m_lastVelocity != Vector3.Zero) ||
3807
3806 Math.Abs(dpos.X) > POSITION_LARGETOLERANCE || 3808 Math.Abs(dpos.X) > POSITION_LARGETOLERANCE ||
3807 Math.Abs(dpos.Y) > POSITION_LARGETOLERANCE || 3809 Math.Abs(dpos.Y) > POSITION_LARGETOLERANCE ||
3808 Math.Abs(dpos.Z) > POSITION_LARGETOLERANCE || 3810 Math.Abs(dpos.Z) > POSITION_LARGETOLERANCE ||
@@ -3811,7 +3813,12 @@ namespace OpenSim.Region.Framework.Scenes
3811 Math.Abs(dpos.Y) > POSITION_SMALLTOLERANCE || 3813 Math.Abs(dpos.Y) > POSITION_SMALLTOLERANCE ||
3812 Math.Abs(dpos.Z) > POSITION_SMALLTOLERANCE) 3814 Math.Abs(dpos.Z) > POSITION_SMALLTOLERANCE)
3813 && vel.LengthSquared() < LOWVELOCITYSQ 3815 && vel.LengthSquared() < LOWVELOCITYSQ
3814 )) 3816 ) ||
3817
3818 Math.Abs(CollisionPlane.X - m_lastCollisionPlane.X) > POSITION_SMALLTOLERANCE ||
3819 Math.Abs(CollisionPlane.Y - m_lastCollisionPlane.Y) > POSITION_SMALLTOLERANCE ||
3820 Math.Abs(CollisionPlane.W - m_lastCollisionPlane.W) > POSITION_SMALLTOLERANCE
3821 )
3815 { 3822 {
3816 SendTerseUpdateToAllClients(); 3823 SendTerseUpdateToAllClients();
3817 } 3824 }
@@ -3910,11 +3917,14 @@ namespace OpenSim.Region.Framework.Scenes
3910 /// </summary> 3917 /// </summary>
3911 public void SendTerseUpdateToAllClients() 3918 public void SendTerseUpdateToAllClients()
3912 { 3919 {
3913 m_scene.ForEachScenePresence(SendTerseUpdateToAgent); 3920 m_lastState = State;
3914 // Update the "last" values
3915 m_lastPosition = m_pos; 3921 m_lastPosition = m_pos;
3916 m_lastRotation = m_bodyRot; 3922 m_lastRotation = m_bodyRot;
3917 m_lastVelocity = Velocity; 3923 m_lastVelocity = Velocity;
3924 m_lastCollisionPlane = CollisionPlane;
3925
3926 m_scene.ForEachScenePresence(SendTerseUpdateToAgent);
3927 // Update the "last" values
3918 TriggerScenePresenceUpdated(); 3928 TriggerScenePresenceUpdated();
3919 } 3929 }
3920 3930