Exemplo n.º 1
0
 public override string ToString()
 {
     return(M00.ToString() + "," + M01.ToString() + "," + M02.ToString() + "," + M03.ToString() + "\r\n"
            + M10.ToString() + "," + M11.ToString() + "," + M12.ToString() + "," + M13.ToString() + "\r\n"
            + M20.ToString() + "," + M21.ToString() + "," + M22.ToString() + "," + M23.ToString() + "\r\n"
            + M30.ToString() + "," + M31.ToString() + "," + M32.ToString() + "," + M33.ToString());
 }
Exemplo n.º 2
0
 public override int GetHashCode()
 {
     return(M00.GetHashCode() ^ M01.GetHashCode() ^ M02.GetHashCode() ^ M03.GetHashCode() ^
            M10.GetHashCode() ^ M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode() ^
            M20.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode() ^
            M30.GetHashCode() ^ M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode());
 }
Exemplo n.º 3
0
 public override int GetHashCode()
 {
     return(HashCode.Combine(
                HashCode.Combine(M00.RoundToEpsilon(), M01.RoundToEpsilon(), M02.RoundToEpsilon(), M03.RoundToEpsilon()),
                HashCode.Combine(M10.RoundToEpsilon(), M11.RoundToEpsilon(), M12.RoundToEpsilon(), M13.RoundToEpsilon()),
                HashCode.Combine(M20.RoundToEpsilon(), M21.RoundToEpsilon(), M22.RoundToEpsilon(), M23.RoundToEpsilon()),
                HashCode.Combine(M30.RoundToEpsilon(), M31.RoundToEpsilon(), M32.RoundToEpsilon(), M33.RoundToEpsilon())));
 }
Exemplo n.º 4
0
        //// ===========================================================================================================
        //// Equality Members
        //// ===========================================================================================================

        public bool Equals(Matrix4x4 other)
        {
            // Check the diagonals first to see if we can exit early for identity matrix equality.
            return(M00.IsApproximatelyEqual(other.M00) &&
                   M11.IsApproximatelyEqual(other.M11) &&
                   M22.IsApproximatelyEqual(other.M22) &&
                   M33.IsApproximatelyEqual(other.M33) &&

                   M01.IsApproximatelyEqual(other.M01) &&
                   M02.IsApproximatelyEqual(other.M02) &&
                   M03.IsApproximatelyEqual(other.M03) &&

                   M10.IsApproximatelyEqual(other.M10) &&
                   M12.IsApproximatelyEqual(other.M12) &&
                   M13.IsApproximatelyEqual(other.M13) &&

                   M20.IsApproximatelyEqual(other.M20) &&
                   M21.IsApproximatelyEqual(other.M21) &&
                   M23.IsApproximatelyEqual(other.M23) &&

                   M30.IsApproximatelyEqual(other.M30) &&
                   M31.IsApproximatelyEqual(other.M31) &&
                   M32.IsApproximatelyEqual(other.M32));
        }
Exemplo n.º 5
0
        //#endif

        #endregion

        #region IEquatable<Matrix4x4d> Members

        public bool Equals(Matrix4x4d other)
        {
            // Check reference first.
            if (object.ReferenceEquals(this, other))
            {
                return(true);
            }

            // Check for value equality.
            if (!M00.Equals(other.M00))
            {
                return(false);
            }
            if (!M10.Equals(other.M10))
            {
                return(false);
            }
            if (!M20.Equals(other.M20))
            {
                return(false);
            }
            if (!M30.Equals(other.M30))
            {
                return(false);
            }
            if (!M01.Equals(other.M01))
            {
                return(false);
            }
            if (!M11.Equals(other.M11))
            {
                return(false);
            }
            if (!M21.Equals(other.M21))
            {
                return(false);
            }
            if (!M31.Equals(other.M31))
            {
                return(false);
            }
            if (!M02.Equals(other.M02))
            {
                return(false);
            }
            if (!M12.Equals(other.M12))
            {
                return(false);
            }
            if (!M22.Equals(other.M22))
            {
                return(false);
            }
            if (!M32.Equals(other.M32))
            {
                return(false);
            }
            if (!M03.Equals(other.M03))
            {
                return(false);
            }
            if (!M13.Equals(other.M13))
            {
                return(false);
            }
            if (!M23.Equals(other.M23))
            {
                return(false);
            }
            if (!M33.Equals(other.M33))
            {
                return(false);
            }
            return(true);
        }