Appearance
@bendyline/molen-dioramas/kernel
Bounded scripted set pieces: deterministic local scenes and lazy proximity playback.
ts
import { /* … */ } from '@bendyline/molen-dioramas/kernel';Interfaces
DioramaBounds
Local meters, Y up. Bounds constrain entity origins, not mesh extents.
Properties
max
ts
max: Vec3;min
ts
min: Vec3;DioramaDefinition
Ordinary scene data; resolve script paths to code before handing it to playback.
Properties
bounds
ts
bounds: DioramaBounds;maxEntities?
ts
optional maxEntities?: number;Per-instance entity budget, including scenery (default 512).
scene
ts
scene: SceneManifest;DioramaPlayback
Small synchronous bridge, usable in Node and by the browser visual.
Properties
tick
ts
readonly tick: number;tickRate
ts
readonly tickRate: number;Methods
advance()
ts
advance(seconds): Delta | undefined;Fixed ticks, with at most 0.2 seconds of catch-up per call.
Parameters
seconds
number
Returns
Delta | undefined
dispose()
ts
dispose(): void;Returns
void
keyframe()
ts
keyframe(): Keyframe;Returns
Keyframe
Functions
createDiorama()
ts
function createDiorama(definition): DioramaPlayback;A diorama is a normal scripted world in local meters. It owns its RNG, entity ids, timers, script state and figures. Discarding one cannot leave systems in the surrounding world. Scripts use the normal trust contract; bounds and budgets are authoring guards, not a sandbox.
Parameters
definition
Returns
validateDioramaBounds()
ts
function validateDioramaBounds(bounds): void;Parameters
bounds
Returns
void