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