WasmGPU.createTransform().rotateZ¶
Summary¶
WasmGPU.createTransform().rotateZ applies an incremental local rotation around the Z axis. This is often used for roll behavior and 2D-plane orientation updates. Quaternion composition is used internally, followed by normalization. Angles are in radians.
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
angle |
number |
Yes | Incremental rotation around Z axis in radians. |
Returns¶
this - Returns the same transform after rotation.
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const spriteAnchor = wgpu.createTransform();
spriteAnchor.rotateZ(Math.PI / 6).rotateZ(-Math.PI / 18);
console.log(spriteAnchor.rotation);