Repository navigation
API Class WaterSurface
Defined in: src/engine/render/water/WaterSurface.ts:40
A moving water surface: a square grid of size world units centred on its node, in the node's
XZ plane, displaced by up to 8 Gerstner waves. sample(x, z) (and Water.sample) returns the
height and normal of the drawn surface, for buoyancy and gameplay.
Keep the node level (turn it about Y only): sampling assumes the water's up is the world's.
new WaterSurface(): WaterSurface;WaterSurface
deepColor: Color;Defined in: src/engine/render/water/WaterSurface.ts:50
Colour looking straight down into the water and in troughs.
foamAmount: number = 0.5;Defined in: src/engine/render/water/WaterSurface.ts:55
0 (none) to 1: how readily foam forms where crests fold.
foamColor: Color;Defined in: src/engine/render/water/WaterSurface.ts:53
normalDetail: number = 0.5;Defined in: src/engine/render/water/WaterSurface.ts:57
Strength of the scrolling ripple normals on top of the waves (0 = none).
opacity: number = 1;Defined in: src/engine/render/water/WaterSurface.ts:60
Below 1 the surface is drawn transparent.
reflectivity: number = 0.5;Defined in: src/engine/render/water/WaterSurface.ts:62
Strength of the Fresnel reflection of the environment (0–1).
resolution: number = 128;Defined in: src/engine/render/water/WaterSurface.ts:44
Vertices per side (2–1024). Quality tiers with the "low" shader level use half.
roughness: number = 0.08;Defined in: src/engine/render/water/WaterSurface.ts:58
shallowColor: Color;Defined in: src/engine/render/water/WaterSurface.ts:52
Colour at grazing angles and on crests.
size: number = 100;Defined in: src/engine/render/water/WaterSurface.ts:42
Side of the square grid, in the node's local units.
wakeMode: WaterWakeMode = "trail";Defined in: src/engine/render/water/WaterSurface.ts:68
How the surface draws the wakes of WaterWake nodes on it (ADR 0459): "trail" (foam and Kelvin
ripples along each stern's path, shaded per pixel), "field" (a simulated wave height field around
the camera that hulls press into; it also raises the surface) or "off".
waves: WaterWave[];Defined in: src/engine/render/water/WaterSurface.ts:46
Up to 8 waves: direction (degrees, 0 = +X), wavelength, steepness 0–1, speed (0: deep-water speed; negative: backward).
waveScale: number = 1;Defined in: src/engine/render/water/WaterSurface.ts:48
Multiplies every wave's amplitude; raise it at runtime for a storm.
get enabled(): boolean;Defined in: src/engine/core/Component.ts:62
boolean
set enabled(value): void;Defined in: src/engine/core/Component.ts:66
boolean
void
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:42
Unity-style alias for node.
get isActiveAndEnabled(): boolean;Defined in: src/engine/core/Component.ts:73
True when enabled, the node is active in the hierarchy, and the node is in a loaded world.
boolean
get node(): GameObject;Defined in: src/engine/core/Component.ts:37
The node this component is on.
get owner(): GameObject;Defined in: src/engine/core/Component.ts:50
The node this component acts for: the node itself when attached directly, or the parent node when this component lives on a component node (ADR 0009).
get time(): Readonly<TimeState>;Defined in: src/engine/core/Component.ts:98
This component's World's clock (ADR 0032): the same values as Time, but safe to read
outside the World's frame too (after an await, say).
Readonly<TimeState>
get transform(): Transform;Defined in: src/engine/core/Component.ts:56
The Transform of the node this component is on, if it has one.
get world(): WorldHandle;Defined in: src/engine/core/Component.ts:87
A handle on this component's World (ADR 0132): the same one Engine.findWorld returns. Load
a scene into it, pause, connect or destroy it: this.world.loadScene("scenes/level2.scene.json").
Throws for a World no Engine owns.
instantiate(prefabPath, options?): GameObject;Defined in: src/engine/core/Component.ts:108
Instantiate a prefab in this component's World (ADR 0034), like GameObject.instantiate.
Use it in code that may run after an await: by then the frame is over and the current World
is the Engine's default one, which may not be this component's. A parent from another
World throws.
string
InstantiateOptions = {}
sample(x, z): WaterSample;Defined in: src/engine/render/water/WaterSurface.ts:106
The surface's height and normal at world (x, z), at the water clock's current time: the same
waves, waveScale and time the renderer draws, with the waves' sideways motion undone. The
waves continue past the edge of the drawn grid.
number
number
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference