Skip to main content

PRELUDE

Constant PRELUDE 

Source
pub const PRELUDE: &str = "trait Click { func click() -> Unit; }\ntrait Render { func render() -> Unit; }\ntype Vec3 {\n  x: Number = 0;\n  y: Number = 0;\n  z: Number = 0;\n}\ntype Transform {\n  position: Vec3 = Vec3 {};\n  rotation: Vec3 = Vec3 {};\n  scale: Vec3 = Vec3 { x: 1, y: 1, z: 1 };\n}\ntype Sphere { radius: Number = 0.2; }\ntype Box { size: Vec3 = Vec3 { x: 1, y: 1, z: 1 }; }\ntype Cylinder { radius: Number = 0.2; height: Number = 1; }\ntype Quad { width: Number = 1; height: Number = 1; }\ntype Line { from: Vec3 = Vec3 {}; to: Vec3 = Vec3 { x: 1 }; }\ntype Ray {\n  origin: Vec3 = Vec3 {};\n  direction: Vec3 = Vec3 { z: -1 };\n  length: Number = 1;\n}\ntype Mesh { positions: Tensor[f32] = tensor[f32]([], [0, 3])?; indices: Tensor[u32] = tensor[u32]([], [0, 3])?; }\ntype PointCloud { points: Tensor[f32] = tensor[f32]([], [0, 3])?; radius: Number = 0.02; }\ntype Material {\n  color: Str = \"#6fe3ff\";\n  roughness: Number = 0.6;\n  emissive: Number = 0;\n}\ntype RigidBody {\n  kind: Str = \"dynamic\";\n  mass: Number = 1;\n  velocity: Vec3 = Vec3 {};\n  angular_velocity: Vec3 = Vec3 {};\n  restitution: Number = 0.3;\n  friction: Number = 0.5;\n}\ntype Force { value: Vec3 = Vec3 {}; }\ntype Impulse { value: Vec3 = Vec3 {}; }\ntype Text { value: Str = \"\"; size: Number = 0.2; }\ntype Image {\n  source: Str = \"\";\n  width: Number = 1;\n  height: Number = 1;\n}\ntype Video {\n  source: Str = \"\";\n  width: Number = 1;\n  height: Number = 1;\n}\ntype VideoStream {\n  source: Str = \"camera\";\n  width: Number = 1;\n  height: Number = 1;\n}\ntype Audio { source: Str = \"\"; volume: Number = 1; }\ntype AudioStream { source: Str = \"microphone\"; volume: Number = 1; }\ntype Button { label: Str = \"Button\"; action: func() -> Res[Unit, DataError] = noop; }\ntype Slider {\n  label: Str = \"Slider\";\n  action: func(Number) -> Res[Unit, DataError] = ignore_number;\n  min: Number = 0;\n  max: Number = 1;\n  value: Number = 0;\n}\ntype ImageFrame { pixels: Tensor[u8]; }\ntype AudioBlock { samples: Tensor[f32]; sample_rate: u32; }\ntype VideoFrame { image: ImageFrame; timestamp_ns: u64; }\ntype VideoClip { frames: List[VideoFrame]; }\n";
Expand description

Concatenated parser input for the documented prelude declarations.