mat2x2f
constmat2x2f:Mat2x2f
Defined in: packages/typegpu/src/data/matrix.ts:707
Schema representing mat2x2f - a matrix with 2 rows and 2 columns, with elements of type f32. Also a constructor function for this matrix type.
Examples
Section titled βExamplesβconst zero2x2 = mat2x2f(); // filled with zerosconst mat = mat2x2f(0, 1, 2, 3);mat.columns[0] // vec2f(0, 1)mat.columns[1] // vec2f(2, 3)const mat = mat2x2f( vec2f(0, 1), // column 0 vec2f(1, 2), // column 1);const buffer = root.createBuffer(d.mat2x2f, d.mat2x2f(0, 1, 2, 3)); // buffer holding a d.mat2x2f value, with an initial value of ((0, 1), (2, 3))