mat2x2f
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 zeros
const 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))
Call Signature
Section titled “Call Signature”mat2x2f(…
elements
):m2x2f
Defined in: packages/typegpu/src/data/matrix.ts:761
Parameters
Section titled “Parameters”elements
Section titled “elements”…[number
, number
, number
, number
]
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”mat2x2f(…
columns
):m2x2f
Defined in: packages/typegpu/src/data/matrix.ts:761
Parameters
Section titled “Parameters”columns
Section titled “columns”Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”mat2x2f():
m2x2f
Defined in: packages/typegpu/src/data/matrix.ts:761