예제 #1
0
 /// <summary>
 /// Compares whether current instance is equal to specified <see cref="Matrix" /> without any tolerance.
 /// </summary>
 /// <param name="other">The <see cref="Matrix" /> to compare.</param>
 /// <returns><c>true</c> if the instances are equal; <c>false</c> otherwise.</returns>
 public bool Equals(Matrix other)
 {
     return(M11.Equals(other.M11) && M22.Equals(other.M22) && M33.Equals(other.M33) && M44.Equals(other.M44) &&
            M12.Equals(other.M12) && M13.Equals(other.M13) && M14.Equals(other.M14) && M21.Equals(other.M21) &&
            M23.Equals(other.M23) && M24.Equals(other.M24) && M31.Equals(other.M31) && M32.Equals(other.M32) &&
            M34.Equals(other.M34) && M41.Equals(other.M41) && M42.Equals(other.M42) && M43.Equals(other.M43));
 }
예제 #2
0
 /// <summary>
 /// Gets the hash code for a given Matrix4.
 /// </summary>
 /// <returns>The calculated hash code.</returns>
 public override int GetHashCode()
 {
     // Note this method of hash code generation is similar to what the XNA framework does
     return(M11.GetHashCode() + M12.GetHashCode() + M13.GetHashCode() + M14.GetHashCode()
            + M21.GetHashCode() + M22.GetHashCode() + M23.GetHashCode() + M24.GetHashCode()
            + M31.GetHashCode() + M32.GetHashCode() + M33.GetHashCode() + M34.GetHashCode()
            + M41.GetHashCode() + M42.GetHashCode() + M43.GetHashCode() + M44.GetHashCode());
 }
예제 #3
0
 public void dump(string name = "")
 {
     DOut.pl(nameof(UMatrix4) + " " + name + " {");
     DOut.Indent++;
     DOut.pl(M11.ToString() + ", " + M12.ToString() + ", " + M13.ToString() + ", " + M14.ToString());
     DOut.pl(M21.ToString() + ", " + M22.ToString() + ", " + M23.ToString() + ", " + M24.ToString());
     DOut.pl(M31.ToString() + ", " + M32.ToString() + ", " + M33.ToString() + ", " + M34.ToString());
     DOut.pl(M41.ToString() + ", " + M42.ToString() + ", " + M43.ToString() + ", " + M44.ToString());
     DOut.Indent--;
     DOut.pl("}");
 }
예제 #4
0
 public override int GetHashCode()
 {
     return(M11.GetHashCode()
            ^ M12.GetHashCode()
            ^ M13.GetHashCode()
            ^ M14.GetHashCode()
            ^ M21.GetHashCode()
            ^ M22.GetHashCode()
            ^ M23.GetHashCode()
            ^ M24.GetHashCode()
            ^ M31.GetHashCode()
            ^ M32.GetHashCode()
            ^ M33.GetHashCode()
            ^ M34.GetHashCode()
            ^ M41.GetHashCode()
            ^ M42.GetHashCode()
            ^ M43.GetHashCode()
            ^ M44.GetHashCode());
 }
예제 #5
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = M11.GetHashCode();
         hashCode = (hashCode * 397) ^ M12.GetHashCode();
         hashCode = (hashCode * 397) ^ M13.GetHashCode();
         hashCode = (hashCode * 397) ^ M14.GetHashCode();
         hashCode = (hashCode * 397) ^ M21.GetHashCode();
         hashCode = (hashCode * 397) ^ M22.GetHashCode();
         hashCode = (hashCode * 397) ^ M23.GetHashCode();
         hashCode = (hashCode * 397) ^ M24.GetHashCode();
         hashCode = (hashCode * 397) ^ M31.GetHashCode();
         hashCode = (hashCode * 397) ^ M32.GetHashCode();
         hashCode = (hashCode * 397) ^ M33.GetHashCode();
         hashCode = (hashCode * 397) ^ M34.GetHashCode();
         hashCode = (hashCode * 397) ^ M41.GetHashCode();
         hashCode = (hashCode * 397) ^ M42.GetHashCode();
         hashCode = (hashCode * 397) ^ M43.GetHashCode();
         hashCode = (hashCode * 397) ^ M44.GetHashCode();
         return(hashCode);
     }
 }
예제 #6
0
 /// <inheritdoc/>
 public override Int32 GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 23 + M11.GetHashCode();
         hash = hash * 23 + M12.GetHashCode();
         hash = hash * 23 + M13.GetHashCode();
         hash = hash * 23 + M14.GetHashCode();
         hash = hash * 23 + M21.GetHashCode();
         hash = hash * 23 + M22.GetHashCode();
         hash = hash * 23 + M23.GetHashCode();
         hash = hash * 23 + M24.GetHashCode();
         hash = hash * 23 + M31.GetHashCode();
         hash = hash * 23 + M32.GetHashCode();
         hash = hash * 23 + M33.GetHashCode();
         hash = hash * 23 + M34.GetHashCode();
         hash = hash * 23 + M41.GetHashCode();
         hash = hash * 23 + M42.GetHashCode();
         hash = hash * 23 + M43.GetHashCode();
         hash = hash * 23 + M44.GetHashCode();
         return(hash);
     }
 }
예제 #7
0
 get => new Vector3(M41, M42, M43);
예제 #8
0
 /// <inheritdoc />
 public bool Equals(Matrix4x4 other) =>
 M11.Equals(other.M11) && M12.Equals(other.M12) && M13.Equals(other.M13) && M14.Equals(other.M14) &&
 M21.Equals(other.M21) && M22.Equals(other.M22) && M23.Equals(other.M23) && M24.Equals(other.M24) &&
 M31.Equals(other.M31) && M32.Equals(other.M32) && M33.Equals(other.M33) && M34.Equals(other.M34) &&
 M41.Equals(other.M41) && M42.Equals(other.M42) && M43.Equals(other.M43) && M44.Equals(other.M44);