Skip to content
Konjure / spatial intelligence

Ray

← Builtin reference

A visual ray with an explicit finite length.

Signature

type Ray {
  origin: Vec3 = Vec3 {};
  direction: Vec3 = Vec3 { z: -1 };
  length: Number = 1;
}

The adapter requires direction magnitude greater than 1e-12 and positive length. It normalizes an accepted direction before building the rendered line.

Fields

origin: Vec3
Local origin in meters; defaults to zero.
DefaultVec3 {}
direction: Vec3
Local direction; spatial conversion requires magnitude greater than 1e-12 and normalizes the vector.
DefaultVec3 { z: -1 }
length: f64
Visible distance in meters; defaults to 1.
Default1

Examples

Create a ray

The default direction is local negative Z.

Tick 0 · 0.00 sThis device
main.kj⌘ / Ctrl + Enter
Loading…Drag to orbit · select to inspect
0 entities
Loading the language runtime…
Output 0
No output.
Expected output
-1

Rust definition

Interpreter RecordValue geometry schema consumed by spatial adapters.

See also