/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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); }
/// <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; }
/// <summary> /// Returns an array with all values /// </summary> public static bool[] Values(bvec2 v) => v.Values;
/// <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);
/// <summary> /// Returns a string representation of this vector using a provided seperator. /// </summary> public static string ToString(bvec2 v, string sep) => v.ToString(sep);
/// <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);
/// <summary> /// Returns an enumerator that iterates through all components. /// </summary> public static IEnumerator <bool> GetEnumerator(bvec2 v) => v.GetEnumerator();
/// <summary> /// Returns a hash code for this instance. /// </summary> public static int GetHashCode(bvec2 v) => v.GetHashCode();
/// <summary> /// Returns true iff this equals rhs type- and component-wise. /// </summary> public static bool Equals(bvec2 v, object obj) => v.Equals(obj);
/// <summary> /// Returns true iff this equals rhs component-wise. /// </summary> public static bool Equals(bvec2 v, bvec2 rhs) => v.Equals(rhs);
/// <summary> /// Returns the number of components (2). /// </summary> public static int Count(bvec2 v) => v.Count;
/// <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);
/// <summary> /// from-vector-and-value constructor /// </summary> public bvec3(bvec2 v, bool z) { this.x = v.x; this.y = v.y; this.z = z; }
/// <summary> /// Returns a bvec2 from component-wise application of Not (!v). /// </summary> public static bvec2 Not(bvec2 v) => bvec2.Not(v);
/// <summary> /// Returns a bvec2 from component-wise application of And (lhs && rhs). /// </summary> public static bvec2 And(bvec2 lhs, bvec2 rhs) => bvec2.And(lhs, rhs);
/// <summary> /// Returns a bvec2 from component-wise application of Nand (!(lhs && rhs)). /// </summary> public static bvec2 Nand(bvec2 lhs, bvec2 rhs) => bvec2.Nand(lhs, rhs);
/// <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);
/// <summary> /// Returns a string representation of this vector using ', ' as a seperator. /// </summary> public static string ToString(bvec2 v) => v.ToString();