aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
2 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 9b11582..e1588ce 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -253,6 +253,7 @@ namespace OpenSim.Region.Framework.Scenes
253 protected Vector3 m_lastVelocity; 253 protected Vector3 m_lastVelocity;
254 protected Vector3 m_lastAcceleration; 254 protected Vector3 m_lastAcceleration;
255 protected Vector3 m_lastAngularVelocity; 255 protected Vector3 m_lastAngularVelocity;
256 protected int m_lastTerseSent;
256 257
257 // TODO: Those have to be changed into persistent properties at some later point, 258 // TODO: Those have to be changed into persistent properties at some later point,
258 // or sit-camera on vehicles will break on sim-crossing. 259 // or sit-camera on vehicles will break on sim-crossing.
@@ -2395,6 +2396,7 @@ if (m_shape != null) {
2395 { 2396 {
2396 const float VELOCITY_TOLERANCE = 0.01f; 2397 const float VELOCITY_TOLERANCE = 0.01f;
2397 const float POSITION_TOLERANCE = 0.1f; 2398 const float POSITION_TOLERANCE = 0.1f;
2399 const int TIME_MS_TOLERANCE = 3000;
2398 2400
2399 if (m_updateFlag == 1) 2401 if (m_updateFlag == 1)
2400 { 2402 {
@@ -2403,7 +2405,8 @@ if (m_shape != null) {
2403 Acceleration != m_lastAcceleration || 2405 Acceleration != m_lastAcceleration ||
2404 (Velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || 2406 (Velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE ||
2405 (RotationalVelocity - m_lastAngularVelocity).Length() > VELOCITY_TOLERANCE || 2407 (RotationalVelocity - m_lastAngularVelocity).Length() > VELOCITY_TOLERANCE ||
2406 (OffsetPosition - m_lastPosition).Length() > POSITION_TOLERANCE) 2408 (OffsetPosition - m_lastPosition).Length() > POSITION_TOLERANCE ||
2409 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
2407 { 2410 {
2408 AddTerseUpdateToAllAvatars(); 2411 AddTerseUpdateToAllAvatars();
2409 ClearUpdateSchedule(); 2412 ClearUpdateSchedule();
@@ -2422,6 +2425,7 @@ if (m_shape != null) {
2422 m_lastVelocity = Velocity; 2425 m_lastVelocity = Velocity;
2423 m_lastAcceleration = Acceleration; 2426 m_lastAcceleration = Acceleration;
2424 m_lastAngularVelocity = RotationalVelocity; 2427 m_lastAngularVelocity = RotationalVelocity;
2428 m_lastTerseSent = Environment.TickCount;
2425 } 2429 }
2426 } 2430 }
2427 else 2431 else
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 87fac0c..92f00c4 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -96,6 +96,7 @@ namespace OpenSim.Region.Framework.Scenes
96 private Vector3 m_lastPosition; 96 private Vector3 m_lastPosition;
97 private Quaternion m_lastRotation; 97 private Quaternion m_lastRotation;
98 private Vector3 m_lastVelocity; 98 private Vector3 m_lastVelocity;
99 private int m_lastTerseSent;
99 100
100 private bool m_updateflag; 101 private bool m_updateflag;
101 private byte m_movementflag; 102 private byte m_movementflag;
@@ -2363,6 +2364,7 @@ namespace OpenSim.Region.Framework.Scenes
2363 { 2364 {
2364 const float VELOCITY_TOLERANCE = 0.01f; 2365 const float VELOCITY_TOLERANCE = 0.01f;
2365 const float POSITION_TOLERANCE = 10.0f; 2366 const float POSITION_TOLERANCE = 10.0f;
2367 const int TIME_MS_TOLERANCE = 3000;
2366 2368
2367 SendPrimUpdates(); 2369 SendPrimUpdates();
2368 2370
@@ -2377,7 +2379,8 @@ namespace OpenSim.Region.Framework.Scenes
2377 // Throw away duplicate or insignificant updates 2379 // Throw away duplicate or insignificant updates
2378 if (m_bodyRot != m_lastRotation || 2380 if (m_bodyRot != m_lastRotation ||
2379 (m_velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || 2381 (m_velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE ||
2380 (m_pos - m_lastPosition).Length() > POSITION_TOLERANCE) 2382 (m_pos - m_lastPosition).Length() > POSITION_TOLERANCE ||
2383 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
2381 { 2384 {
2382 SendTerseUpdateToAllClients(); 2385 SendTerseUpdateToAllClients();
2383 2386
@@ -2385,6 +2388,7 @@ namespace OpenSim.Region.Framework.Scenes
2385 m_lastPosition = m_pos; 2388 m_lastPosition = m_pos;
2386 m_lastRotation = m_bodyRot; 2389 m_lastRotation = m_bodyRot;
2387 m_lastVelocity = m_velocity; 2390 m_lastVelocity = m_velocity;
2391 m_lastTerseSent = Environment.TickCount;
2388 } 2392 }
2389 2393
2390 // followed suggestion from mic bowman. reversed the two lines below. 2394 // followed suggestion from mic bowman. reversed the two lines below.