voxolith

SceneEncodeOptions

Options of SceneWorker.encode.

Defined in: engine/src/worker/scene.ts:517

Properties

PropertyTypeDescriptionDefined in
cacheKey?stringThe source's identity, for a worker with a cache: a string that names its voxels and parts (e.g. GeneratorPool.modelKey(model)). The worker is asked for a stored encoding under it (together with the source's part boxes and joints and the renderer's encoding version) before any of the source is sent; on a miss the source is sent and its encoding stored. A key that two different sources share gives the second the first's encoding, so it must change whenever the voxels do. Ignored by a worker without a cache (one round trip, then the usual encode).engine/src/worker/scene.ts:545
hashKey?booleanWith no cacheKey: let a worker with a cache hash the source's bytes to look it up (about 30 ms per 100 MB on the worker). The source is sent in full either way, so this saves only the encode. Default false.engine/src/worker/scene.ts:551
keepPlacement?booleanKeep the encoding's placement data (its sub-cells) on the worker too, so that once the model is added, SceneWorker.registerEncoded registers it for placement without sending the sub-cells back. Then either registerEncoded or SceneWorker.forget must follow, or the worker holds them until it is destroyed. Default false: everything is transferred.engine/src/worker/scene.ts:536
onProgress?(done: number, total: number) => voidThe encode's progress on the worker (EncodeOptions.onProgress): done of total opaque units, first (0, total), last (total, total), about every 50 ms, never decreasing. Silent while the model's bricks are still being sent, and after the encode settles or aborts.engine/src/worker/scene.ts:529
signal?AbortSignalAborting rejects with signal.reason (an AbortError unless given another), stops sending the model's bricks, and skips the encode if the worker has not started it; a started one runs to the end and its result is dropped.engine/src/worker/scene.ts:523

On this page