示例#1
0
 /// <summary>
 /// copy constructor
 /// </summary>
 public lquat(lquat q)
 {
     this.x = q.x;
     this.y = q.y;
     this.z = q.z;
     this.w = q.w;
 }
示例#2
0
        /// <summary>
        /// Tries to convert the string representation of the quaternion into a quaternion representation (using a designated separator), returns false if string was invalid.
        /// </summary>
        public static bool TryParse(string s, string sep, out lquat result)
        {
            result = Zero;
            if (string.IsNullOrEmpty(s))
            {
                return(false);
            }
            var kvp = s.Split(new[] { sep }, StringSplitOptions.None);

            if (kvp.Length != 4)
            {
                return(false);
            }
            long x = 0, y = 0, z = 0, w = 0;
            var  ok = ((long.TryParse(kvp[0].Trim(), out x) && long.TryParse(kvp[1].Trim(), out y)) && (long.TryParse(kvp[2].Trim(), out z) && long.TryParse(kvp[3].Trim(), out w)));

            result = ok ? new lquat(x, y, z, w) : Zero;
            return(ok);
        }
示例#3
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of LesserThan (lhs &lt; rhs).
 /// </summary>
 public static bvec4 LesserThan(lquat lhs, long rhs) => new bvec4(lhs.x < rhs, lhs.y < rhs, lhs.z < rhs, lhs.w < rhs);
示例#4
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of GreaterThanEqual (lhs &gt;= rhs).
 /// </summary>
 public static bvec4 GreaterThanEqual(lquat lhs, lquat rhs) => lquat.GreaterThanEqual(lhs, rhs);
示例#5
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of Equal (lhs == rhs).
 /// </summary>
 public static bvec4 Equal(lquat lhs, lquat rhs) => lquat.Equal(lhs, rhs);
示例#6
0
 /// <summary>
 /// Returns true iff this equals rhs type- and component-wise.
 /// </summary>
 public static bool Equals(lquat q, object obj) => q.Equals(obj);
示例#7
0
 /// <summary>
 /// Returns the number of components (4).
 /// </summary>
 public static int Count(lquat q) => q.Count;
示例#8
0
 /// <summary>
 /// Returns a string representation of this quaternion using a provided seperator and a format for each component.
 /// </summary>
 public static string ToString(lquat q, string sep, string format) => q.ToString(sep, format);
示例#9
0
 /// <summary>
 /// Returns a string representation of this quaternion using ', ' as a seperator.
 /// </summary>
 public static string ToString(lquat q) => q.ToString();
示例#10
0
 /// <summary>
 /// Returns a lquat from component-wise application of Lerp (min * (1-a) + max * a).
 /// </summary>
 public static lquat Lerp(long min, long max, lquat a) => new lquat(min * (1 - a.x) + max * a.x, min * (1 - a.y) + max * a.y, min * (1 - a.z) + max * a.z, min * (1 - a.w) + max * a.w);
示例#11
0
 /// <summary>
 /// Returns a lquat from component-wise application of Lerp (min * (1-a) + max * a).
 /// </summary>
 public static lquat Lerp(long min, lquat max, long a) => new lquat(min * (1 - a) + max.x * a, min * (1 - a) + max.y * a, min * (1 - a) + max.z * a, min * (1 - a) + max.w * a);
示例#12
0
 /// <summary>
 /// Returns a lquat from component-wise application of Lerp (min * (1-a) + max * a).
 /// </summary>
 public static lquat Lerp(lquat min, long max, long a) => new lquat(min.x * (1 - a) + max * a, min.y * (1 - a) + max * a, min.z * (1 - a) + max * a, min.w * (1 - a) + max * a);
示例#13
0
 /// <summary>
 /// Returns a lquat from component-wise application of Lerp (min * (1-a) + max * a).
 /// </summary>
 public static lquat Lerp(lquat min, long max, lquat a) => new lquat(min.x * (1 - a.x) + max * a.x, min.y * (1 - a.y) + max * a.y, min.z * (1 - a.z) + max * a.z, min.w * (1 - a.w) + max * a.w);
示例#14
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of LesserThanEqual (lhs &lt;= rhs).
 /// </summary>
 public static bvec4 LesserThanEqual(long lhs, lquat rhs) => new bvec4(lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z, lhs <= rhs.w);
示例#15
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of LesserThanEqual (lhs &lt;= rhs).
 /// </summary>
 public static bvec4 LesserThanEqual(lquat lhs, long rhs) => new bvec4(lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs, lhs.w <= rhs);
示例#16
0
 /// <summary>
 /// Returns an array with all values
 /// </summary>
 public static long[] Values(lquat q) => q.Values;
示例#17
0
 /// <summary>
 /// Returns an enumerator that iterates through all components.
 /// </summary>
 public static IEnumerator <long> GetEnumerator(lquat q) => q.GetEnumerator();
示例#18
0
 /// <summary>
 /// Returns the inner product (dot product, scalar product) of the two quaternions.
 /// </summary>
 public static long Dot(lquat lhs, lquat rhs) => lquat.Dot(lhs, rhs);
示例#19
0
 /// <summary>
 /// Returns a string representation of this quaternion using a provided seperator.
 /// </summary>
 public static string ToString(lquat q, string sep) => q.ToString(sep);
示例#20
0
 /// <summary>
 /// Returns the euclidean length of this quaternion.
 /// </summary>
 public static double Length(lquat q) => q.Length;
示例#21
0
 /// <summary>
 /// Returns a string representation of this quaternion using a provided seperator and a format and format provider for each component.
 /// </summary>
 public static string ToString(lquat q, string sep, string format, IFormatProvider provider) => q.ToString(sep, format, provider);
示例#22
0
 /// <summary>
 /// Returns the squared euclidean length of this quaternion.
 /// </summary>
 public static long LengthSqr(lquat q) => q.LengthSqr;
示例#23
0
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public static bool Equals(lquat q, lquat rhs) => q.Equals(rhs);
示例#24
0
 /// <summary>
 /// Returns the conjugated quaternion
 /// </summary>
 public static lquat Conjugate(lquat q) => q.Conjugate;
示例#25
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 public static int GetHashCode(lquat q) => q.GetHashCode();
示例#26
0
 /// <summary>
 /// Returns the inverse quaternion
 /// </summary>
 public static lquat Inverse(lquat q) => q.Inverse;
示例#27
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of NotEqual (lhs != rhs).
 /// </summary>
 public static bvec4 NotEqual(lquat lhs, lquat rhs) => lquat.NotEqual(lhs, rhs);
示例#28
0
 /// <summary>
 /// Returns the cross product between two quaternions.
 /// </summary>
 public static lquat Cross(lquat q1, lquat q2) => lquat.Cross(q1, q2);
示例#29
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of LesserThan (lhs &lt; rhs).
 /// </summary>
 public static bvec4 LesserThan(lquat lhs, lquat rhs) => lquat.LesserThan(lhs, rhs);
示例#30
0
 /// <summary>
 /// Returns a lquat from component-wise application of Lerp (min * (1-a) + max * a).
 /// </summary>
 public static lquat Lerp(lquat min, lquat max, lquat a) => lquat.Lerp(min, max, a);