aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 09bf029..d7dcf19 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -38,7 +38,7 @@ using System.Security.Cryptography;
38using System.Text; 38using System.Text;
39using System.Text.RegularExpressions; 39using System.Text.RegularExpressions;
40using System.Xml; 40using System.Xml;
41using libsecondlife; 41using OpenMetaverse;
42using log4net; 42using log4net;
43using Nini.Config; 43using Nini.Config;
44using Nwc.XmlRpc; 44using Nwc.XmlRpc;
@@ -67,7 +67,7 @@ namespace OpenSim.Framework
67 /// <param name="a">A 3d vector</param> 67 /// <param name="a">A 3d vector</param>
68 /// <param name="b">A 3d vector</param> 68 /// <param name="b">A 3d vector</param>
69 /// <returns>The distance between the two vectors</returns> 69 /// <returns>The distance between the two vectors</returns>
70 public static double GetDistanceTo(LLVector3 a, LLVector3 b) 70 public static double GetDistanceTo(Vector3 a, Vector3 b)
71 { 71 {
72 float dx = a.X - b.X; 72 float dx = a.X - b.X;
73 float dy = a.Y - b.Y; 73 float dy = a.Y - b.Y;
@@ -80,7 +80,7 @@ namespace OpenSim.Framework
80 /// </summary> 80 /// </summary>
81 /// <param name="a">A 3d vector</param> 81 /// <param name="a">A 3d vector</param>
82 /// <returns>The magnitude of the vector</returns> 82 /// <returns>The magnitude of the vector</returns>
83 public static double GetMagnitude(LLVector3 a) 83 public static double GetMagnitude(Vector3 a)
84 { 84 {
85 return Math.Sqrt((a.X * a.X) + (a.Y * a.Y) + (a.Z * a.Z)); 85 return Math.Sqrt((a.X * a.X) + (a.Y * a.Y) + (a.Z * a.Z));
86 } 86 }
@@ -91,20 +91,20 @@ namespace OpenSim.Framework
91 /// <param name="a">A 3d vector</param> 91 /// <param name="a">A 3d vector</param>
92 /// <returns>A new vector which is normalized form of the vector</returns> 92 /// <returns>A new vector which is normalized form of the vector</returns>
93 /// <remarks>The vector paramater cannot be <0,0,0></remarks> 93 /// <remarks>The vector paramater cannot be <0,0,0></remarks>
94 public static LLVector3 GetNormalizedVector(LLVector3 a) 94 public static Vector3 GetNormalizedVector(Vector3 a)
95 { 95 {
96 if (IsZeroVector(a)) 96 if (IsZeroVector(a))
97 throw new ArgumentException("Vector paramater cannot be a zero vector."); 97 throw new ArgumentException("Vector paramater cannot be a zero vector.");
98 98
99 float Mag = (float) GetMagnitude(a); 99 float Mag = (float) GetMagnitude(a);
100 return new LLVector3(a.X / Mag, a.Y / Mag, a.Z / Mag); 100 return new Vector3(a.X / Mag, a.Y / Mag, a.Z / Mag);
101 } 101 }
102 102
103 /// <summary> 103 /// <summary>
104 /// Returns if a vector is a zero vector (has all zero components) 104 /// Returns if a vector is a zero vector (has all zero components)
105 /// </summary> 105 /// </summary>
106 /// <returns></returns> 106 /// <returns></returns>
107 public static bool IsZeroVector(LLVector3 v) 107 public static bool IsZeroVector(Vector3 v)
108 { 108 {
109 if (v.X == 0 && v.Y == 0 && v.Z == 0) 109 if (v.X == 0 && v.Y == 0 && v.Z == 0)
110 { 110 {
@@ -268,7 +268,7 @@ namespace OpenSim.Framework
268 268
269 public static string GetRandomCapsPath() 269 public static string GetRandomCapsPath()
270 { 270 {
271 LLUUID caps = LLUUID.Random(); 271 UUID caps = UUID.Random();
272 string capsPath = caps.ToString(); 272 string capsPath = caps.ToString();
273 capsPath = capsPath.Remove(capsPath.Length - 4, 4); 273 capsPath = capsPath.Remove(capsPath.Length - 4, 4);
274 return capsPath; 274 return capsPath;
@@ -525,13 +525,13 @@ namespace OpenSim.Framework
525 } 525 }
526 526
527 /// <summary> 527 /// <summary>
528 /// Convert an LLUUID to a raw uuid string. Right now this is a string without hyphens. 528 /// Convert an UUID to a raw uuid string. Right now this is a string without hyphens.
529 /// </summary> 529 /// </summary>
530 /// <param name="lluuid"></param> 530 /// <param name="UUID"></param>
531 /// <returns></returns> 531 /// <returns></returns>
532 public static String ToRawUuidString(LLUUID lluuid) 532 public static String ToRawUuidString(UUID UUID)
533 { 533 {
534 return lluuid.UUID.ToString("n"); 534 return UUID.Guid.ToString("n");
535 } 535 }
536 536
537 public static string CleanString(string input) 537 public static string CleanString(string input)
@@ -728,16 +728,16 @@ namespace OpenSim.Framework
728 } 728 }
729 729
730 // used for RemoteParcelRequest (for "About Landmark") 730 // used for RemoteParcelRequest (for "About Landmark")
731 public static LLUUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { 731 public static UUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) {
732 byte[] bytes = { 732 byte[] bytes = {
733 (byte)(regionHandle >> 56), (byte)(regionHandle >> 48), (byte)(regionHandle >> 40), (byte)(regionHandle >> 32), 733 (byte)(regionHandle >> 56), (byte)(regionHandle >> 48), (byte)(regionHandle >> 40), (byte)(regionHandle >> 32),
734 (byte)(regionHandle >> 24), (byte)(regionHandle >> 16), (byte)(regionHandle >> 8), (byte)regionHandle, 734 (byte)(regionHandle >> 24), (byte)(regionHandle >> 16), (byte)(regionHandle >> 8), (byte)regionHandle,
735 (byte)(x >> 24), (byte)(x >> 16), (byte)(x >> 8), (byte)x, 735 (byte)(x >> 24), (byte)(x >> 16), (byte)(x >> 8), (byte)x,
736 (byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y }; 736 (byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y };
737 return new LLUUID(bytes, 0); 737 return new UUID(bytes, 0);
738 } 738 }
739 739
740 public static void ParseFakeParcelID(LLUUID parcelID, out ulong regionHandle, out uint x, out uint y) { 740 public static void ParseFakeParcelID(UUID parcelID, out ulong regionHandle, out uint x, out uint y) {
741 byte[] bytes = parcelID.GetBytes(); 741 byte[] bytes = parcelID.GetBytes();
742 regionHandle = Helpers.BytesToUInt64(bytes); 742 regionHandle = Helpers.BytesToUInt64(bytes);
743 x = Helpers.BytesToUInt(bytes, 8); 743 x = Helpers.BytesToUInt(bytes, 8);