diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 62 |
1 files changed, 51 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ed1bbd8..0f5d116 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -101,6 +101,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
101 | /// </summary> | 101 | /// </summary> |
102 | public partial class SceneObjectGroup : EntityBase, ISceneObject | 102 | public partial class SceneObjectGroup : EntityBase, ISceneObject |
103 | { | 103 | { |
104 | // Axis selection bitmask used by SetAxisRotation() | ||
105 | // Just happen to be the same bits used by llSetStatus() and defined in ScriptBaseClass. | ||
106 | public enum axisSelect : int | ||
107 | { | ||
108 | STATUS_ROTATE_X = 0x002, | ||
109 | STATUS_ROTATE_Y = 0x004, | ||
110 | STATUS_ROTATE_Z = 0x008, | ||
111 | } | ||
112 | |||
104 | // private PrimCountTaintedDelegate handlerPrimCountTainted = null; | 113 | // private PrimCountTaintedDelegate handlerPrimCountTainted = null; |
105 | 114 | ||
106 | /// <summary> | 115 | /// <summary> |
@@ -512,11 +521,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
512 | 521 | ||
513 | if (Scene != null) | 522 | if (Scene != null) |
514 | { | 523 | { |
515 | // if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) | 524 | if ( |
516 | // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) | 525 | // (Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) |
517 | // && !IsAttachmentCheckFull() && (!Scene.LoadingPrims)) | 526 | // || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) |
518 | if ((Scene.TestBorderCross(val, Cardinals.E) || Scene.TestBorderCross(val, Cardinals.W) | 527 | // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) |
519 | || Scene.TestBorderCross(val, Cardinals.N) || Scene.TestBorderCross(val, Cardinals.S)) | 528 | // || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) |
529 | // Experimental change for better border crossings. | ||
530 | // The commented out original lines above would, it seems, trigger | ||
531 | // a border crossing a little early or late depending on which | ||
532 | // direction the object was moving. | ||
533 | (Scene.TestBorderCross(val, Cardinals.E) | ||
534 | || Scene.TestBorderCross(val, Cardinals.W) | ||
535 | || Scene.TestBorderCross(val, Cardinals.N) | ||
536 | || Scene.TestBorderCross(val, Cardinals.S)) | ||
520 | && !IsAttachmentCheckFull() && (!Scene.LoadingPrims)) | 537 | && !IsAttachmentCheckFull() && (!Scene.LoadingPrims)) |
521 | { | 538 | { |
522 | IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); | 539 | IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); |
@@ -935,6 +952,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
935 | /// </remarks> | 952 | /// </remarks> |
936 | public UUID FromFolderID { get; set; } | 953 | public UUID FromFolderID { get; set; } |
937 | 954 | ||
955 | /// <summary> | ||
956 | /// IDs of all avatars sat on this scene object. | ||
957 | /// </summary> | ||
958 | /// <remarks> | ||
959 | /// We need this so that we can maintain a linkset wide ordering of avatars sat on different parts. | ||
960 | /// This must be locked before it is read or written. | ||
961 | /// SceneObjectPart sitting avatar add/remove code also locks on this object to avoid race conditions. | ||
962 | /// No avatar should appear more than once in this list. | ||
963 | /// Do not manipulate this list directly - use the Add/Remove sitting avatar methods on SceneObjectPart. | ||
964 | /// </remarks> | ||
965 | protected internal List<UUID> m_sittingAvatars = new List<UUID>(); | ||
966 | |||
938 | #endregion | 967 | #endregion |
939 | 968 | ||
940 | // ~SceneObjectGroup() | 969 | // ~SceneObjectGroup() |
@@ -4509,17 +4538,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
4509 | } | 4538 | } |
4510 | 4539 | ||
4511 | /// <summary> | 4540 | /// <summary> |
4541 | /// Get a copy of the list of sitting avatars on all prims of this object. | ||
4542 | /// </summary> | ||
4543 | /// <remarks> | ||
4544 | /// This is sorted by the order in which avatars sat down. If an avatar stands up then all avatars that sat | ||
4545 | /// down after it move one place down the list. | ||
4546 | /// </remarks> | ||
4547 | /// <returns>A list of the sitting avatars. Returns an empty list if there are no sitting avatars.</returns> | ||
4548 | public List<UUID> GetSittingAvatars() | ||
4549 | { | ||
4550 | lock (m_sittingAvatars) | ||
4551 | return new List<UUID>(m_sittingAvatars); | ||
4552 | } | ||
4553 | |||
4554 | /// <summary> | ||
4512 | /// Gets the number of sitting avatars. | 4555 | /// Gets the number of sitting avatars. |
4513 | /// </summary> | 4556 | /// </summary> |
4514 | /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> | 4557 | /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> |
4515 | /// <returns></returns> | 4558 | /// <returns></returns> |
4516 | public int GetSittingAvatarsCount() | 4559 | public int GetSittingAvatarsCount() |
4517 | { | 4560 | { |
4518 | int count = 0; | 4561 | lock (m_sittingAvatars) |
4519 | 4562 | return m_sittingAvatars.Count; | |
4520 | Array.ForEach<SceneObjectPart>(m_parts.GetArray(), p => count += p.GetSittingAvatarsCount()); | ||
4521 | |||
4522 | return count; | ||
4523 | } | 4563 | } |
4524 | 4564 | ||
4525 | public override string ToString() | 4565 | public override string ToString() |
@@ -4528,7 +4568,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4528 | } | 4568 | } |
4529 | 4569 | ||
4530 | #region ISceneObject | 4570 | #region ISceneObject |
4531 | 4571 | ||
4532 | public virtual ISceneObject CloneForNewScene() | 4572 | public virtual ISceneObject CloneForNewScene() |
4533 | { | 4573 | { |
4534 | SceneObjectGroup sog = Copy(false); | 4574 | SceneObjectGroup sog = Copy(false); |