diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 576a013..2e16663 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3237,7 +3237,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3237 | 3237 | ||
3238 | /// <summary> | 3238 | /// <summary> |
3239 | /// Schedule a terse update for this prim. Terse updates only send position, | 3239 | /// Schedule a terse update for this prim. Terse updates only send position, |
3240 | /// rotation, velocity and rotational velocity information. | 3240 | /// rotation, velocity and rotational velocity information. WRONG!!!! |
3241 | /// </summary> | 3241 | /// </summary> |
3242 | public void ScheduleTerseUpdate() | 3242 | public void ScheduleTerseUpdate() |
3243 | { | 3243 | { |
@@ -3296,21 +3296,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3296 | sp.SendAttachmentUpdate(this, UpdateRequired.FULL); | 3296 | sp.SendAttachmentUpdate(this, UpdateRequired.FULL); |
3297 | } | 3297 | } |
3298 | } | 3298 | } |
3299 | |||
3300 | /* this does nothing | ||
3301 | SendFullUpdateToClient(remoteClient, Position) ignores position parameter | ||
3302 | if (IsRoot) | ||
3303 | { | ||
3304 | if (ParentGroup.IsAttachment) | ||
3305 | { | ||
3306 | SendFullUpdateToClient(remoteClient, AttachedPos); | ||
3307 | } | ||
3308 | else | ||
3309 | { | ||
3310 | SendFullUpdateToClient(remoteClient, AbsolutePosition); | ||
3311 | } | ||
3312 | } | ||
3313 | */ | ||
3314 | else | 3299 | else |
3315 | { | 3300 | { |
3316 | SendFullUpdateToClient(remoteClient); | 3301 | SendFullUpdateToClient(remoteClient); |
@@ -3396,24 +3381,26 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3396 | ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); | 3381 | ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); |
3397 | } | 3382 | } |
3398 | 3383 | ||
3384 | |||
3385 | private const float ROTATION_TOLERANCE = 0.01f; | ||
3386 | private const float VELOCITY_TOLERANCE = 0.1f; // terse update vel has low resolution | ||
3387 | private const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary | ||
3388 | private const double TIME_MS_TOLERANCE = 200f; //llSetPos has a 200ms delay. This should NOT be 3 seconds. | ||
3399 | 3389 | ||
3400 | /// <summary> | 3390 | /// <summary> |
3401 | /// Tell all the prims which have had updates scheduled | 3391 | /// Tell all the prims which have had updates scheduled |
3402 | /// </summary> | 3392 | /// </summary> |
3403 | public void SendScheduledUpdates() | 3393 | public void SendScheduledUpdates() |
3404 | { | 3394 | { |
3405 | const float ROTATION_TOLERANCE = 0.01f; | ||
3406 | const float VELOCITY_TOLERANCE = 0.1f; // terse update vel has low resolution | ||
3407 | const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary | ||
3408 | const double TIME_MS_TOLERANCE = 200f; //llSetPos has a 200ms delay. This should NOT be 3 seconds. | ||
3409 | |||
3410 | switch (UpdateFlag) | 3395 | switch (UpdateFlag) |
3411 | { | 3396 | { |
3412 | // this is wrong we need to get back to this | 3397 | case UpdateRequired.NONE: |
3413 | case UpdateRequired.TERSE: | ||
3414 | { | ||
3415 | ClearUpdateSchedule(); | 3398 | ClearUpdateSchedule(); |
3399 | break; | ||
3400 | |||
3401 | case UpdateRequired.TERSE: | ||
3416 | 3402 | ||
3403 | ClearUpdateSchedule(); | ||
3417 | bool needupdate = true; | 3404 | bool needupdate = true; |
3418 | double now = Util.GetTimeStampMS(); | 3405 | double now = Util.GetTimeStampMS(); |
3419 | Vector3 curvel = Velocity; | 3406 | Vector3 curvel = Velocity; |
@@ -3423,8 +3410,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3423 | while(true) // just to avoid ugly goto | 3410 | while(true) // just to avoid ugly goto |
3424 | { | 3411 | { |
3425 | double elapsed = now - m_lastUpdateSentTime; | 3412 | double elapsed = now - m_lastUpdateSentTime; |
3426 | |||
3427 | // minimal rate also for the other things on terse updates | ||
3428 | if (elapsed > TIME_MS_TOLERANCE) | 3413 | if (elapsed > TIME_MS_TOLERANCE) |
3429 | break; | 3414 | break; |
3430 | 3415 | ||
@@ -3514,13 +3499,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3514 | }); | 3499 | }); |
3515 | } | 3500 | } |
3516 | break; | 3501 | break; |
3517 | } | 3502 | |
3518 | case UpdateRequired.FULL: | 3503 | case UpdateRequired.FULL: |
3519 | { | ||
3520 | ClearUpdateSchedule(); | 3504 | ClearUpdateSchedule(); |
3521 | SendFullUpdateToAllClientsInternal(); | 3505 | SendFullUpdateToAllClientsInternal(); |
3522 | break; | 3506 | break; |
3523 | } | ||
3524 | } | 3507 | } |
3525 | } | 3508 | } |
3526 | 3509 | ||