Skip to main content

LINE

Constant LINE 

Source
pub const LINE: &str = "type Line { from: Vec3 = Vec3 {}; to: Vec3 = Vec3 { x: 1 }; }";
Expand description

A line segment between two local positions.

Endpoints are passed through as meters. The adapter tessellates the segment for rendering; no positive length or physics collision contract is declared here.

§Declaration

type Line { from: Vec3 = Vec3 {}; to: Vec3 = Vec3 { x: 1 }; }

§Fields and methods

  • from: Start point in local meters; defaults to the origin.

  • to: End point in local meters; defaults to (1, 0, 0).

§Create a segment

Line endpoints are expressed in the entity’s local coordinates.

let entity = spawn(Line { to: Vec3 { y: 2 } });
print(get[Line](entity).to.y);