Waters
此内容尚不支持你的语言。
Defined in: sdk/src/water/waterPlugin.ts:140
Run-time access to the water: where its surface is at a point, for what floats on it or swims in it.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Waters():
Waters
Returns
Section titled “Returns”Waters
Properties
Section titled “Properties”baking
Section titled “baking”baking:
boolean=false
Defined in: sdk/src/water/waterPlugin.ts:154
Whether a bake is in hand: what is placed by the water waits for it.
quality
Section titled “quality”quality:
WaterQuality=FULL_WATER
Defined in: sdk/src/water/waterPlugin.ts:143
What the quality level allows now; the plugin refreshes it each frame, and what is drawn and what is answered both follow it.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get empty():
boolean
Defined in: sdk/src/water/waterPlugin.ts:165
Whether there is no water to ask about: nothing is baked, so depthAt answers null everywhere. A world laid out with no water at
all is laid out the same here and on a worker, which “no data to hand over” alone does not say.
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”bodyAt()
Section titled “bodyAt()”bodyAt(
x,z): {bodyId:string;entity:number;form:number;level:number; } |null
Defined in: sdk/src/water/waterPlugin.ts:217
The body of water at (x, z) and its surface at rest, or null where there is none: which water a place belongs to, for what a game keeps per body (a fishing spot, a level it raises) and a placement that keeps by the shore.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”{ bodyId: string; entity: number; form: number; level: number; } | null
depthAt()
Section titled “depthAt()”depthAt(
x,z,y):number|null
Defined in: sdk/src/water/waterPlugin.ts:170
How deep the water stands at rest over the world height y at (x, z): above zero under water, null where there is none.
Parameters
Section titled “Parameters”number
number
number
Returns
Section titled “Returns”number | null
disturb()
Section titled “disturb()”disturb(
x,y,z,radius,strength):boolean
Defined in: sdk/src/water/waterPlugin.ts:202
Disturbs the water at the world point (x, y, z): a bump of strength world units (negative is a dip) over radius, which spreads as a ring and leaves foam.
Does nothing where there is no water or where the zone keeps no ripples.
Parameters
Section titled “Parameters”number
number
number
radius
Section titled “radius”number
strength
Section titled “strength”number
Returns
Section titled “Returns”boolean
heightAt()
Section titled “heightAt()”heightAt(
x,z):number|null
Defined in: sdk/src/water/waterPlugin.ts:241
The world height of the surface above or below (x, z), or null where there is none.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”number | null
queryData()
Section titled “queryData()”queryData():
WaterQueryData|null
Defined in: sdk/src/water/waterPlugin.ts:157
The baked water as data a worker can answer depthAt and shoreAt from, or null where none is baked.
Returns
Section titled “Returns”WaterQueryData | null
rippleAt()
Section titled “rippleAt()”rippleAt(
x,_y,z):number
Defined in: sdk/src/water/waterPlugin.ts:209
The height the ripples add to the surface at the world point, where the zone keeps them; 0 elsewhere.
Parameters
Section titled “Parameters”number
number
number
Returns
Section titled “Returns”number
sample()
Section titled “sample()”sample(
x,y,z):WaterSample|null
Defined in: sdk/src/water/waterPlugin.ts:178
The surface over or under (x, y, z): how far above it the point is (negative under), the surface’s normal, the current, and the point
on it straight above or below. Null where there is no water. The waves are read at the instant of the frame.
Parameters
Section titled “Parameters”number
number
number
Returns
Section titled “Returns”WaterSample | null
shoreAt()
Section titled “shoreAt()”shoreAt(
x,z):number|null
Defined in: sdk/src/water/waterPlugin.ts:230
How far (x, z) is from the water’s edge, across the ground: above zero on dry land (how far to the nearest water), below it on the water (how far in from its shore). Past the zone’s region it is the open sea’s, deep in; null where no water is baked at all.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”number | null