nonstrict
scaresKit.props: the procedural props scares build (a gaunt figure, a wrapped
body on a rope, a vent, a hinged door, a shelf with a bottle, a chair, a
radio, a CRT monitor, a pane of glass, a pipe, an alarm beacon, a lamp)
from the engine's primitive meshes with tinted materials. Every prop hangs
under one root entity per placed scare, turned to the scare's facing, so
its beats can animate parts in the scare's own frame. Props are built by
every peer the same way (local entities with the same names), so a beat
that moves a part moves it on every screen.
builder(prefix: string, at: { number }, yaw: number, opts: any?) → any
A builder: { prefix, at = {x,y,z}, yaw (degrees), opts }. Its parts are named prefix.."_"..key.
| arg | type | description |
|---|
| prefix | string | |
| at | { number } | |
| yaw | number | |
| opts | any? | |
n(key: string) → string
The full entity name of part `key`.
| arg | type | description |
|---|
| key | string | |
p(dx: number, dy: number, dz: number) → void
A world point at local offset (dx, dy, dz) in the scare's frame (+z = facing).
| arg | type | description |
|---|
| dx | number | |
| dy | number | |
| dz | number | |
quatYaw(deg: number) → void
| arg | type | description |
|---|
| deg | number | |
axis(x: ?, y: ?, z: ?, d: ?) → void
| arg | type | description |
|---|
| x | ? | |
| y | ? | |
| z | ? | |
| d | ? | |
root( ) → any
The root entity every part hangs under (made on first use), placed at `at` and turned to `yaw`.
group(key: string, offset: { number }, rot: { number }?, parent: string?) → string
An empty group (a pivot) under `parent` (a key, or the root): key, local offset, Euler rotation.
| arg | type | description |
|---|
| key | string | |
| offset | { number } | |
| rot | { number }? | |
| parent | string? | |
part(key: string, spec: any) → string
One primitive part: key, { mesh = "cube" | "sphere" | "cylinder" | "capsule" | "cone" | "torus" | "plane", at = local offset, size = {x,y,z}, rot = Euler, tint = {r,g,b}, material = "matte" | "metal" | "glass" | "glow" | "plastic", parent = key, hidden, collide, shadows = true }. Returns its name.
| arg | type | description |
|---|
| key | string | |
| spec | any | |
lamp(key: string, spec: any) → string
A point light part: key, { at, color = {r,g,b}, intensity, radius, parent, off = true (starts at 0) }.
| arg | type | description |
|---|
| key | string | |
| spec | any | |
clear( ) → void
Remove everything this builder made.
figure(b: any, key: string, opts: any?) → string
The figure: a gaunt, too-tall silhouette (2.3 m) with overlong arms and a head tilted on its shoulder, two pinprick eyes. Built facing +z under a group `key`. opts: { at, hidden, tint, eyes = true }.
| arg | type | description |
|---|
| b | any | |
| key | string | |
| opts | any? | |
mannequin(b: any, key: string, opts: any?) → string
A mannequin: a pale, smooth, featureless figure on a stand (1.8 m). Group `key`.
| arg | type | description |
|---|
| b | any | |
| key | string | |
| opts | any? | |
body(b: any, key: string, opts: any?) → string
A body wrapped in a stained sheet hanging from a rope: group `key` (its origin is the rope's top).
| arg | type | description |
|---|
| b | any | |
| key | string | |
| opts | any? | |
vent(b: any, key: string, opts: any?) → string
A wall vent: a dark frame and a grille cover (the cover is part `key`_cover, separate so it can fly off).
| arg | type | description |
|---|
| b | any | |
| key | string | |
| opts | any? | |
door(b: any, key: string, opts: any?) → string
A heavy door on a hinge: group `key`_hinge (turn it to swing), panel `key`_panel, standing open `open` degrees.
| arg | type | description |
|---|
| b | any | |
| key | string | |
| opts | any? | |
lamp(b: any, key: string, opts: any?) → string
A ceiling lamp: a shade and a point light `key` (the light).
| arg | type | description |
|---|
| b | any | |
| key | string | |
| opts | any? | |
pane(b: any, key: string, opts: any?) → string
A pane of glass in a frame (2 x 1.4 m) at local `at`.
| arg | type | description |
|---|
| b | any | |
| key | string | |
| opts | any? | |