示例#1
0
 /// <summary>
 /// from-vector constructor
 /// </summary>
 public bvec4(bvec4 v)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = v.z;
     this.w = v.w;
 }
示例#2
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat2x4(bvec4 c0, bvec4 c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = c0.z;
     this.m03 = c0.w;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = c1.z;
     this.m13 = c1.w;
 }
示例#3
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat3x4(bvec4 c0, bvec4 c1, bvec4 c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = c0.z;
     this.m03 = c0.w;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = c1.z;
     this.m13 = c1.w;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = c2.z;
     this.m23 = c2.w;
 }
示例#4
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat3x4(bvec4 c0, bvec4 c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = c0.z;
     this.m03 = c0.w;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = c1.z;
     this.m13 = c1.w;
     this.m20 = false;
     this.m21 = false;
     this.m22 = true;
     this.m23 = false;
 }
示例#5
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat4(bvec4 c0, bvec4 c1, bvec4 c2, bvec4 c3)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = c0.z;
     this.m03 = c0.w;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = c1.z;
     this.m13 = c1.w;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = c2.z;
     this.m23 = c2.w;
     this.m30 = c3.x;
     this.m31 = c3.y;
     this.m32 = c3.z;
     this.m33 = c3.w;
 }
示例#6
0
        /// <summary>
        /// Tries to convert the string representation of the vector into a vector representation (using a designated separator), returns false if string was invalid.
        /// </summary>
        public static bool TryParse(string s, string sep, out bvec4 result)
        {
            result = Zero;
            if (string.IsNullOrEmpty(s))
            {
                return(false);
            }
            var kvp = s.Split(new[] { sep }, StringSplitOptions.None);

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

            result = ok ? new bvec4(x, y, z, w) : Zero;
            return(ok);
        }
示例#7
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat4(bvec4 c0, bvec4 c1, bvec4 c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = c0.z;
     this.m03 = c0.w;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = c1.z;
     this.m13 = c1.w;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = c2.z;
     this.m23 = c2.w;
     this.m30 = false;
     this.m31 = false;
     this.m32 = false;
     this.m33 = true;
 }
示例#8
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 public static int GetHashCode(bvec4 v) => v.GetHashCode();
示例#9
0
 /// <summary>
 /// Returns true iff this equals rhs type- and component-wise.
 /// </summary>
 public static bool Equals(bvec4 v, object obj) => v.Equals(obj);
示例#10
0
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public static bool Equals(bvec4 v, bvec4 rhs) => v.Equals(rhs);
示例#11
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of Xnor (lhs == rhs).
 /// </summary>
 public static bvec4 Xnor(bvec4 lhs, bvec4 rhs) => bvec4.Xnor(lhs, rhs);
示例#12
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of Not (!v).
 /// </summary>
 public static bvec4 Not(bvec4 v) => bvec4.Not(v);
示例#13
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of Nand (!(lhs &amp;&amp; rhs)).
 /// </summary>
 public static bvec4 Nand(bvec4 lhs, bvec4 rhs) => bvec4.Nand(lhs, rhs);
示例#14
0
 /// <summary>
 /// Returns an array with all values
 /// </summary>
 public static bool[] Values(bvec4 v) => v.Values;
示例#15
0
 /// <summary>
 /// Returns an enumerator that iterates through all components.
 /// </summary>
 public static IEnumerator <bool> GetEnumerator(bvec4 v) => v.GetEnumerator();
示例#16
0
 /// <summary>
 /// Returns true if any component is true.
 /// </summary>
 public static bool Any(bvec4 v) => v.Any;
示例#17
0
 /// <summary>
 /// Returns an object that can be used for arbitrary swizzling (e.g. swizzle.zy)
 /// </summary>
 public static swizzle_bvec4 swizzle(bvec4 v) => v.swizzle;
示例#18
0
 /// <summary>
 /// Returns true if all component are true.
 /// </summary>
 public static bool All(bvec4 v) => v.All;
示例#19
0
 /// <summary>
 /// Returns the maximal component of this vector.
 /// </summary>
 public static bool MaxElement(bvec4 v) => v.MaxElement;
示例#20
0
 /// <summary>
 /// Returns the minimal component of this vector.
 /// </summary>
 public static bool MinElement(bvec4 v) => v.MinElement;
示例#21
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of Equal (lhs == rhs).
 /// </summary>
 public static bvec4 Equal(bvec4 lhs, bvec4 rhs) => bvec4.Equal(lhs, rhs);
示例#22
0
 /// <summary>
 /// from-vector constructor (additional fields are truncated)
 /// </summary>
 public bvec3(bvec4 v)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = v.z;
 }
示例#23
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of NotEqual (lhs != rhs).
 /// </summary>
 public static bvec4 NotEqual(bvec4 lhs, bvec4 rhs) => bvec4.NotEqual(lhs, rhs);
示例#24
0
 /// <summary>
 /// Returns a string representation of this vector using a provided seperator.
 /// </summary>
 public static string ToString(bvec4 v, string sep) => v.ToString(sep);
示例#25
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of And (lhs &amp;&amp; rhs).
 /// </summary>
 public static bvec4 And(bvec4 lhs, bvec4 rhs) => bvec4.And(lhs, rhs);
示例#26
0
 /// <summary>
 /// Returns a string representation of this vector using a provided seperator and a format provider for each component.
 /// </summary>
 public static string ToString(bvec4 v, string sep, IFormatProvider provider) => v.ToString(sep, provider);
示例#27
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of Or (lhs || rhs).
 /// </summary>
 public static bvec4 Or(bvec4 lhs, bvec4 rhs) => bvec4.Or(lhs, rhs);
示例#28
0
 /// <summary>
 /// Returns the number of components (4).
 /// </summary>
 public static int Count(bvec4 v) => v.Count;
示例#29
0
 /// <summary>
 /// Returns a string representation of this vector using ', ' as a seperator.
 /// </summary>
 public static string ToString(bvec4 v) => v.ToString();
示例#30
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of Nor (!(lhs || rhs)).
 /// </summary>
 public static bvec4 Nor(bvec4 lhs, bvec4 rhs) => bvec4.Nor(lhs, rhs);