Common |
public static bool CompareMatricesFast( ref Matrix m1, ref Matrix m2 )
CompareMatricesFast compares two matrices and returns true if they are the same.
This method is much faster then the standard SharpDX.Matrix.Equals. The first problem with SharpDX.Matrix.Equals is that it uses Abs(m1-m2) that require many operations and casting to double. The second thing is that the CompareMatricesFast fist compares the fields that are most likely to be different: first Offset, than scale and the other fields. Also M14, M24 and M34 are not compared because they do not play any role in standard matrix.