跳转到内容

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.

T

optional async?: 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: 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: 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.


readonly label: string

Defined in: sdk/src/residency/chunks.ts:38

What the layer is, for the progress shown while its chunks are made.


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: 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: number

Defined in: sdk/src/residency/chunks.ts:47


optional plane?: "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: number

Defined in: sdk/src/residency/chunks.ts:54

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.

number

number

AbortSignal

T | Promise<T | null> | null


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.

number

number

T

void


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.

number

number

T

void


optional sources(): 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).

Iterable<ChunkSource>