ChunkLayer
Defined in: sdk/src/residency/chunks.ts:36
One kind of chunk: how it is cut, where it is wanted and how it is made.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”async?
Section titled “async?”
optionalasync?:boolean
Defined in: sdk/src/residency/chunks.ts:60
True when make answers later, off the main thread: the layer is then asked for every chunk it wants, at once, and is not held to the frame’s time.
extent
Section titled “extent”extent: readonly [
number,number,number,number] |null
Defined in: sdk/src/residency/chunks.ts:51
The chunks there are, [x0, z0, x1, z1) in chunk coordinates; null for no end.
generation
Section titled “generation”generation:
string|number
Defined in: sdk/src/residency/chunks.ts:56
Names the layer’s inputs: when it changes every chunk is made again, and answers for an older one are thrown away.
readonlylabel:string
Defined in: sdk/src/residency/chunks.ts:38
What the layer is, for the progress shown while its chunks are made.
loadRadius
Section titled “loadRadius”loadRadius:
number
Defined in: sdk/src/residency/chunks.ts:53
Chunks within this of a source are wanted; one is let go once past unloadRadius of every source.
originX
Section titled “originX”originX:
number
Defined in: sdk/src/residency/chunks.ts:46
The world position of chunk (0, 0)’s corner, and the side of a chunk along the plane’s two axes (x, then z, or y on ‘xy’).
originZ
Section titled “originZ”originZ:
number
Defined in: sdk/src/residency/chunks.ts:47
plane?
Section titled “plane?”
optionalplane?:"xz"|"xy"
Defined in: sdk/src/residency/chunks.ts:44
The world plane the chunk grid lies on. 'xz' (the default) is the ground of a 3D world and chunks are cut along world x and z. 'xy' is a 2D
world, whose ground is the screen plane: chunks are cut along world x and y, and every place below called z is world y. It decides how the world’s own
streaming sources (and the camera) are read; a layer’s own sources() already answer in the layer’s plane.
sizeX:
number
Defined in: sdk/src/residency/chunks.ts:48
sizeZ:
number
Defined in: sdk/src/residency/chunks.ts:49
unloadRadius
Section titled “unloadRadius”unloadRadius:
number
Defined in: sdk/src/residency/chunks.ts:54
Methods
Section titled “Methods”make()
Section titled “make()”make(
cx,cz,signal):T|Promise<T|null> |null
Defined in: sdk/src/residency/chunks.ts:62
Makes a chunk. Null is “not yet” (what it stands on is not ready) and is asked again later; a promise answers later.
Parameters
Section titled “Parameters”number
number
signal
Section titled “signal”AbortSignal
Returns
Section titled “Returns”T | Promise<T | null> | null
publish()
Section titled “publish()”publish(
cx,cz,value):void
Defined in: sdk/src/residency/chunks.ts:64
Puts a made chunk into the world. An older version of it, if one was published, has just been released.
Parameters
Section titled “Parameters”number
number
T
Returns
Section titled “Returns”void
release()
Section titled “release()”release(
cx,cz,value):void
Defined in: sdk/src/residency/chunks.ts:66
Takes a published chunk out of the world: everything it put there.
Parameters
Section titled “Parameters”number
number
T
Returns
Section titled “Returns”void
sources()?
Section titled “sources()?”
optionalsources():Iterable<ChunkSource>
Defined in: sdk/src/residency/chunks.ts:58
Where the layer is wanted round; absent, the world’s streaming sources (or the eye, where there are none).
Returns
Section titled “Returns”Iterable<ChunkSource>