diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 73 |
1 files changed, 67 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 98ea880..0930820 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -862,7 +862,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
862 | { | 862 | { |
863 | Vector3 offset = (m_offsetPosition - oldpos); | 863 | Vector3 offset = (m_offsetPosition - oldpos); |
864 | av.AbsolutePosition += offset; | 864 | av.AbsolutePosition += offset; |
865 | av.SendAvatarDataToAllAgents(); | 865 | // av.SendAvatarDataToAllAgents(); |
866 | av.SendTerseUpdateToAllClients(); | ||
866 | } | 867 | } |
867 | } | 868 | } |
868 | } | 869 | } |
@@ -3257,7 +3258,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3257 | /// <summary> | 3258 | /// <summary> |
3258 | /// Send a full update for this part to all clients. | 3259 | /// Send a full update for this part to all clients. |
3259 | /// </summary> | 3260 | /// </summary> |
3260 | public void SendFullUpdateToAllClients() | 3261 | public void SendFullUpdateToAllClientsInternal() |
3261 | { | 3262 | { |
3262 | if (ParentGroup == null) | 3263 | if (ParentGroup == null) |
3263 | return; | 3264 | return; |
@@ -3276,6 +3277,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
3276 | }); | 3277 | }); |
3277 | } | 3278 | } |
3278 | 3279 | ||
3280 | public void SendFullUpdateToAllClients() | ||
3281 | { | ||
3282 | if (ParentGroup == null) | ||
3283 | return; | ||
3284 | |||
3285 | // Update the "last" values | ||
3286 | m_lastPosition = OffsetPosition; | ||
3287 | m_lastRotation = RotationOffset; | ||
3288 | m_lastVelocity = Velocity; | ||
3289 | m_lastAcceleration = Acceleration; | ||
3290 | m_lastAngularVelocity = AngularVelocity; | ||
3291 | m_lastUpdateSentTime = Environment.TickCount; | ||
3292 | |||
3293 | if (ParentGroup.IsAttachment) | ||
3294 | { | ||
3295 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | ||
3296 | if (sp != null) | ||
3297 | { | ||
3298 | sp.SendAttachmentUpdate(this, UpdateRequired.FULL); | ||
3299 | } | ||
3300 | } | ||
3301 | else | ||
3302 | { | ||
3303 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | ||
3304 | { | ||
3305 | SendFullUpdate(avatar.ControllingClient); | ||
3306 | }); | ||
3307 | } | ||
3308 | } | ||
3309 | |||
3279 | /// <summary> | 3310 | /// <summary> |
3280 | /// Sends a full update to the client | 3311 | /// Sends a full update to the client |
3281 | /// </summary> | 3312 | /// </summary> |
@@ -3345,24 +3376,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
3345 | !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || | 3376 | !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || |
3346 | Environment.TickCount - m_lastUpdateSentTime > TIME_MS_TOLERANCE) | 3377 | Environment.TickCount - m_lastUpdateSentTime > TIME_MS_TOLERANCE) |
3347 | { | 3378 | { |
3348 | SendTerseUpdateToAllClients(); | 3379 | SendTerseUpdateToAllClientsInternal(); |
3349 | |||
3350 | } | 3380 | } |
3351 | break; | 3381 | break; |
3352 | } | 3382 | } |
3353 | case UpdateRequired.FULL: | 3383 | case UpdateRequired.FULL: |
3354 | { | 3384 | { |
3355 | ClearUpdateSchedule(); | 3385 | ClearUpdateSchedule(); |
3356 | SendFullUpdateToAllClients(); | 3386 | SendFullUpdateToAllClientsInternal(); |
3357 | break; | 3387 | break; |
3358 | } | 3388 | } |
3359 | } | 3389 | } |
3360 | } | 3390 | } |
3361 | 3391 | ||
3392 | |||
3362 | /// <summary> | 3393 | /// <summary> |
3363 | /// Send a terse update to all clients | 3394 | /// Send a terse update to all clients |
3364 | /// </summary> | 3395 | /// </summary> |
3365 | public void SendTerseUpdateToAllClients() | 3396 | public void SendTerseUpdateToAllClientsInternal() |
3366 | { | 3397 | { |
3367 | if (ParentGroup == null || ParentGroup.Scene == null) | 3398 | if (ParentGroup == null || ParentGroup.Scene == null) |
3368 | return; | 3399 | return; |
@@ -3381,6 +3412,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
3381 | }); | 3412 | }); |
3382 | } | 3413 | } |
3383 | 3414 | ||
3415 | public void SendTerseUpdateToAllClients() | ||
3416 | { | ||
3417 | if (ParentGroup == null || ParentGroup.Scene == null) | ||
3418 | return; | ||
3419 | |||
3420 | // Update the "last" values | ||
3421 | m_lastPosition = OffsetPosition; | ||
3422 | m_lastRotation = RotationOffset; | ||
3423 | m_lastVelocity = Velocity; | ||
3424 | m_lastAcceleration = Acceleration; | ||
3425 | m_lastAngularVelocity = AngularVelocity; | ||
3426 | m_lastUpdateSentTime = Environment.TickCount; | ||
3427 | |||
3428 | if (ParentGroup.IsAttachment) | ||
3429 | { | ||
3430 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | ||
3431 | if (sp != null) | ||
3432 | { | ||
3433 | sp.SendAttachmentUpdate(this, UpdateRequired.TERSE); | ||
3434 | } | ||
3435 | } | ||
3436 | else | ||
3437 | { | ||
3438 | ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) | ||
3439 | { | ||
3440 | SendTerseUpdateToClient(client); | ||
3441 | }); | ||
3442 | } | ||
3443 | } | ||
3444 | |||
3384 | public void SetAxisRotation(int axis, int rotate) | 3445 | public void SetAxisRotation(int axis, int rotate) |
3385 | { | 3446 | { |
3386 | ParentGroup.SetAxisRotation(axis, rotate); | 3447 | ParentGroup.SetAxisRotation(axis, rotate); |