WasmGPU.math.mat4.isIdentity¶
Summary¶
WasmGPU.math.mat4.isIdentity checks whether the matrix is the identity transform. Use it to skip unnecessary matrix multiplications.
Syntax¶
WasmGPU.math.mat4.isIdentity(matr: number[]): boolean
const result = wgpu.math.mat4.isIdentity(matr);
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
matr |
number[] |
Yes | Input 4x4 matrix (16 numbers in column-major order) used by this operation. |
Returns¶
boolean - Boolean flag indicating whether the tested condition is satisfied.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const matr = wgpu.math.mat4.translate(wgpu.math.mat4.identity(), [1, 2, 3]);
const result = wgpu.math.mat4.isIdentity(matr);
console.log(result);