Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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);
        }
Esempio n. 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;
 }
Esempio n. 8
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 public static int GetHashCode(bvec4 v) => v.GetHashCode();
Esempio n. 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);
Esempio n. 10
0
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public static bool Equals(bvec4 v, bvec4 rhs) => v.Equals(rhs);
Esempio n. 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);
Esempio n. 12
0
 /// <summary>
 /// Returns a bvec4 from component-wise application of Not (!v).
 /// </summary>
 public static bvec4 Not(bvec4 v) => bvec4.Not(v);
Esempio n. 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);
Esempio n. 14
0
 /// <summary>
 /// Returns an array with all values
 /// </summary>
 public static bool[] Values(bvec4 v) => v.Values;
Esempio n. 15
0
 /// <summary>
 /// Returns an enumerator that iterates through all components.
 /// </summary>
 public static IEnumerator <bool> GetEnumerator(bvec4 v) => v.GetEnumerator();
Esempio n. 16
0
 /// <summary>
 /// Returns true if any component is true.
 /// </summary>
 public static bool Any(bvec4 v) => v.Any;
Esempio n. 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;
Esempio n. 18
0
 /// <summary>
 /// Returns true if all component are true.
 /// </summary>
 public static bool All(bvec4 v) => v.All;
Esempio n. 19
0
 /// <summary>
 /// Returns the maximal component of this vector.
 /// </summary>
 public static bool MaxElement(bvec4 v) => v.MaxElement;
Esempio n. 20
0
 /// <summary>
 /// Returns the minimal component of this vector.
 /// </summary>
 public static bool MinElement(bvec4 v) => v.MinElement;
Esempio n. 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);
Esempio n. 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;
 }
Esempio n. 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);
Esempio n. 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);
Esempio n. 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);
Esempio n. 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);
Esempio n. 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);
Esempio n. 28
0
 /// <summary>
 /// Returns the number of components (4).
 /// </summary>
 public static int Count(bvec4 v) => v.Count;
Esempio n. 29
0
 /// <summary>
 /// Returns a string representation of this vector using ', ' as a seperator.
 /// </summary>
 public static string ToString(bvec4 v) => v.ToString();
Esempio n. 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);