29 using System.Collections;
30 using System.Globalization;
31 using System.Text.RegularExpressions;
32 using OpenSim.Framework;
39 namespace OpenSim.
Region.ScriptEngine.Shared
76 public Vector3(
double X,
double Y,
double Z)
85 str = str.Replace(
'<',
' ');
86 str = str.Replace(
'>',
' ');
87 string[] tmps = str.Split(
new Char[] {
',',
'<',
'>' });
94 res = Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x);
95 res = res & Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y);
96 res = res & Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z);
103 public static implicit
operator Boolean(
Vector3 vec)
116 string s = String.Format(Culture.FormatProvider,
"<{0:0.000000}, {1:0.000000}, {2:0.000000}>", x, y, z);
122 string s = String.Format(Culture.FormatProvider,
"<{0:0.000000}, {1:0.000000}, {2:0.000000}>", vec.x, vec.y, vec.z);
126 public static explicit operator string(
Vector3 vec)
128 string s = String.Format(Culture.FormatProvider,
"<{0:0.000000}, {1:0.000000}, {2:0.000000}>", vec.x, vec.y, vec.z);
132 public static explicit operator Vector3(
string s)
139 return new list(
new object[] { vec });
164 return (lhs.
x == rhs.
x && lhs.
y == rhs.
y && lhs.
z == rhs.
z);
169 return !(lhs == rhs);
174 return (x.GetHashCode() ^ y.GetHashCode() ^ z.GetHashCode());
179 if (!(o is
Vector3))
return false;
181 Vector3
vector = (Vector3)o;
183 return (x == vector.
x && y == vector.
y && z == vector.
z);
188 return new Vector3(-vector.
x, -vector.
y, -vector.
z);
193 #region Vector & Vector Math
198 return new Vector3(lhs.
x + rhs.
x, lhs.
y + rhs.
y, lhs.
z + rhs.
z);
203 return new Vector3(lhs.
x - rhs.
x, lhs.
y - rhs.
y, lhs.
z - rhs.
z);
208 return Dot(lhs, rhs);
215 tv.x = (v1.y * v2.z) - (v1.
z * v2.
y);
216 tv.y = (v1.z * v2.x) - (v1.
x * v2.
z);
217 tv.z = (v1.x * v2.y) - (v1.
y * v2.
x);
223 #region Vector & Float Math
228 return new Vector3(vec.
x * val, vec.
y * val, vec.
z * val);
233 return new Vector3(vec.
x * val, vec.
y * val, vec.
z * val);
246 #region Vector & Double Math
250 return new Vector3(vec.
x * val, vec.
y * val, vec.
z * val);
255 return new Vector3(vec.
x * val, vec.
y * val, vec.
z * val);
268 #region Vector & Rotation Math
279 return new Vector3(result.
x, result.
y, result.
z);
290 #region Static Helper Functions
294 return (v1.
x * v2.
x) + (v1.y * v2.y) + (v1.
z * v2.
z);
301 v1.
y * v2.
z - v1.
z * v2.
y,
302 v1.
z * v2.
x - v1.
x * v2.
z,
303 v1.
x * v2.
y - v1.
y * v2.
x
309 return Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
314 double mag = Mag(vector);
317 double invMag = 1.0 / mag;
318 return vector * invMag;
342 if (x == 0 && y == 0 && z == 0 && s == 0)
352 if (x == 0 && y == 0 && z == 0 && s == 0)
358 str = str.Replace(
'<',
' ');
359 str = str.Replace(
'>',
' ');
360 string[] tmps = str.Split(
new Char[] {
',',
'<',
'>' });
367 res = Double.TryParse(tmps[0], NumberStyles.Float, Culture.NumberFormatInfo, out x);
368 res = res & Double.TryParse(tmps[1], NumberStyles.Float, Culture.NumberFormatInfo, out y);
369 res = res & Double.TryParse(tmps[2], NumberStyles.Float, Culture.NumberFormatInfo, out z);
370 res = res & Double.TryParse(tmps[3], NumberStyles.Float, Culture.NumberFormatInfo, out s);
371 if (x == 0 && y == 0 && z == 0 && s == 0)
388 double length = Math.Sqrt(x * x + y * y + z * z + s * s);
389 if (length <
float.Epsilon)
399 double invLength = 1.0 / length;
426 return (x.GetHashCode() ^ y.GetHashCode() ^ z.GetHashCode() ^ s.GetHashCode());
433 Quaternion quaternion = (Quaternion)o;
435 return x == quaternion.x && y == quaternion.y && z == quaternion.z && s == quaternion.s;
440 string st=String.Format(Culture.FormatProvider,
"<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", x, y, z, s);
446 string s=String.Format(Culture.FormatProvider,
"<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", r.x, r.y, r.z, r.s);
452 string s=String.Format(Culture.FormatProvider,
"<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", r.x, r.y, r.z, r.s);
463 return new list(
new object[] { r });
469 if (rot.
s == 0 && rot.
x == 0 && rot.
y == 0 && rot.
z == 0)
484 return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.s == rhs.s;
489 return !(lhs == rhs);
494 return Math.Sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.s * q.s);
519 c.x = a.s * b.x + a.x * b.s + a.y * b.z - a.z * b.y;
520 c.y = a.s * b.y + a.y * b.s + a.z * b.x - a.x * b.z;
521 c.z = a.s * b.z + a.z * b.s + a.x * b.y - a.y * b.x;
522 c.s = a.s * b.s - a.x * b.x - a.y * b.y - a.z * b.z;
530 private object[] m_data;
532 public list(params
object[] args)
542 m_data=
new Object[0];
543 return m_data.Length;
552 m_data=
new Object[0];
556 foreach (Object o
in m_data)
574 else if (o is
string)
575 size += ((string)o).Length;
578 else if (o is
double)
581 throw new Exception(
"Unknown type in List.Size: " + o.GetType().ToString());
591 m_data=
new Object[0];
595 set {m_data = value; }
609 return Data[itemIndex].GetType();
626 if (Data[itemIndex] is
LSL_Types.LSLInteger)
628 return (
LSL_Types.LSLInteger)Data[itemIndex];
630 else if (Data[itemIndex] is Int32)
634 else if (Data[itemIndex] is
float)
638 else if (Data[itemIndex] is Double)
642 else if (Data[itemIndex] is
LSL_Types.LSLString)
648 return (
LSL_Types.LSLFloat)Data[itemIndex];
666 if (Data[itemIndex] is
LSL_Types.LSLInteger)
667 return (
LSL_Types.LSLInteger)Data[itemIndex];
668 if (Data[itemIndex] is
LSL_Types.LSLFloat)
670 else if (Data[itemIndex] is Int32)
672 else if (Data[itemIndex] is
LSL_Types.LSLString)
673 return new LSLInteger(Data[itemIndex].ToString());
675 throw new InvalidCastException(
string.Format(
676 "{0} expected but {1} given",
678 Data[itemIndex] != null ?
679 Data[itemIndex].GetType().Name :
"null"));
684 if (Data[itemIndex] is
LSL_Types.Vector3)
686 return (
LSL_Types.Vector3)Data[itemIndex];
688 else if(Data[itemIndex] is OpenMetaverse.Vector3)
691 (OpenMetaverse.Vector3)Data[itemIndex]);
695 throw new InvalidCastException(
string.Format(
696 "{0} expected but {1} given",
698 Data[itemIndex] != null ?
699 Data[itemIndex].GetType().Name :
"null"));
705 if (Data[itemIndex] is
LSL_Types.Quaternion)
707 return (
LSL_Types.Quaternion)Data[itemIndex];
709 else if(Data[itemIndex] is OpenMetaverse.Quaternion)
712 (OpenMetaverse.Quaternion)Data[itemIndex]);
716 throw new InvalidCastException(
string.Format(
717 "{0} expected but {1} given",
719 Data[itemIndex] != null ?
720 Data[itemIndex].GetType().Name :
"null"));
732 tmp =
new object[a.Length + b.Length];
733 a.Data.CopyTo(tmp, 0);
734 b.Data.CopyTo(tmp, a.Length);
735 return new list(tmp);
738 private void ExtendAndAdd(
object o)
741 tmp =
new object[Data.Length + 1];
743 tmp.SetValue(o, tmp.Length - 1);
747 public static implicit
operator Boolean(
list l)
749 return l.Length != 0;
774 try { la = a.Length; }
775 catch (NullReferenceException) { }
776 try { lb = b.Length; }
777 catch (NullReferenceException) { }
786 try { la = a.Length; }
787 catch (NullReferenceException) { }
788 try { lb = b.Length; }
789 catch (NullReferenceException) { }
797 tmp =
new object[Data.Length + 1];
799 tmp[Data.Length] = o;
806 foreach (
object i
in Data)
827 start=Data.Length+start;
839 if (end >= Data.Length)
840 return new list(
new Object[0]);
842 if (start >= Data.Length)
845 return GetSublist(end, start);
849 if (start >= Data.Length)
851 ret=
new Object[Data.Length];
852 Array.Copy(Data, 0, ret, 0, Data.Length);
854 return new list(ret);
857 if (end >= Data.Length)
861 int remove=end+1-start;
863 ret=
new Object[Data.Length-
remove];
865 return new list(ret);
870 for (src = 0; src < Data.Length; src++)
872 if (src < start || src > end)
873 ret[dest++]=Data[src];
876 return new list(ret);
893 start = Data.Length + start;
898 end = Data.Length + end;
912 if (start >= Data.Length || end < 0)
918 if (end >= Data.Length)
920 end = Data.Length - 1;
929 ret =
new object[end - start + 1];
931 Array.Copy(Data, start, ret, 0, end - start + 1);
933 return new list(ret);
959 result = GetSublist(0,end);
964 if (start >= Data.Length)
969 return result + GetSublist(start, Data.Length);
974 private static int compare(
object left,
object right,
int ascending)
976 if (!left.GetType().Equals(right.GetType()))
990 ret = String.CompareOrdinal(l.value, r.value);
992 else if (left is LSLString)
994 LSLString l = (LSLString)left;
995 LSLString r = (LSLString)right;
996 ret = String.CompareOrdinal(l.m_string, r.m_string);
1002 ret = Math.Sign(l.value - r.value);
1004 else if (left is LSLFloat)
1006 LSLFloat l = (LSLFloat)left;
1007 LSLFloat r = (LSLFloat)right;
1008 ret = Math.Sign(l.value - r.value);
1010 else if (left is Vector3)
1012 Vector3 l = (Vector3)left;
1013 Vector3 r = (Vector3)right;
1014 ret = Math.Sign(Vector3.Mag(l) - Vector3.Mag(r));
1016 else if (left is Quaternion)
1018 Quaternion l = (Quaternion)left;
1019 Quaternion r = (Quaternion)right;
1020 ret = Math.Sign(Quaternion.Mag(l) - Quaternion.Mag(r));
1039 return compare(lhs, rhs, 1);
1045 if (Data.Length == 0)
1048 object[] ret =
new object[Data.Length];
1049 Array.Copy(Data, 0, ret, 0, Data.Length);
1056 if ((Data.Length % stride) != 0)
1057 return new list(ret);
1064 bool homogeneous =
true;
1066 for (index = 1; index < Data.Length; index++)
1068 if (!Data[0].GetType().Equals(Data[index].GetType()))
1070 homogeneous =
false;
1082 return new list(ret);
1094 int n = Data.Length;
1096 for (i = 0; i < (n-stride); i += stride)
1098 for (j = i + stride; j < n; j += stride)
1100 if (compare(ret[i], ret[j], ascending) > 0)
1102 for (k = 0; k < stride; k++)
1104 object tmp = ret[i + k];
1105 ret[i + k] = ret[j + k];
1114 return new list(ret);
1121 return new list(csv.Split(
','));
1127 foreach (
object o
in this.Data)
1135 ret = ret +
", " + o.ToString();
1141 private string ToSoup()
1144 output = String.Empty;
1145 if (Data.Length == 0)
1147 return String.Empty;
1149 foreach (
object o
in Data)
1151 output = output + o.ToString();
1156 public static explicit operator String(
list l)
1161 public static explicit operator LSLString(
list l)
1163 return new LSLString(l.ToSoup());
1173 #region Statistic Methods
1177 double minimum = double.PositiveInfinity;
1179 for (
int i = 0; i < Data.Length; i++)
1183 if (entry < minimum) minimum = entry;
1191 double maximum = double.NegativeInfinity;
1193 for (
int i = 0; i < Data.Length; i++)
1197 if (entry > maximum) maximum = entry;
1205 return (this.Max() / this.Min());
1212 for (
int i = 0; i < Data.Length; i++)
1226 for (
int i = 0; i < src.Data.Length; i++)
1228 if (
double.TryParse(src.
Data[i].ToString(), NumberStyles.Float, Culture.NumberFormatInfo, out entry))
1240 for (
int i = 0; i < Data.Length; i++)
1254 for (
int i = 0; i < Data.Length; i++)
1258 sum = sum + Math.Pow(entry, 2);
1266 return (this.Sum() / this.NumericLength());
1272 Array.Sort(Data, Numeric);
1278 Array.Sort(Data, Alpha);
1289 list nums = ToDoubleList(
this);
1290 for (
int i = 0; i < nums.Data.Length; i++)
1292 ret *= (double)nums.
Data[i];
1294 return Math.Exp(Math.Log(ret) / (
double)nums.Data.Length);
1300 list nums = ToDoubleList(
this);
1301 for (
int i = 0; i < nums.Data.Length; i++)
1303 ret += 1.0 / (double)nums.
Data[i];
1305 return ((
double)nums.Data.Length / ret);
1311 list num = ToDoubleList(
this);
1312 for (
int i = 0; i < num.Data.Length; i++)
1314 s += Math.Pow((double)num.
Data[i], 2);
1316 return (s - num.
Data.Length * Math.Pow(num.
Mean(), 2)) / (num.Data.Length - 1);
1321 return Math.Sqrt(this.Variance());
1324 public double Qi(
double i)
1329 if (Math.Ceiling(
this.Length * i) == this.Length * i)
1331 return (
double)((double)j.
Data[(
int)(this.Length * i - 1)] + (
double)j.Data[(int)(this.Length * i)]) / 2;
1335 return (
double)j.Data[((int)(Math.Ceiling(
this.Length * i))) - 1];
1344 if (Data.Length == 0)
1349 foreach (
object o
in Data)
1353 output = output +
"\"" + o +
"\", ";
1357 output = output + o.ToString() +
", ";
1360 output = output.Substring(0, output.Length - 2);
1361 output = output +
"]";
1367 int IComparer.Compare(
object x,
object y)
1369 return string.Compare(x.ToString(), y.ToString());
1375 int IComparer.Compare(
object x,
object y)
1379 if (!
double.TryParse(x.ToString(), NumberStyles.Float, Culture.NumberFormatInfo, out a))
1383 if (!
double.TryParse(y.ToString(), NumberStyles.Float, Culture.NumberFormatInfo, out b))
1407 return Data.Length == ((list)o).Data.Length;
1412 return Data.GetHashCode();
1421 #region Constructors
1433 Regex isuuid =
new Regex(
@"^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$", RegexOptions.Compiled);
1434 if (isuuid.IsMatch(s))
1448 static public implicit
operator Boolean(key k)
1450 if (k.
value.Length == 0)
1455 if (k.
value ==
"00000000-0000-0000-0000-000000000000")
1459 Regex isuuid =
new Regex(
@"^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$", RegexOptions.Compiled);
1460 if (isuuid.IsMatch(k.
value))
1470 public static bool operator true(key k)
1475 public static bool operator false(key k)
1480 static public implicit
operator key(
string s)
1485 static public implicit
operator String(key k)
1490 static public implicit
operator LSLString(key k)
1495 public static bool operator ==(key k1, key k2)
1497 return k1.value == k2.value;
1499 public static bool operator !=(key k1, key k2)
1501 return k1.value != k2.value;
1510 return o.ToString() == value;
1515 return value.GetHashCode();
1527 public struct LSLString
1531 #region Constructors
1540 string s = String.Format(Culture.FormatProvider,
"{0:0.000000}", d);
1546 string s = String.Format(Culture.FormatProvider,
"{0:0.000000}", f.value);
1552 string s = String.Format(
"{0}", i);
1561 static public implicit
operator Boolean(LSLString s)
1573 static public implicit
operator String(LSLString s)
1578 static public implicit
operator LSLString(
string s)
1580 return new LSLString(s);
1593 public static bool operator ==(LSLString s1,
string s2)
1595 return s1.m_string == s2;
1598 public static bool operator !=(LSLString s1,
string s2)
1600 return s1.m_string != s2;
1603 public static LSLString operator +(LSLString s1, LSLString s2)
1608 public static explicit operator double(LSLString s)
1610 return new LSLFloat(s).value;
1618 public static explicit operator LSLString(
double d)
1620 return new LSLString(d);
1623 static public explicit operator LSLString(
int i)
1625 return new LSLString(i);
1628 public static explicit operator LSLString(LSLFloat f)
1630 return new LSLString(f);
1633 static public explicit operator LSLString(
bool b)
1636 return new LSLString(
"1");
1638 return new LSLString(
"0");
1641 public static implicit
operator Vector3(LSLString s)
1646 public static implicit
operator Quaternion(LSLString s)
1651 public static implicit
operator LSLFloat(LSLString s)
1653 return new LSLFloat(s);
1656 public static implicit
operator list(LSLString s)
1658 return new list(
new object[]{s});
1666 return m_string == o.ToString();
1671 return m_string.GetHashCode();
1676 #region " Standard string functions "
1682 public bool Contains(
string value) {
return m_string.Contains(value); }
1683 public int IndexOf(
string value) {
return m_string.IndexOf(value); }
1684 public int Length {
get {
return m_string.Length; } }
1691 public struct LSLInteger
1694 private static readonly Regex castRegex =
new Regex(
@"(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*(-?|\+?)[0-9][0-9]*)");
1696 #region Constructors
1714 Match m = castRegex.Match(s);
1715 string v = m.Groups[0].Value;
1717 v = v.Replace(
"+",
"");
1719 if (v == String.Empty)
1727 if (v.Contains(
"x") || v.Contains(
"X"))
1729 value = int.Parse(v.Substring(2), System.Globalization.NumberStyles.HexNumber);
1733 value = int.Parse(v, System.Globalization.NumberStyles.Integer);
1736 catch (OverflowException)
1747 static public implicit
operator int(LSLInteger i)
1752 static public explicit operator uint(LSLInteger i)
1754 return (uint)i.value;
1757 static public explicit operator LSLString(LSLInteger i)
1759 return new LSLString(i.
ToString());
1762 public static implicit
operator list(LSLInteger i)
1764 return new list(
new object[] { i });
1767 static public implicit
operator Boolean(LSLInteger i)
1812 static public LSLInteger operator ==(LSLInteger i1, LSLInteger i2)
1814 bool ret = i1.value == i2.value;
1818 static public LSLInteger operator !=(LSLInteger i1, LSLInteger i2)
1820 bool ret = i1.value != i2.value;
1824 static public LSLInteger operator <(LSLInteger i1, LSLInteger i2)
1826 bool ret = i1.value < i2.value;
1829 static public LSLInteger operator <=(LSLInteger i1, LSLInteger i2)
1831 bool ret = i1.value <= i2.value;
1835 static public LSLInteger operator >(LSLInteger i1, LSLInteger i2)
1837 bool ret = i1.value > i2.value;
1841 static public LSLInteger operator >=(LSLInteger i1, LSLInteger i2)
1843 bool ret = i1.value >= i2.value;
1847 static public LSLInteger operator +(LSLInteger i1,
int i2)
1852 static public LSLInteger operator -(LSLInteger i1,
int i2)
1857 static public LSLInteger operator *(LSLInteger i1,
int i2)
1862 static public LSLInteger operator /(LSLInteger i1,
int i2)
1887 static public LSLInteger operator -(LSLInteger i)
1892 static public LSLInteger operator ~(LSLInteger i)
1899 if (!(o is LSLInteger))
1903 return value == (int)o;
1919 static public LSLInteger operator &(LSLInteger i1, LSLInteger i2)
1921 int ret = i1.value & i2.value;
1925 static public LSLInteger operator %(LSLInteger i1, LSLInteger i2)
1927 int ret = i1.value % i2.value;
1931 static public LSLInteger operator |(LSLInteger i1, LSLInteger i2)
1933 int ret = i1.value | i2.value;
1937 static public LSLInteger operator ^(LSLInteger i1, LSLInteger i2)
1939 int ret = i1.value ^ i2.value;
1943 static public LSLInteger operator !(LSLInteger i1)
1945 return i1.value == 0 ? 1 : 0;
1948 public static LSLInteger operator ++(LSLInteger i)
1955 public static LSLInteger operator --(LSLInteger i)
1961 public static LSLInteger operator << (LSLInteger i,
int s)
1963 return i.value << s;
1966 public static LSLInteger operator >> (LSLInteger i,
int s)
1968 return i.value >> s;
1971 static public implicit
operator System.Double(LSLInteger i)
1973 return (
double)i.value;
1976 public static bool operator true(LSLInteger i)
1978 return i.value != 0;
1981 public static bool operator false(LSLInteger i)
1983 return i.value == 0;
1992 return this.value.ToString();
1999 public struct LSLFloat
2003 #region Constructors
2007 this.value = (double)i;
2017 Regex r =
new Regex(
"^ *(\\+|-)?([0-9]+\\.?[0-9]*|\\.[0-9]+)([eE](\\+|-)?[0-9]+)?");
2018 Match m = r.Match(s);
2019 string v = m.Groups[0].Value;
2023 if (v == String.Empty || v == null)
2026 if (!v.Contains(
".") && !v.ToLower().Contains(
"e"))
2029 if (v.EndsWith(
"."))
2031 this.value = double.Parse(v, System.Globalization.NumberStyles.Float, Culture.NumberFormatInfo);
2038 static public explicit operator float(LSLFloat f)
2040 return (
float)f.value;
2043 static public explicit operator int(LSLFloat f)
2045 return (
int)f.value;
2048 static public explicit operator uint(LSLFloat f)
2050 return (uint) Math.Abs(f.value);
2053 static public implicit
operator Boolean(LSLFloat f)
2065 static public implicit
operator LSLFloat(
int i)
2067 return new LSLFloat(i);
2070 static public implicit
operator LSLFloat(LSLInteger i)
2072 return new LSLFloat(i.
value);
2075 static public explicit operator LSLFloat(
string s)
2077 return new LSLFloat(s);
2080 public static implicit
operator list(LSLFloat f)
2082 return new list(
new object[] { f });
2085 static public implicit
operator LSLFloat(
double d)
2087 return new LSLFloat(d);
2090 static public implicit
operator LSLFloat(
bool b)
2093 return new LSLFloat(1.0);
2095 return new LSLFloat(0.0);
2098 static public bool operator ==(LSLFloat f1, LSLFloat f2)
2100 return f1.value == f2.value;
2103 static public bool operator !=(LSLFloat f1, LSLFloat f2)
2105 return f1.value != f2.value;
2108 static public LSLFloat operator ++(LSLFloat f)
2114 static public LSLFloat operator --(LSLFloat f)
2120 static public LSLFloat operator +(LSLFloat f,
int i)
2122 return new LSLFloat(f.
value + (
double)i);
2125 static public LSLFloat operator -(LSLFloat f,
int i)
2127 return new LSLFloat(f.
value - (
double)i);
2130 static public LSLFloat operator *(LSLFloat f,
int i)
2132 return new LSLFloat(f.
value * (
double)i);
2135 static public LSLFloat operator /(LSLFloat f,
int i)
2137 return new LSLFloat(f.
value / (
double)i);
2140 static public LSLFloat operator +(LSLFloat lhs, LSLFloat rhs)
2145 static public LSLFloat operator -(LSLFloat lhs, LSLFloat rhs)
2150 static public LSLFloat operator *(LSLFloat lhs, LSLFloat rhs)
2155 static public LSLFloat operator /(LSLFloat lhs, LSLFloat rhs)
2160 static public LSLFloat operator -(LSLFloat f)
2162 return new LSLFloat(-f.
value);
2165 static public implicit
operator System.Double(LSLFloat f)
2176 return String.Format(Culture.FormatProvider,
"{0:0.000000}", this.value);
2181 if (!(o is LSLFloat))
2183 return value == ((LSLFloat)o).value;
2188 return value.GetHashCode();
Quaternion(OMV_Quaternion rot)
Vector3(OMV_Vector3d vector)
override int GetHashCode()
override bool Equals(object o)
bool Contains(string value)
LSL_Types.Vector3 GetVector3Item(int itemIndex)
LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex)
static NumberFormatInfo NumberFormatInfo
static list ToDoubleList(list src)
static double Mag(Vector3 v)
override int GetHashCode()
override int GetHashCode()
static list FromCSV(string csv)
Quaternion(double X, double Y, double Z, double S)
override string ToString()
override string ToString()
LSL_Types.LSLString GetLSLStringItem(int itemIndex)
OpenMetaverse.Quaternion OMV_Quaternion
static bool Parse2Key(string s)
override int GetHashCode()
list GetSublist(int start, int end)
list Sort(int stride, int ascending)
OpenMetaverse.Vector3 OMV_Vector3
override bool Equals(object o)
override bool Equals(Object o)
Quaternion(Quaternion Quat)
Vector3(double X, double Y, double Z)
int IndexOf(string value)
override int GetHashCode()
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString key
static string ToString(LSLString s)
override string ToString()
override int GetHashCode()
static Vector3 Cross(Vector3 v1, Vector3 v2)
static double Mag(Quaternion q)
LSL_Types.Quaternion GetQuaternionItem(int itemIndex)
override int GetHashCode()
Type GetLSLListItemType(int itemIndex)
Obtain LSL type from an index.
override string ToString()
list DeleteSublist(int start, int end)
OpenMetaverse.Vector3d OMV_Vector3d
list(params object[] args)
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger LSLInteger
static Vector3 Norm(Vector3 vector)
LSL_Types.LSLFloat GetLSLFloatItem(int itemIndex)
Obtain float from an index.
override string ToString()
int Compare(object lhs, object rhs)
Vector3(OMV_Vector3 vector)
override string ToString()
override bool Equals(object o)
override bool Equals(Object o)
static double Dot(Vector3 v1, Vector3 v2)
override bool Equals(object o)
OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 vector
override bool Equals(object o)
LSL_Types.key GetKeyItem(int itemIndex)
override string ToString()