Exemple #1
0
 /// <summary>
 /// from-vector-and-value constructor
 /// </summary>
 public gvec4(gvec2 <T> v, T z, T w)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = z;
     this.w = w;
 }
Exemple #2
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat2(gvec2 <T> c0, gvec2 <T> c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m10 = c1.x;
     this.m11 = c1.y;
 }
Exemple #3
0
 /// <summary>
 /// from-vector-and-value constructor (empty fields are zero/false)
 /// </summary>
 public gvec4(gvec2 <T> v, T z)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = z;
     this.w = default(T);
 }
Exemple #4
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat3x2(gvec2 <T> c0, gvec2 <T> c1, gvec2 <T> 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;
 }
Exemple #5
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat3x2(gvec2 <T> c0, gvec2 <T> c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m20 = default(T);
     this.m21 = default(T);
 }
Exemple #6
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat2x3(gvec2 <T> c0, gvec2 <T> c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = default(T);
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = default(T);
 }
Exemple #7
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat4x2(gvec2 <T> c0, gvec2 <T> c1, gvec2 <T> c2, gvec2 <T> 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;
 }
Exemple #8
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat4x2(gvec2 <T> c0, gvec2 <T> c1, gvec2 <T> 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 = default(T);
     this.m31 = default(T);
 }
Exemple #9
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat3(gvec2 <T> c0, gvec2 <T> c1, gvec2 <T> c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = default(T);
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = default(T);
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = default(T);
 }
Exemple #10
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat4x3(gvec2 <T> c0, gvec2 <T> c1, gvec2 <T> c2, gvec2 <T> c3)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = default(T);
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = default(T);
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = default(T);
     this.m30 = c3.x;
     this.m31 = c3.y;
     this.m32 = default(T);
 }
Exemple #11
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat3x4(gvec2 <T> c0, gvec2 <T> c1)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = default(T);
     this.m03 = default(T);
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = default(T);
     this.m13 = default(T);
     this.m20 = default(T);
     this.m21 = default(T);
     this.m22 = default(T);
     this.m23 = default(T);
 }
Exemple #12
0
 /// <summary>
 /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix.
 /// </summary>
 public gmat4(gvec2 <T> c0, gvec2 <T> c1, gvec2 <T> c2)
 {
     this.m00 = c0.x;
     this.m01 = c0.y;
     this.m02 = default(T);
     this.m03 = default(T);
     this.m10 = c1.x;
     this.m11 = c1.y;
     this.m12 = default(T);
     this.m13 = default(T);
     this.m20 = c2.x;
     this.m21 = c2.y;
     this.m22 = default(T);
     this.m23 = default(T);
     this.m30 = default(T);
     this.m31 = default(T);
     this.m32 = default(T);
     this.m33 = default(T);
 }
Exemple #13
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of Equal (EqualityComparer&lt;T&gt;.Default.Equals(lhs, rhs)).
 /// </summary>
 public static bvec2 Equal(gvec2 <T> lhs, gvec2 <T> rhs) => new bvec2(EqualityComparer <T> .Default.Equals(lhs.x, rhs.x), EqualityComparer <T> .Default.Equals(lhs.y, rhs.y));
Exemple #14
0
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public bool Equals(gvec2 <T> rhs) => (EqualityComparer <T> .Default.Equals(x, rhs.x) && EqualityComparer <T> .Default.Equals(y, rhs.y));
Exemple #15
0
 /// <summary>
 /// from-vector constructor (empty fields are zero/false)
 /// </summary>
 public gvec3(gvec2 <T> v)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = default(T);
 }
Exemple #16
0
 /// <summary>
 /// from-vector-and-value constructor
 /// </summary>
 public gvec3(gvec2 <T> v, T z)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = z;
 }
Exemple #17
0
 /// <summary>
 /// Returns an enumerator that iterates through all components.
 /// </summary>
 public static IEnumerator <T> GetEnumerator <T>(gvec2 <T> v) => v.GetEnumerator();
Exemple #18
0
 /// <summary>
 /// from-vector constructor
 /// </summary>
 public gvec2(gvec2 <T> v)
 {
     this.x = v.x;
     this.y = v.y;
 }
Exemple #19
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 public static int GetHashCode <T>(gvec2 <T> v) => v.GetHashCode();
Exemple #20
0
 /// <summary>
 /// Returns true iff this equals rhs type- and component-wise.
 /// </summary>
 public static bool Equals <T>(gvec2 <T> v, object obj) => v.Equals(obj);
Exemple #21
0
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public static bool Equals <T>(gvec2 <T> v, gvec2 <T> rhs) => v.Equals(rhs);
Exemple #22
0
 /// <summary>
 /// Returns an object that can be used for arbitrary swizzling (e.g. swizzle.zy)
 /// </summary>
 public static swizzle_gvec2 <T> swizzle <T>(gvec2 <T> v) => v.swizzle;
Exemple #23
0
 /// <summary>
 /// Returns a string representation of this vector using a provided seperator.
 /// </summary>
 public static string ToString <T>(gvec2 <T> v, string sep) => v.ToString(sep);
Exemple #24
0
 /// <summary>
 /// Returns a string representation of this vector using ', ' as a seperator.
 /// </summary>
 public static string ToString <T>(gvec2 <T> v) => v.ToString();
Exemple #25
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of NotEqual (!EqualityComparer&lt;T&gt;.Default.Equals(lhs, rhs)).
 /// </summary>
 public static bvec2 NotEqual(gvec2 <T> lhs, T rhs) => new bvec2(!EqualityComparer <T> .Default.Equals(lhs.x, rhs), !EqualityComparer <T> .Default.Equals(lhs.y, rhs));
Exemple #26
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of NotEqual (!EqualityComparer&lt;T&gt;.Default.Equals(lhs, rhs)).
 /// </summary>
 public static bvec2 NotEqual(T lhs, gvec2 <T> rhs) => new bvec2(!EqualityComparer <T> .Default.Equals(lhs, rhs.x), !EqualityComparer <T> .Default.Equals(lhs, rhs.y));
Exemple #27
0
 /// <summary>
 /// Returns a bvec2 from component-wise application of NotEqual (!EqualityComparer&lt;T&gt;.Default.Equals(lhs, rhs)).
 /// </summary>
 public static bvec2 NotEqual <T>(gvec2 <T> lhs, gvec2 <T> rhs) => gvec2 <T> .NotEqual(lhs, rhs);
Exemple #28
0
 /// <summary>
 /// Returns the number of components (2).
 /// </summary>
 public static int Count <T>(gvec2 <T> v) => v.Count;
Exemple #29
0
 /// <summary>
 /// Returns an array with all values
 /// </summary>
 public static T[] Values <T>(gvec2 <T> v) => v.Values;