Unittest identity, isIdentity
mat2 m2 = mat2( 1.0f ); assert( m2.isIdentity ); assert( m2.data == mat2( 1 ).data ); m2 = mat2.identity; assert( m2.data == [[ 1.0f, 0.0f ], [ 0.0f, 1.0f ]] ); mat3 m3 = mat3.identity; assert( m3.isIdentity ); assert( m3.data == mat3( 1.0f ).data ); mat4 m4 = mat4( 2.0f ); assert( m4.data == mat4( 2.0f ).data ); m4 = mat4.identity; assert( m4.isIdentity ); assert( m4.data == [[ 1.0f, 0.0f, 0.0f, 0.0f ], [ 0.0f, 1.0f, 0.0f, 0.0f ], [ 0.0f, 0.0f, 1.0f, 0.0f ], [ 0.0f, 0.0f, 0.0f, 1.0f ]] ); assert( m4.data == m4.identity.data );
Returns a identity matrix.