Skip to main content

BOX

Constant BOX 

Source
pub const BOX: &str = "type Box { size: Vec3 = Vec3 { x: 1, y: 1, z: 1 }; }";
Expand description

An axis-aligned local box with full dimensions.

The spatial adapter validates positive dimensions before rendering. Box is one of the two collision shapes accepted by RigidBody; size uses full extents.

§Declaration

type Box { size: Vec3 = Vec3 { x: 1, y: 1, z: 1 }; }

§Fields and methods

  • size: Full width, height, and depth in meters; each physical dimension must be positive.

§Create a box

Size records full extents, not half extents.

let entity = spawn(Box { size: Vec3 { x: 2, y: 1, z: 1 } });
print(get[Box](entity).size.x);