diff options
author | Justin Clark-Casey (justincc) | 2011-08-27 00:15:21 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-27 00:15:21 +0100 |
commit | 33a894f3d2cc95a7a512b86f39f3c6a6afabb015 (patch) | |
tree | 064edbd623ea0bd7bb85c29dc28d2348feb8454b /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | refactor: simplify SOP.AttachedAvatar into SOG.AttachedAvatar (diff) | |
download | opensim-SC-33a894f3d2cc95a7a512b86f39f3c6a6afabb015.zip opensim-SC-33a894f3d2cc95a7a512b86f39f3c6a6afabb015.tar.gz opensim-SC-33a894f3d2cc95a7a512b86f39f3c6a6afabb015.tar.bz2 opensim-SC-33a894f3d2cc95a7a512b86f39f3c6a6afabb015.tar.xz |
refactor: move SOP.IsAttachment and AttachmentPoint up into SOG to avoid pointless duplication of identical values
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index e510611..71023a9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -213,10 +213,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
213 | { | 213 | { |
214 | get { return m_fromUserInventoryItemID; } | 214 | get { return m_fromUserInventoryItemID; } |
215 | } | 215 | } |
216 | |||
217 | 216 | ||
218 | public bool IsAttachment; | ||
219 | |||
220 | 217 | ||
221 | public scriptEvents AggregateScriptEvents; | 218 | public scriptEvents AggregateScriptEvents; |
222 | 219 | ||
@@ -224,9 +221,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
224 | public Vector3 AttachedPos; | 221 | public Vector3 AttachedPos; |
225 | 222 | ||
226 | 223 | ||
227 | public uint AttachmentPoint; | ||
228 | |||
229 | |||
230 | public Vector3 RotationAxis = Vector3.One; | 224 | public Vector3 RotationAxis = Vector3.One; |
231 | 225 | ||
232 | 226 | ||
@@ -723,7 +717,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
723 | m_groupPosition = actor.Position; | 717 | m_groupPosition = actor.Position; |
724 | } | 718 | } |
725 | 719 | ||
726 | if (IsAttachment) | 720 | if (m_parentGroup.IsAttachment) |
727 | { | 721 | { |
728 | ScenePresence sp = m_parentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | 722 | ScenePresence sp = m_parentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); |
729 | if (sp != null) | 723 | if (sp != null) |
@@ -807,7 +801,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
807 | { | 801 | { |
808 | if (IsRoot) | 802 | if (IsRoot) |
809 | { | 803 | { |
810 | if (IsAttachment) | 804 | if (m_parentGroup.IsAttachment) |
811 | return AttachedPos; | 805 | return AttachedPos; |
812 | else | 806 | else |
813 | return AbsolutePosition; | 807 | return AbsolutePosition; |
@@ -1090,7 +1084,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1090 | { | 1084 | { |
1091 | get | 1085 | get |
1092 | { | 1086 | { |
1093 | if (IsAttachment) | 1087 | if (m_parentGroup.IsAttachment) |
1094 | return GroupPosition; | 1088 | return GroupPosition; |
1095 | 1089 | ||
1096 | return m_offsetPosition + m_groupPosition; | 1090 | return m_offsetPosition + m_groupPosition; |
@@ -1588,7 +1582,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1588 | 1582 | ||
1589 | // The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition | 1583 | // The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition |
1590 | // or flexible | 1584 | // or flexible |
1591 | if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible)) | 1585 | if (!isPhantom && !m_parentGroup.IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible)) |
1592 | { | 1586 | { |
1593 | try | 1587 | try |
1594 | { | 1588 | { |
@@ -2880,7 +2874,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2880 | 2874 | ||
2881 | public void rotLookAt(Quaternion target, float strength, float damping) | 2875 | public void rotLookAt(Quaternion target, float strength, float damping) |
2882 | { | 2876 | { |
2883 | if (IsAttachment) | 2877 | if (m_parentGroup.IsAttachment) |
2884 | { | 2878 | { |
2885 | /* | 2879 | /* |
2886 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); | 2880 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); |
@@ -3014,7 +3008,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3014 | 3008 | ||
3015 | if (IsRoot) | 3009 | if (IsRoot) |
3016 | { | 3010 | { |
3017 | if (IsAttachment) | 3011 | if (m_parentGroup.IsAttachment) |
3018 | { | 3012 | { |
3019 | SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); | 3013 | SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); |
3020 | } | 3014 | } |
@@ -3076,7 +3070,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3076 | { | 3070 | { |
3077 | // Suppress full updates during attachment editing | 3071 | // Suppress full updates during attachment editing |
3078 | // | 3072 | // |
3079 | if (ParentGroup.IsSelected && IsAttachment) | 3073 | if (ParentGroup.IsSelected && ParentGroup.IsAttachment) |
3080 | return; | 3074 | return; |
3081 | 3075 | ||
3082 | if (ParentGroup.IsDeleted) | 3076 | if (ParentGroup.IsDeleted) |
@@ -3254,26 +3248,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3254 | }); | 3248 | }); |
3255 | } | 3249 | } |
3256 | 3250 | ||
3257 | public void SetAttachmentPoint(uint AttachmentPoint) | ||
3258 | { | ||
3259 | this.AttachmentPoint = AttachmentPoint; | ||
3260 | |||
3261 | if (AttachmentPoint != 0) | ||
3262 | { | ||
3263 | IsAttachment = true; | ||
3264 | } | ||
3265 | else | ||
3266 | { | ||
3267 | IsAttachment = false; | ||
3268 | } | ||
3269 | |||
3270 | // save the attachment point. | ||
3271 | //if (AttachmentPoint != 0) | ||
3272 | //{ | ||
3273 | m_shape.State = (byte)AttachmentPoint; | ||
3274 | //} | ||
3275 | } | ||
3276 | |||
3277 | public void SetAxisRotation(int axis, int rotate) | 3251 | public void SetAxisRotation(int axis, int rotate) |
3278 | { | 3252 | { |
3279 | if (m_parentGroup != null) | 3253 | if (m_parentGroup != null) |
@@ -4497,7 +4471,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4497 | } | 4471 | } |
4498 | } | 4472 | } |
4499 | 4473 | ||
4500 | if (SetPhantom || IsAttachment || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints | 4474 | if (SetPhantom |
4475 | || ParentGroup.IsAttachment | ||
4476 | || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints | ||
4501 | { | 4477 | { |
4502 | AddFlag(PrimFlags.Phantom); | 4478 | AddFlag(PrimFlags.Phantom); |
4503 | if (PhysActor != null) | 4479 | if (PhysActor != null) |
@@ -4928,7 +4904,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4928 | if (ParentGroup == null || ParentGroup.IsDeleted) | 4904 | if (ParentGroup == null || ParentGroup.IsDeleted) |
4929 | return; | 4905 | return; |
4930 | 4906 | ||
4931 | if (IsAttachment && ParentGroup.RootPart != this) | 4907 | if (ParentGroup.IsAttachment && ParentGroup.RootPart != this) |
4932 | return; | 4908 | return; |
4933 | 4909 | ||
4934 | // Causes this thread to dig into the Client Thread Data. | 4910 | // Causes this thread to dig into the Client Thread Data. |