WasmGPU.createTransform().parent¶
Summary¶
WasmGPU.createTransform().parent returns the immediate parent transform or null for root-level nodes.
This is updated automatically when hierarchy APIs reparent a node.
Use it to walk upward in the transform tree, detect root nodes, or validate graph structure.
The property is read-only; call setParent or removeFromParent to change parenting.
Syntax¶
Parameters¶
This API does not take parameters.
Returns¶
Transform | null - The direct parent transform, or null if this node has no parent.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const root = wgpu.createTransform();
const child = wgpu.createTransform();
child.setParent(root);
console.log(child.parent === root);
child.removeFromParent();
console.log(child.parent === null);