mat4x4f
constmat4x4f:Mat4x4f
Defined in: packages/typegpu/src/data/matrix.ts:769
Schema representing mat4x4f - a matrix with 4 rows and 4 columns, with elements of type f32. Also a constructor function for this matrix type.
Examples
Section titled βExamplesβconst zero4x4 = mat4x4f(); // filled with zerosconst mat = mat4x4f(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);mat.columns[0] // vec4f(0, 1, 2, 3)mat.columns[1] // vec4f(4, 5, 6, 7)mat.columns[2] // vec4f(8, 9, 10, 11)mat.columns[3] // vec4f(12, 13, 14, 15)const mat = mat4x4f( vec4f(0, 1, 2, 3), // column 0 vec4f(4, 5, 6, 7), // column 1 vec4f(8, 9, 10, 11), // column 2 vec4f(12, 13, 14, 15), // column 3);const buffer = root.createBuffer(d.mat4x4f, d.mat4x4f()); // buffer holding a d.mat4x4f value, with an initial value of mat4x4f filled with zeros