diff options
author | John Hurliman | 2009-10-26 18:22:32 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-26 18:22:32 -0700 |
commit | b6651ce79017bc7c6d1df66757e26a74bacfc36f (patch) | |
tree | d6f9835eff9f7d35da3fcdd3cd063cd72cba41c7 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | Removing the ClientManager reference from IScene and hiding it entirely insid... (diff) | |
download | opensim-SC_OLD-b6651ce79017bc7c6d1df66757e26a74bacfc36f.zip opensim-SC_OLD-b6651ce79017bc7c6d1df66757e26a74bacfc36f.tar.gz opensim-SC_OLD-b6651ce79017bc7c6d1df66757e26a74bacfc36f.tar.bz2 opensim-SC_OLD-b6651ce79017bc7c6d1df66757e26a74bacfc36f.tar.xz |
* Double the priority on avatar bake texture requests to get avatars rezzing in faster than the surrounding scene
* Adds duplicate tracking for SceneObjectParts and ScenePresences to avoid sending out duplicate ImprovedTerseObjectUpdate packets
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d84c35c..a87bde0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -248,6 +248,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
248 | protected UUID m_uuid; | 248 | protected UUID m_uuid; |
249 | protected Vector3 m_velocity; | 249 | protected Vector3 m_velocity; |
250 | 250 | ||
251 | protected Vector3 m_lastPosition; | ||
252 | protected Quaternion m_lastRotation; | ||
253 | protected Vector3 m_lastVelocity; | ||
254 | protected Vector3 m_lastAcceleration; | ||
255 | protected Vector3 m_lastAngularVelocity; | ||
256 | |||
251 | // TODO: Those have to be changed into persistent properties at some later point, | 257 | // TODO: Those have to be changed into persistent properties at some later point, |
252 | // or sit-camera on vehicles will break on sim-crossing. | 258 | // or sit-camera on vehicles will break on sim-crossing. |
253 | private Vector3 m_cameraEyeOffset; | 259 | private Vector3 m_cameraEyeOffset; |
@@ -2387,18 +2393,36 @@ if (m_shape != null) { | |||
2387 | /// </summary> | 2393 | /// </summary> |
2388 | public void SendScheduledUpdates() | 2394 | public void SendScheduledUpdates() |
2389 | { | 2395 | { |
2390 | if (m_updateFlag == 1) //some change has been made so update the clients | 2396 | const float VELOCITY_TOLERANCE = 0.01f; |
2397 | const float POSITION_TOLERANCE = 10.0f; | ||
2398 | |||
2399 | if (m_updateFlag == 1) | ||
2391 | { | 2400 | { |
2392 | AddTerseUpdateToAllAvatars(); | 2401 | // Throw away duplicate or insignificant updates |
2393 | ClearUpdateSchedule(); | 2402 | if (RotationOffset != m_lastRotation || |
2403 | Acceleration != m_lastAcceleration || | ||
2404 | (Velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || | ||
2405 | (RotationalVelocity - m_lastAngularVelocity).Length() > VELOCITY_TOLERANCE || | ||
2406 | (OffsetPosition - m_lastPosition).Length() > POSITION_TOLERANCE) | ||
2407 | { | ||
2408 | AddTerseUpdateToAllAvatars(); | ||
2409 | ClearUpdateSchedule(); | ||
2394 | 2410 | ||
2395 | // This causes the Scene to 'poll' physical objects every couple of frames | 2411 | // This causes the Scene to 'poll' physical objects every couple of frames |
2396 | // bad, so it's been replaced by an event driven method. | 2412 | // bad, so it's been replaced by an event driven method. |
2397 | //if ((ObjectFlags & (uint)PrimFlags.Physics) != 0) | 2413 | //if ((ObjectFlags & (uint)PrimFlags.Physics) != 0) |
2398 | //{ | 2414 | //{ |
2399 | // Only send the constant terse updates on physical objects! | 2415 | // Only send the constant terse updates on physical objects! |
2400 | //ScheduleTerseUpdate(); | 2416 | //ScheduleTerseUpdate(); |
2401 | //} | 2417 | //} |
2418 | |||
2419 | // Update the "last" values | ||
2420 | m_lastPosition = OffsetPosition; | ||
2421 | m_lastRotation = RotationOffset; | ||
2422 | m_lastVelocity = Velocity; | ||
2423 | m_lastAcceleration = Acceleration; | ||
2424 | m_lastAngularVelocity = RotationalVelocity; | ||
2425 | } | ||
2402 | } | 2426 | } |
2403 | else | 2427 | else |
2404 | { | 2428 | { |