Ejemplo n.º 1
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat2(bvec2 c0, bvec2 c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m10 = c1.x;
     this.m11 = c1.y;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// from-vector-and-value constructor (empty fields are zero/false)
 /// </summary>
 public bvec4(bvec2 v, bool z)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = z;
     this.w = false;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// from-vector constructor (empty fields are zero/false)
 /// </summary>
 public bvec4(bvec2 v)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = false;
     this.w = false;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// from-vector-and-value constructor
 /// </summary>
 public bvec4(bvec2 v, bool z, bool w)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = z;
     this.w = w;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat3x2(bvec2 c0, bvec2 c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m20 = false;
     this.m21 = false;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat3x2(bvec2 c0, bvec2 c1, bvec2 c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m20 = c2.x;
     this.m21 = c2.y;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat2x3(bvec2 c0, bvec2 c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = false;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = false;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat4x2(bvec2 c0, bvec2 c1, bvec2 c2, bvec2 c3)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m30 = c3.x;
     this.m31 = c3.y;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat4x2(bvec2 c0, bvec2 c1, bvec2 c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m30 = false;
     this.m31 = false;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat3(bvec2 c0, bvec2 c1, bvec2 c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = false;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = false;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = true;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat3x4(bvec2 c0, bvec2 c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = false;
     this.m03 = false;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = false;
     this.m13 = false;
     this.m20 = false;
     this.m21 = false;
     this.m22 = true;
     this.m23 = false;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat4x3(bvec2 c0, bvec2 c1, bvec2 c2, bvec2 c3)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = false;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = false;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = true;
     this.m30 = c3.x;
     this.m31 = c3.y;
     this.m32 = false;
 }
Ejemplo n.º 13
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 bvec2 result)
        {
            result = Zero;
            if (string.IsNullOrEmpty(s))
            {
                return(false);
            }
            var kvp = s.Split(new[] { sep }, StringSplitOptions.None);

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

            result = ok ? new bvec2(x, y) : Zero;
            return(ok);
        }
Ejemplo n.º 14
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public bmat4(bvec2 c0, bvec2 c1, bvec2 c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = false;
     this.m03 = false;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = false;
     this.m13 = false;
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = true;
     this.m23 = false;
     this.m30 = false;
     this.m31 = false;
     this.m32 = false;
     this.m33 = true;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Returns an array with all values
 /// </summary>
 public static bool[] Values(bvec2 v) => v.Values;
Ejemplo n.º 16
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of Or (lhs || rhs).
 /// </summary>
 public static bvec2 Or(bvec2 lhs, bvec2 rhs) => bvec2.Or(lhs, rhs);
Ejemplo n.º 17
0
 /// <summary>
 /// Returns a string representation of this vector using a provided seperator.
 /// </summary>
 public static string ToString(bvec2 v, string sep) => v.ToString(sep);
Ejemplo n.º 18
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of NotEqual (lhs != rhs).
 /// </summary>
 public static bvec2 NotEqual(bvec2 lhs, bvec2 rhs) => bvec2.NotEqual(lhs, rhs);
Ejemplo n.º 19
0
 /// <summary>
 /// Returns an enumerator that iterates through all components.
 /// </summary>
 public static IEnumerator <bool> GetEnumerator(bvec2 v) => v.GetEnumerator();
Ejemplo n.º 20
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 public static int GetHashCode(bvec2 v) => v.GetHashCode();
Ejemplo n.º 21
0
 /// <summary>
 /// Returns true iff this equals rhs type- and component-wise.
 /// </summary>
 public static bool Equals(bvec2 v, object obj) => v.Equals(obj);
Ejemplo n.º 22
0
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public static bool Equals(bvec2 v, bvec2 rhs) => v.Equals(rhs);
Ejemplo n.º 23
0
 /// <summary>
 /// Returns the number of components (2).
 /// </summary>
 public static int Count(bvec2 v) => v.Count;
Ejemplo n.º 24
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(bvec2 v, string sep, IFormatProvider provider) => v.ToString(sep, provider);
Ejemplo n.º 25
0
 /// <summary>
 /// from-vector-and-value constructor
 /// </summary>
 public bvec3(bvec2 v, bool z)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = z;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of Not (!v).
 /// </summary>
 public static bvec2 Not(bvec2 v) => bvec2.Not(v);
Ejemplo n.º 27
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of And (lhs &amp;&amp; rhs).
 /// </summary>
 public static bvec2 And(bvec2 lhs, bvec2 rhs) => bvec2.And(lhs, rhs);
Ejemplo n.º 28
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of Nand (!(lhs &amp;&amp; rhs)).
 /// </summary>
 public static bvec2 Nand(bvec2 lhs, bvec2 rhs) => bvec2.Nand(lhs, rhs);
Ejemplo n.º 29
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of Equal (lhs == rhs).
 /// </summary>
 public static bvec2 Equal(bvec2 lhs, bvec2 rhs) => bvec2.Equal(lhs, rhs);
Ejemplo n.º 30
0
 /// <summary>
 /// Returns a string representation of this vector using ', ' as a seperator.
 /// </summary>
 public static string ToString(bvec2 v) => v.ToString();