diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 88 |
1 files changed, 81 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 98ea880..6fbe732 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 | } |
@@ -3236,7 +3237,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
3236 | 3237 | ||
3237 | // m_log.DebugFormat( | 3238 | // m_log.DebugFormat( |
3238 | // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | 3239 | // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); |
3239 | 3240 | ||
3241 | |||
3242 | if (ParentGroup.IsAttachment) | ||
3243 | { | ||
3244 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | ||
3245 | if (sp != null) | ||
3246 | { | ||
3247 | sp.SendAttachmentUpdate(this, UpdateRequired.FULL); | ||
3248 | } | ||
3249 | } | ||
3250 | |||
3251 | /* this does nothing | ||
3252 | SendFullUpdateToClient(remoteClient, Position) ignores position parameter | ||
3240 | if (IsRoot) | 3253 | if (IsRoot) |
3241 | { | 3254 | { |
3242 | if (ParentGroup.IsAttachment) | 3255 | if (ParentGroup.IsAttachment) |
@@ -3248,6 +3261,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3248 | SendFullUpdateToClient(remoteClient, AbsolutePosition); | 3261 | SendFullUpdateToClient(remoteClient, AbsolutePosition); |
3249 | } | 3262 | } |
3250 | } | 3263 | } |
3264 | */ | ||
3251 | else | 3265 | else |
3252 | { | 3266 | { |
3253 | SendFullUpdateToClient(remoteClient); | 3267 | SendFullUpdateToClient(remoteClient); |
@@ -3257,7 +3271,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3257 | /// <summary> | 3271 | /// <summary> |
3258 | /// Send a full update for this part to all clients. | 3272 | /// Send a full update for this part to all clients. |
3259 | /// </summary> | 3273 | /// </summary> |
3260 | public void SendFullUpdateToAllClients() | 3274 | public void SendFullUpdateToAllClientsInternal() |
3261 | { | 3275 | { |
3262 | if (ParentGroup == null) | 3276 | if (ParentGroup == null) |
3263 | return; | 3277 | return; |
@@ -3276,6 +3290,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
3276 | }); | 3290 | }); |
3277 | } | 3291 | } |
3278 | 3292 | ||
3293 | public void SendFullUpdateToAllClients() | ||
3294 | { | ||
3295 | if (ParentGroup == null) | ||
3296 | return; | ||
3297 | |||
3298 | // Update the "last" values | ||
3299 | m_lastPosition = OffsetPosition; | ||
3300 | m_lastRotation = RotationOffset; | ||
3301 | m_lastVelocity = Velocity; | ||
3302 | m_lastAcceleration = Acceleration; | ||
3303 | m_lastAngularVelocity = AngularVelocity; | ||
3304 | m_lastUpdateSentTime = Environment.TickCount; | ||
3305 | |||
3306 | if (ParentGroup.IsAttachment) | ||
3307 | { | ||
3308 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | ||
3309 | if (sp != null) | ||
3310 | { | ||
3311 | sp.SendAttachmentUpdate(this, UpdateRequired.FULL); | ||
3312 | } | ||
3313 | } | ||
3314 | else | ||
3315 | { | ||
3316 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | ||
3317 | { | ||
3318 | SendFullUpdate(avatar.ControllingClient); | ||
3319 | }); | ||
3320 | } | ||
3321 | } | ||
3322 | |||
3279 | /// <summary> | 3323 | /// <summary> |
3280 | /// Sends a full update to the client | 3324 | /// Sends a full update to the client |
3281 | /// </summary> | 3325 | /// </summary> |
@@ -3345,24 +3389,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
3345 | !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || | 3389 | !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || |
3346 | Environment.TickCount - m_lastUpdateSentTime > TIME_MS_TOLERANCE) | 3390 | Environment.TickCount - m_lastUpdateSentTime > TIME_MS_TOLERANCE) |
3347 | { | 3391 | { |
3348 | SendTerseUpdateToAllClients(); | 3392 | SendTerseUpdateToAllClientsInternal(); |
3349 | |||
3350 | } | 3393 | } |
3351 | break; | 3394 | break; |
3352 | } | 3395 | } |
3353 | case UpdateRequired.FULL: | 3396 | case UpdateRequired.FULL: |
3354 | { | 3397 | { |
3355 | ClearUpdateSchedule(); | 3398 | ClearUpdateSchedule(); |
3356 | SendFullUpdateToAllClients(); | 3399 | SendFullUpdateToAllClientsInternal(); |
3357 | break; | 3400 | break; |
3358 | } | 3401 | } |
3359 | } | 3402 | } |
3360 | } | 3403 | } |
3361 | 3404 | ||
3405 | |||
3362 | /// <summary> | 3406 | /// <summary> |
3363 | /// Send a terse update to all clients | 3407 | /// Send a terse update to all clients |
3364 | /// </summary> | 3408 | /// </summary> |
3365 | public void SendTerseUpdateToAllClients() | 3409 | public void SendTerseUpdateToAllClientsInternal() |
3366 | { | 3410 | { |
3367 | if (ParentGroup == null || ParentGroup.Scene == null) | 3411 | if (ParentGroup == null || ParentGroup.Scene == null) |
3368 | return; | 3412 | return; |
@@ -3381,6 +3425,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
3381 | }); | 3425 | }); |
3382 | } | 3426 | } |
3383 | 3427 | ||
3428 | public void SendTerseUpdateToAllClients() | ||
3429 | { | ||
3430 | if (ParentGroup == null || ParentGroup.Scene == null) | ||
3431 | return; | ||
3432 | |||
3433 | // Update the "last" values | ||
3434 | m_lastPosition = OffsetPosition; | ||
3435 | m_lastRotation = RotationOffset; | ||
3436 | m_lastVelocity = Velocity; | ||
3437 | m_lastAcceleration = Acceleration; | ||
3438 | m_lastAngularVelocity = AngularVelocity; | ||
3439 | m_lastUpdateSentTime = Environment.TickCount; | ||
3440 | |||
3441 | if (ParentGroup.IsAttachment) | ||
3442 | { | ||
3443 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | ||
3444 | if (sp != null) | ||
3445 | { | ||
3446 | sp.SendAttachmentUpdate(this, UpdateRequired.TERSE); | ||
3447 | } | ||
3448 | } | ||
3449 | else | ||
3450 | { | ||
3451 | ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) | ||
3452 | { | ||
3453 | SendTerseUpdateToClient(client); | ||
3454 | }); | ||
3455 | } | ||
3456 | } | ||
3457 | |||
3384 | public void SetAxisRotation(int axis, int rotate) | 3458 | public void SetAxisRotation(int axis, int rotate) |
3385 | { | 3459 | { |
3386 | ParentGroup.SetAxisRotation(axis, rotate); | 3460 | ParentGroup.SetAxisRotation(axis, rotate); |