diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 651884f..4ab0f15 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3297,6 +3297,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
3297 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); | 3297 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); |
3298 | } | 3298 | } |
3299 | 3299 | ||
3300 | public void ScheduleFullAnimUpdate() | ||
3301 | { | ||
3302 | if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) | ||
3303 | return; | ||
3304 | |||
3305 | if (ParentGroup.Scene.GetNumberOfClients() == 0) | ||
3306 | return; | ||
3307 | |||
3308 | PrimUpdateFlags update = PrimUpdateFlags.FullUpdatewithAnim; | ||
3309 | if (Animations == null || !ParentGroup.RootPart.Shape.MeshFlagEntry) | ||
3310 | update = PrimUpdateFlags.FullUpdate; | ||
3311 | |||
3312 | ParentGroup.QueueForUpdateCheck(); // just in case | ||
3313 | |||
3314 | lock (UpdateFlagLock) | ||
3315 | UpdateFlag |= update; | ||
3316 | |||
3317 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); | ||
3318 | } | ||
3319 | |||
3300 | /// <summary> | 3320 | /// <summary> |
3301 | /// Schedule a terse update for this prim. Terse updates only send position, | 3321 | /// Schedule a terse update for this prim. Terse updates only send position, |
3302 | /// rotation, velocity and rotational velocity information. | 3322 | /// rotation, velocity and rotational velocity information. |
@@ -3334,6 +3354,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3334 | if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) | 3354 | if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) |
3335 | return; | 3355 | return; |
3336 | 3356 | ||
3357 | if (Animations == null) | ||
3358 | update &= ~PrimUpdateFlags.Animations; | ||
3359 | if (update == PrimUpdateFlags.None) | ||
3360 | return; | ||
3361 | |||
3337 | ParentGroup.HasGroupChanged = true; | 3362 | ParentGroup.HasGroupChanged = true; |
3338 | 3363 | ||
3339 | if (ParentGroup.Scene.GetNumberOfClients() == 0) | 3364 | if (ParentGroup.Scene.GetNumberOfClients() == 0) |
@@ -4571,7 +4596,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4571 | if (ParentGroup != null) | 4596 | if (ParentGroup != null) |
4572 | { | 4597 | { |
4573 | ParentGroup.HasGroupChanged = true; | 4598 | ParentGroup.HasGroupChanged = true; |
4574 | ScheduleFullUpdate(); | 4599 | ScheduleFullAnimUpdate(); |
4575 | } | 4600 | } |
4576 | } | 4601 | } |
4577 | 4602 | ||
@@ -5367,16 +5392,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
5367 | 5392 | ||
5368 | #endregion Public Methods | 5393 | #endregion Public Methods |
5369 | 5394 | ||
5370 | public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags PrimUpdateFlags) | 5395 | public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags update) |
5371 | { | 5396 | { |
5372 | if (ParentGroup.IsDeleted) | 5397 | if (ParentGroup.IsDeleted) |
5373 | return; | 5398 | return; |
5374 | 5399 | ||
5400 | if (Animations == null) | ||
5401 | { | ||
5402 | update &= ~PrimUpdateFlags.Animations; | ||
5403 | if (update == PrimUpdateFlags.None) | ||
5404 | return; | ||
5405 | } | ||
5406 | |||
5375 | if (ParentGroup.IsAttachment && | 5407 | if (ParentGroup.IsAttachment && |
5376 | (ParentGroup.RootPart != this || ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint)) | 5408 | (ParentGroup.RootPart != this || ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint)) |
5377 | return; | 5409 | return; |
5378 | 5410 | ||
5379 | remoteClient.SendEntityUpdate(this, PrimUpdateFlags); | 5411 | remoteClient.SendEntityUpdate(this, update); |
5380 | 5412 | ||
5381 | ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); | 5413 | ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); |
5382 | } | 5414 | } |