aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorUbitUmarov2014-08-12 21:08:01 +0100
committerUbitUmarov2014-08-12 21:08:01 +0100
commit3e7f475e58500fc51025c6ccbd521ad581687a9f (patch)
tree2e0600e5257629418d85b3ec254b64181389bd42 /OpenSim/Framework/Util.cs
parent use Vector3.normalize in place of util.GetNormalize (diff)
downloadopensim-SC-3e7f475e58500fc51025c6ccbd521ad581687a9f.zip
opensim-SC-3e7f475e58500fc51025c6ccbd521ad581687a9f.tar.gz
opensim-SC-3e7f475e58500fc51025c6ccbd521ad581687a9f.tar.bz2
opensim-SC-3e7f475e58500fc51025c6ccbd521ad581687a9f.tar.xz
fix the damm thing
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs19
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>