diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Util.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 1775fef..b8b78fa 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -58,6 +58,15 @@ namespace OpenSim.Framework | |||
58 | public enum PermissionMask : uint | 58 | public enum PermissionMask : uint |
59 | { | 59 | { |
60 | None = 0, | 60 | None = 0, |
61 | |||
62 | // folded perms | ||
63 | foldedTransfer = 1, | ||
64 | foldedModify = 1 << 1, | ||
65 | foldedCopy = 1 << 2, | ||
66 | |||
67 | foldedMask = 0x07, | ||
68 | |||
69 | // | ||
61 | Transfer = 1 << 13, | 70 | Transfer = 1 << 13, |
62 | Modify = 1 << 14, | 71 | Modify = 1 << 14, |
63 | Copy = 1 << 15, | 72 | Copy = 1 << 15, |
@@ -243,14 +252,12 @@ namespace OpenSim.Framework | |||
243 | /// </summary> | 252 | /// </summary> |
244 | /// <param name="a">A 3d vector</param> | 253 | /// <param name="a">A 3d vector</param> |
245 | /// <returns>A new vector which is normalized form of the vector</returns> | 254 | /// <returns>A new vector which is normalized form of the vector</returns> |
246 | /// <remarks>The vector paramater cannot be <0,0,0></remarks> | 255 | |
247 | public static Vector3 GetNormalizedVector(Vector3 a) | 256 | public static Vector3 GetNormalizedVector(Vector3 a) |
248 | { | 257 | { |
249 | if (IsZeroVector(a)) | 258 | Vector3 v = new Vector3(a.X, a.Y, a.Z); |
250 | throw new ArgumentException("Vector paramater cannot be a zero vector."); | 259 | v.Normalize(); |
251 | 260 | return v; | |
252 | float Mag = (float) GetMagnitude(a); | ||
253 | return new Vector3(a.X / Mag, a.Y / Mag, a.Z / Mag); | ||
254 | } | 261 | } |
255 | 262 | ||
256 | /// <summary> | 263 | /// <summary> |