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 4ad8b11..7490ac8 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> |
@@ -505,11 +514,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
505 | 514 | ||
506 | if (Scene != null) | 515 | if (Scene != null) |
507 | { | 516 | { |
508 | // if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) | 517 | if ( |
509 | // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) | 518 | // (Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) |
510 | // && !IsAttachmentCheckFull() && (!Scene.LoadingPrims)) | 519 | // || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) |
511 | if ((Scene.TestBorderCross(val, Cardinals.E) || Scene.TestBorderCross(val, Cardinals.W) | 520 | // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) |
512 | || Scene.TestBorderCross(val, Cardinals.N) || Scene.TestBorderCross(val, Cardinals.S)) | 521 | // || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) |
522 | // Experimental change for better border crossings. | ||
523 | // The commented out original lines above would, it seems, trigger | ||
524 | // a border crossing a little early or late depending on which | ||
525 | // direction the object was moving. | ||
526 | (Scene.TestBorderCross(val, Cardinals.E) | ||
527 | || Scene.TestBorderCross(val, Cardinals.W) | ||
528 | || Scene.TestBorderCross(val, Cardinals.N) | ||
529 | || Scene.TestBorderCross(val, Cardinals.S)) | ||
513 | && !IsAttachmentCheckFull() && (!Scene.LoadingPrims)) | 530 | && !IsAttachmentCheckFull() && (!Scene.LoadingPrims)) |
514 | { | 531 | { |
515 | IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); | 532 | IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); |
@@ -928,6 +945,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
928 | /// </remarks> | 945 | /// </remarks> |
929 | public UUID FromFolderID { get; set; } | 946 | public UUID FromFolderID { get; set; } |
930 | 947 | ||
948 | /// <summary> | ||
949 | /// IDs of all avatars sat on this scene object. | ||
950 | /// </summary> | ||
951 | /// <remarks> | ||
952 | /// We need this so that we can maintain a linkset wide ordering of avatars sat on different parts. | ||
953 | /// This must be locked before it is read or written. | ||
954 | /// SceneObjectPart sitting avatar add/remove code also locks on this object to avoid race conditions. | ||
955 | /// No avatar should appear more than once in this list. | ||
956 | /// Do not manipulate this list directly - use the Add/Remove sitting avatar methods on SceneObjectPart. | ||
957 | /// </remarks> | ||
958 | protected internal List<UUID> m_sittingAvatars = new List<UUID>(); | ||
959 | |||
931 | #endregion | 960 | #endregion |
932 | 961 | ||
933 | // ~SceneObjectGroup() | 962 | // ~SceneObjectGroup() |
@@ -4506,17 +4535,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
4506 | } | 4535 | } |
4507 | 4536 | ||
4508 | /// <summary> | 4537 | /// <summary> |
4538 | /// Get a copy of the list of sitting avatars on all prims of this object. | ||
4539 | /// </summary> | ||
4540 | /// <remarks> | ||
4541 | /// This is sorted by the order in which avatars sat down. If an avatar stands up then all avatars that sat | ||
4542 | /// down after it move one place down the list. | ||
4543 | /// </remarks> | ||
4544 | /// <returns>A list of the sitting avatars. Returns an empty list if there are no sitting avatars.</returns> | ||
4545 | public List<UUID> GetSittingAvatars() | ||
4546 | { | ||
4547 | lock (m_sittingAvatars) | ||
4548 | return new List<UUID>(m_sittingAvatars); | ||
4549 | } | ||
4550 | |||
4551 | /// <summary> | ||
4509 | /// Gets the number of sitting avatars. | 4552 | /// Gets the number of sitting avatars. |
4510 | /// </summary> | 4553 | /// </summary> |
4511 | /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> | 4554 | /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> |
4512 | /// <returns></returns> | 4555 | /// <returns></returns> |
4513 | public int GetSittingAvatarsCount() | 4556 | public int GetSittingAvatarsCount() |
4514 | { | 4557 | { |
4515 | int count = 0; | 4558 | lock (m_sittingAvatars) |
4516 | 4559 | return m_sittingAvatars.Count; | |
4517 | Array.ForEach<SceneObjectPart>(m_parts.GetArray(), p => count += p.GetSittingAvatarsCount()); | ||
4518 | |||
4519 | return count; | ||
4520 | } | 4560 | } |
4521 | 4561 | ||
4522 | public override string ToString() | 4562 | public override string ToString() |
@@ -4525,7 +4565,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4525 | } | 4565 | } |
4526 | 4566 | ||
4527 | #region ISceneObject | 4567 | #region ISceneObject |
4528 | 4568 | ||
4529 | public virtual ISceneObject CloneForNewScene() | 4569 | public virtual ISceneObject CloneForNewScene() |
4530 | { | 4570 | { |
4531 | SceneObjectGroup sog = Copy(false); | 4571 | SceneObjectGroup sog = Copy(false); |