ServeSceneOptions
Options for serveScene.
Defined in: engine/src/worker/scene.ts:137
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
cache? | string | ServeSceneCacheOptions | Keep encodings and bakes in IndexedDB under this database name (openSceneCache), and serve them from there next time. Off by default; leave it off in development, where the worker URL does not change with the code. The object form adds a size cap and compression (SceneCacheOptions); inspect and clear it from the main thread with openSceneCacheControls. - A bake is looked up by a digest of its input and of the placement data of every model it names, so it needs nothing from the host. - An encoding is looked up by the source's identity: the cacheKey the host gives (SceneEncodeOptions.cacheKey, e.g. GeneratorPool.modelKey), or with hashKey a hash of the source's bytes. Without either it is not cached. Opening the cache deletes every entry stored under another salt (an older build of this worker), so give each worker script its own database name, and not the model cache's. A maxBytes that is not a positive finite number makes serveScene throw; doubtful ones warn (SceneCacheOptions.maxBytes). | engine/src/worker/scene.ts:159 |
scope? | SceneScope | The worker global (default self). | engine/src/worker/scene.ts:139 |
ServeSceneCacheOptions
The object form of ServeSceneOptions.cache.
ChunkFill
Fills one 8³ brick, the way an editMany fill callback does: cells holds the brick's 512 voxels (lx + ly8 + lz64), empty unless an earlier box of the same request already wrote to it, and (ox, oy, oz) is its world origin. Write the voxels and return true if anything changed.