Skip to main content

PARENT

Constant PARENT 

Source
pub const PARENT: &str = "type Parent { entity: Entity; }";
Expand description

A local scene-graph relationship.

The referenced entity is retained as a group when it has no geometry, so authored hierarchy is never discarded. Parent transforms are composed by the SDK after the adapter has validated the language entity reference.

§Declaration

type Parent { entity: Entity; }

§Fields and methods

  • entity: The parent Entity. The spatial adapter rejects a missing target; the SDK rejects self-parenting, cycles, and excessive depth.

§Parent a visible child

Transforms remain local to the parent entity.

let root = spawn(Transform { position: Vec3 { x: 1 } });
let child = spawn(Sphere {});
add(child, Parent { entity: root });
print(get[Parent](child).entity);