- - - mat2 m2 = mat2( 0.0f ); // mat2 m2 = mat2( 0.0f, 0.0f, 0.0f, 0.0f ); mat3 m3 = mat3( m2 ); // mat3 m3 = mat3( 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f ); mat3 m3_2 = mat3( vec3( 1.0f, 2.0f, 3.0f ), 4.0f, 5.0f, 6.0f, vec3( 7.0f, 8.0f, 9.0f )); mat4 m4 = mat4.identity; // just an identity matrix mat3 m3_3 = mat3( m4 ); // mat3 m3_3 = mat3.identity - - -
Constructs the matrix: If a single value is passed, the matrix will be cleared with this value ( each column in each col will contain this value ). If a matrix with more cols and columns is passed, the matrix will be the upper left nxm matrix. If a matrix with less cols and columns is passed, the passed matrix will be stored in the upper left of an identity matrix. It's also allowed to pass vectors and scalars at a time, but the vectors dimension must match the number of columns and align correctly.