/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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); }
/// <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; }
/// <summary> /// Returns a hash code for this instance. /// </summary> public static int GetHashCode(bvec4 v) => v.GetHashCode();
/// <summary> /// Returns true iff this equals rhs type- and component-wise. /// </summary> public static bool Equals(bvec4 v, object obj) => v.Equals(obj);
/// <summary> /// Returns true iff this equals rhs component-wise. /// </summary> public static bool Equals(bvec4 v, bvec4 rhs) => v.Equals(rhs);
/// <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);
/// <summary> /// Returns a bvec4 from component-wise application of Not (!v). /// </summary> public static bvec4 Not(bvec4 v) => bvec4.Not(v);
/// <summary> /// Returns a bvec4 from component-wise application of Nand (!(lhs && rhs)). /// </summary> public static bvec4 Nand(bvec4 lhs, bvec4 rhs) => bvec4.Nand(lhs, rhs);
/// <summary> /// Returns an array with all values /// </summary> public static bool[] Values(bvec4 v) => v.Values;
/// <summary> /// Returns an enumerator that iterates through all components. /// </summary> public static IEnumerator <bool> GetEnumerator(bvec4 v) => v.GetEnumerator();
/// <summary> /// Returns true if any component is true. /// </summary> public static bool Any(bvec4 v) => v.Any;
/// <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;
/// <summary> /// Returns true if all component are true. /// </summary> public static bool All(bvec4 v) => v.All;
/// <summary> /// Returns the maximal component of this vector. /// </summary> public static bool MaxElement(bvec4 v) => v.MaxElement;
/// <summary> /// Returns the minimal component of this vector. /// </summary> public static bool MinElement(bvec4 v) => v.MinElement;
/// <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);
/// <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; }
/// <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);
/// <summary> /// Returns a string representation of this vector using a provided seperator. /// </summary> public static string ToString(bvec4 v, string sep) => v.ToString(sep);
/// <summary> /// Returns a bvec4 from component-wise application of And (lhs && rhs). /// </summary> public static bvec4 And(bvec4 lhs, bvec4 rhs) => bvec4.And(lhs, rhs);
/// <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);
/// <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);
/// <summary> /// Returns the number of components (4). /// </summary> public static int Count(bvec4 v) => v.Count;
/// <summary> /// Returns a string representation of this vector using ', ' as a seperator. /// </summary> public static string ToString(bvec4 v) => v.ToString();
/// <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);