diff options
Merge branch 'master' into bulletsim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 70 |
1 files changed, 32 insertions, 38 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index fada688..c453366 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -146,27 +146,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
146 | return true; | 146 | return true; |
147 | return false; | 147 | return false; |
148 | } | 148 | } |
149 | 149 | ||
150 | /// <summary> | 150 | /// <summary> |
151 | /// Is this scene object acting as an attachment? | 151 | /// Is this scene object acting as an attachment? |
152 | /// </summary> | 152 | /// </summary> |
153 | /// <remarks> | 153 | public bool IsAttachment { get; set; } |
154 | /// We return false if the group has already been deleted. | ||
155 | /// | ||
156 | /// TODO: At the moment set must be done on the part itself. There may be a case for doing it here since I | ||
157 | /// presume either all or no parts in a linkset can be part of an attachment (in which | ||
158 | /// case the value would get proprogated down into all the descendent parts). | ||
159 | /// </remarks> | ||
160 | public bool IsAttachment | ||
161 | { | ||
162 | get | ||
163 | { | ||
164 | if (!IsDeleted) | ||
165 | return m_rootPart.IsAttachment; | ||
166 | |||
167 | return false; | ||
168 | } | ||
169 | } | ||
170 | 154 | ||
171 | /// <summary> | 155 | /// <summary> |
172 | /// The avatar to which this scene object is attached. | 156 | /// The avatar to which this scene object is attached. |
@@ -177,6 +161,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
177 | public UUID AttachedAvatar { get; set; } | 161 | public UUID AttachedAvatar { get; set; } |
178 | 162 | ||
179 | /// <summary> | 163 | /// <summary> |
164 | /// Attachment point of this scene object to an avatar. | ||
165 | /// </summary> | ||
166 | /// <remarks> | ||
167 | /// 0 if we're not attached to anything | ||
168 | /// </remarks> | ||
169 | public uint AttachmentPoint | ||
170 | { | ||
171 | get | ||
172 | { | ||
173 | return m_rootPart.Shape.State; | ||
174 | } | ||
175 | |||
176 | set | ||
177 | { | ||
178 | IsAttachment = value != 0; | ||
179 | m_rootPart.Shape.State = (byte)value; | ||
180 | } | ||
181 | } | ||
182 | |||
183 | public void ClearPartAttachmentData() | ||
184 | { | ||
185 | AttachmentPoint = 0; | ||
186 | } | ||
187 | |||
188 | /// <summary> | ||
180 | /// Is this scene object phantom? | 189 | /// Is this scene object phantom? |
181 | /// </summary> | 190 | /// </summary> |
182 | /// <remarks> | 191 | /// <remarks> |
@@ -354,11 +363,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
354 | /// <summary> | 363 | /// <summary> |
355 | /// Check both the attachment property and the relevant properties of the underlying root part. | 364 | /// Check both the attachment property and the relevant properties of the underlying root part. |
356 | /// </summary> | 365 | /// </summary> |
366 | /// <remarks> | ||
357 | /// This is necessary in some cases, particularly when a scene object has just crossed into a region and doesn't | 367 | /// This is necessary in some cases, particularly when a scene object has just crossed into a region and doesn't |
358 | /// have the IsAttachment property yet checked. | 368 | /// have the IsAttachment property yet checked. |
359 | /// | 369 | /// |
360 | /// FIXME: However, this should be fixed so that this property | 370 | /// FIXME: However, this should be fixed so that this property |
361 | /// propertly reflects the underlying status. | 371 | /// propertly reflects the underlying status. |
372 | /// </remarks> | ||
362 | /// <returns></returns> | 373 | /// <returns></returns> |
363 | public bool IsAttachmentCheckFull() | 374 | public bool IsAttachmentCheckFull() |
364 | { | 375 | { |
@@ -982,23 +993,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
982 | } | 993 | } |
983 | } | 994 | } |
984 | 995 | ||
985 | public byte GetAttachmentPoint() | ||
986 | { | ||
987 | return m_rootPart.Shape.State; | ||
988 | } | ||
989 | |||
990 | public void SetAttachmentPoint(byte point) | ||
991 | { | ||
992 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
993 | for (int i = 0; i < parts.Length; i++) | ||
994 | parts[i].SetAttachmentPoint(point); | ||
995 | } | ||
996 | |||
997 | public void ClearPartAttachmentData() | ||
998 | { | ||
999 | SetAttachmentPoint((Byte)0); | ||
1000 | } | ||
1001 | |||
1002 | /// <summary> | 996 | /// <summary> |
1003 | /// | 997 | /// |
1004 | /// </summary> | 998 | /// </summary> |
@@ -1424,16 +1418,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1424 | 1418 | ||
1425 | // This is only necessary when userExposed is false! | 1419 | // This is only necessary when userExposed is false! |
1426 | 1420 | ||
1427 | bool previousAttachmentStatus = dupe.RootPart.IsAttachment; | 1421 | bool previousAttachmentStatus = dupe.IsAttachment; |
1428 | 1422 | ||
1429 | if (!userExposed) | 1423 | if (!userExposed) |
1430 | dupe.RootPart.IsAttachment = true; | 1424 | dupe.IsAttachment = true; |
1431 | 1425 | ||
1432 | dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); | 1426 | dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); |
1433 | 1427 | ||
1434 | if (!userExposed) | 1428 | if (!userExposed) |
1435 | { | 1429 | { |
1436 | dupe.RootPart.IsAttachment = previousAttachmentStatus; | 1430 | dupe.IsAttachment = previousAttachmentStatus; |
1437 | } | 1431 | } |
1438 | 1432 | ||
1439 | dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); | 1433 | dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); |