Click or drag to resize
AB4D logo

CommonUtilsCompareMatricesFast Method

CompareMatricesFast compares two matrices and returns true if they are the same.

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public static bool CompareMatricesFast(
	ref Matrix m1,
	ref Matrix m2
)

Parameters

m1  Matrix
first Matrix
m2  Matrix
second Matrix

Return Value

Boolean
true if m1 is the same as m2
Remarks

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.

See Also