@@ -161,7 +161,7 @@ public float Determinant3x3()
161
161
float det = 0f ;
162
162
163
163
float diag1 = M11 * M22 * M33 ;
164
- float diag2 = M12 * M32 * M31 ;
164
+ float diag2 = M12 * M23 * M31 ;
165
165
float diag3 = M13 * M21 * M32 ;
166
166
float diag4 = M31 * M22 * M13 ;
167
167
float diag5 = M32 * M23 * M11 ;
@@ -950,7 +950,7 @@ public static Matrix4 Adjoint(Matrix4 matrix)
950
950
for ( int i = 0 ; i < 4 ; i ++ )
951
951
{
952
952
for ( int j = 0 ; j < 4 ; j ++ )
953
- adjointMatrix [ i , j ] = ( float ) ( Math . Pow ( - 1 , i + j ) * ( ( Minor ( matrix , i , j ) ) . Determinant ( ) ) ) ;
953
+ adjointMatrix [ i , j ] = ( float ) ( Math . Pow ( - 1 , i + j ) * ( ( Minor ( matrix , i , j ) ) . Determinant3x3 ( ) ) ) ;
954
954
}
955
955
956
956
adjointMatrix = Transpose ( adjointMatrix ) ;
@@ -986,12 +986,15 @@ public static Matrix4 Minor(Matrix4 matrix, int row, int col)
986
986
987
987
public override bool Equals ( object obj )
988
988
{
989
- return ( obj is Matrix4 ) ? this == ( Matrix4 ) obj : false ;
989
+ return ( obj is Matrix4 ) ? this . Equals ( ( Matrix4 ) obj ) : false ;
990
990
}
991
991
992
992
public bool Equals ( Matrix4 other )
993
993
{
994
- return this == other ;
994
+ return M11 == other . M11 && M12 == other . M12 && M13 == other . M13 && M14 == other . M14 &&
995
+ M21 == other . M21 && M22 == other . M22 && M23 == other . M23 && M24 == other . M24 &&
996
+ M31 == other . M31 && M32 == other . M32 && M33 == other . M33 && M14 == other . M34 &&
997
+ M41 == other . M41 && M42 == other . M42 && M43 == other . M43 && M44 == other . M44 ;
995
998
}
996
999
997
1000
public override int GetHashCode ( )
0 commit comments