diff options
author | Justin Clark-Casey (justincc) | 2012-07-10 23:19:52 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-10 23:21:39 +0100 |
commit | e8347b70957273421ee567577e2d9a6139af0621 (patch) | |
tree | 94ca5b3a04b5fe6d0fdd3b546a1ec8056d218f9e /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | Remove log line accidentally left in SP.SendSitResponse() (diff) | |
download | opensim-SC_OLD-e8347b70957273421ee567577e2d9a6139af0621.zip opensim-SC_OLD-e8347b70957273421ee567577e2d9a6139af0621.tar.gz opensim-SC_OLD-e8347b70957273421ee567577e2d9a6139af0621.tar.bz2 opensim-SC_OLD-e8347b70957273421ee567577e2d9a6139af0621.tar.xz |
Move common code to detect whether a part has a valid sit target into a SOP property rather than being repeated in SP.
This also makes the detection in SP.FindNextAvailableSitTarget() and SendSitResponse() identical.
Previously they varied slightly (SendSitResponse didn't check for an older type of invalid quaternion) but the practical effect is most probably zero.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6677dae..dcec7e9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -135,6 +135,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
135 | get { return ParentGroup.RootPart == this; } | 135 | get { return ParentGroup.RootPart == this; } |
136 | } | 136 | } |
137 | 137 | ||
138 | /// <summary> | ||
139 | /// Is an explicit sit target set for this part? | ||
140 | /// </summary> | ||
141 | public bool IsSitTargetSet | ||
142 | { | ||
143 | get | ||
144 | { | ||
145 | return | ||
146 | !(SitTargetPosition == Vector3.Zero | ||
147 | && (SitTargetOrientation == Quaternion.Identity // Valid Zero Rotation quaternion | ||
148 | || SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 1f && SitTargetOrientation.W == 0f // W-Z Mapping was invalid at one point | ||
149 | || SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 0f && SitTargetOrientation.W == 0f)); // Invalid Quaternion | ||
150 | } | ||
151 | } | ||
152 | |||
138 | #region Fields | 153 | #region Fields |
139 | 154 | ||
140 | public bool AllowedDrop; | 155 | public bool AllowedDrop; |