Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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));
Ejemplo n.º 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));
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Returns an enumerator that iterates through all components.
 /// </summary>
 public static IEnumerator <T> GetEnumerator <T>(gvec2 <T> v) => v.GetEnumerator();
Ejemplo n.º 18
0
 /// <summary>
 /// from-vector constructor
 /// </summary>
 public gvec2(gvec2 <T> v)
 {
     this.x = v.x;
     this.y = v.y;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 public static int GetHashCode <T>(gvec2 <T> v) => v.GetHashCode();
Ejemplo n.º 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);
Ejemplo n.º 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);
Ejemplo n.º 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;
Ejemplo n.º 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);
Ejemplo n.º 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();
Ejemplo n.º 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));
Ejemplo n.º 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));
Ejemplo n.º 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);
Ejemplo n.º 28
0
 /// <summary>
 /// Returns the number of components (2).
 /// </summary>
 public static int Count <T>(gvec2 <T> v) => v.Count;
Ejemplo n.º 29
0
 /// <summary>
 /// Returns an array with all values
 /// </summary>
 public static T[] Values <T>(gvec2 <T> v) => v.Values;