PlanetProvider
此内容尚不支持你的语言。
Defined in: sdk/src/terrain/planetProvider.ts:35
A generator of ground on a sphere.
Properties
Section titled “Properties”fields?
Section titled “fields?”
readonlyoptionalfields?: readonlystring[]
Defined in: sdk/src/terrain/planetProvider.ts:46
The names of fields the ground has beyond its height and paint, which a generated world reads as part of its environment (an ecology: how much of a place is a wetland). A game’s own generator decides them, so the ground that is drawn and what grows on it come from one function.
readonlyid:string
Defined in: sdk/src/terrain/planetProvider.ts:37
The name a Planet asks for it by.
versions
Section titled “versions”
readonlyversions: readonlynumber[]
Defined in: sdk/src/terrain/planetProvider.ts:39
The generator versions it can still make.
workerSource?
Section titled “workerSource?”
readonlyoptionalworkerSource?:string
Defined in: sdk/src/terrain/planetProvider.ts:51
The text of a self-contained module (plain JavaScript, no imports) whose default export is this provider’s id, versions, fields and sample, so that
a worker can load the generator and a generated world can be laid out off the main thread. Absent, the world is laid out on the main thread.
Methods
Section titled “Methods”range()
Section titled “range()”range(
seed,version,radius): [number,number]
Defined in: sdk/src/terrain/planetProvider.ts:41
The least and most height above the radius its ground can have for this seed, version and radius: what the GPU encodes heights over.
Parameters
Section titled “Parameters”number
version
Section titled “version”number
radius
Section titled “radius”number
Returns
Section titled “Returns”[number, number]
sample()
Section titled “sample()”sample(
region):PlanetSamples|Promise<PlanetSamples>
Defined in: sdk/src/terrain/planetProvider.ts:53
The ground in the directions asked: heights in metres above the radius, the layer weights if it paints, and its fields if it has any. May answer later.
Parameters
Section titled “Parameters”region
Section titled “region”Returns
Section titled “Returns”PlanetSamples | Promise<PlanetSamples>