Skip to content

API Interface WaterEventSurface

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

Interface: WaterEventSurface

Defined in: src/engine/core/waterEvents.ts:12

The water surface an event happened on: a WaterSurface (merged in by the water domain).

Extends

Properties

contactFoam

contactFoam: number = 0.4;

Defined in: src/engine/render/water/WaterSurface.ts:102

Foam where things not in the shore map (hulls, moving bodies) meet the water, within this many metres of the scene's depth (ADR 0663 §2; 0: none). Medium and high water quality only.

Inherited from

WaterSurface.contactFoam


deepColor

deepColor: Color;

Defined in: src/engine/render/water/WaterSurface.ts:62

Colour looking straight down into the water and in troughs.

Inherited from

WaterSurface.deepColor


depthMap

depthMap: string = "";

Defined in: src/engine/render/water/WaterSurface.ts:93

The baked shore map (ADR 0663 §2, asset kind "waterDepth"): the depth to the ground and the distance to the shore over the surface, and the wall points waves throw spray off. It makes waves shoal and break into surf, lays foam along shores and makes wake ripples bounce off walls. Made by the inspector's "Bake shoreline"; empty: open water.

Inherited from

WaterSurface.depthMap


farWakes

farWakes: boolean = true;

Defined in: src/engine/render/water/WaterSurface.ts:87

Draw wakes beyond the field as trails along their sterns' paths (ADR 0459's far LOD; how many: the water quality's farWakes). Off, wakes end at the field's edge. The World's first enabled surface decides it, as with interaction.

Inherited from

WaterSurface.farWakes


foamAmount

foamAmount: number = 0.5;

Defined in: src/engine/render/water/WaterSurface.ts:67

0 (none) to 1: how readily foam forms where crests fold.

Inherited from

WaterSurface.foamAmount


foamColor

foamColor: Color;

Defined in: src/engine/render/water/WaterSurface.ts:65

Inherited from

WaterSurface.foamColor


impactEffect

impactEffect: string = "";

Defined in: src/engine/render/water/WaterSurface.ts:106

The particle effect played where waves strike a wall or a hull (ADR 0663 §3); empty: the engine's own spray.

Inherited from

WaterSurface.impactEffect


interaction

interaction: WaterInteraction = "auto";

Defined in: src/engine/render/water/WaterSurface.ts:82

How much the water reacts to what is in it (ADR 0663 §4): the wake field around the camera that WaterWake hulls and moving bodies press into, splash and impact spray, and contact foam. "auto" follows the graphics tier's water quality; "low", "medium" and "high" fix it; "off" turns them all off. The World's first enabled surface decides it for every surface. Shoaling and shore foam from depthMap don't follow it: buoyancy mustn't change with settings. (Replaces ADR 0459's wakeMode; older scenes load "off" as "off" and its other values as "auto".)

Inherited from

WaterSurface.interaction


normalDetail

normalDetail: number = 0.5;

Defined in: src/engine/render/water/WaterSurface.ts:69

Strength of the scrolling ripple normals on top of the waves (0 = none).

Inherited from

WaterSurface.normalDetail


opacity

opacity: number = 1;

Defined in: src/engine/render/water/WaterSurface.ts:72

Below 1 the surface is drawn transparent.

Inherited from

WaterSurface.opacity


reflectivity

reflectivity: number = 0.5;

Defined in: src/engine/render/water/WaterSurface.ts:74

Strength of the Fresnel reflection of the environment (0–1).

Inherited from

WaterSurface.reflectivity


resolution

resolution: number = 128;

Defined in: src/engine/render/water/WaterSurface.ts:56

Vertices per side (2–1024). Quality tiers with the "low" shader level use half.

Inherited from

WaterSurface.resolution


roughness

roughness: number = 0.08;

Defined in: src/engine/render/water/WaterSurface.ts:70

Inherited from

WaterSurface.roughness


shallowColor

shallowColor: Color;

Defined in: src/engine/render/water/WaterSurface.ts:64

Colour at grazing angles and on crests.

Inherited from

WaterSurface.shallowColor


shoreFoam

shoreFoam: number = 1.5;

Defined in: src/engine/render/water/WaterSurface.ts:97

Foam along the shore line, out to this many metres from it (ADR 0663 §2; 0: none). Needs depthMap.

Inherited from

WaterSurface.shoreFoam


shoreResolution

shoreResolution: number = 256;

Defined in: src/engine/render/water/WaterSurface.ts:95

Texels per side of the shore map when it is baked (ADR 0663 §2).

Inherited from

WaterSurface.shoreResolution


size

size: number = 100;

Defined in: src/engine/render/water/WaterSurface.ts:54

Side of the square grid, in the node's local units.

Inherited from

WaterSurface.size


splashEffect

splashEffect: string = "";

Defined in: src/engine/render/water/WaterSurface.ts:104

The particle effect played where something falls into the water (ADR 0663 §3); empty: the engine's own splash.

Inherited from

WaterSurface.splashEffect


waves

waves: WaterWave[];

Defined in: src/engine/render/water/WaterSurface.ts:58

Up to 8 waves: direction (degrees, 0 = +X), wavelength, steepness 0–1, speed (0: deep-water speed; negative: backward).

Inherited from

WaterSurface.waves


waveScale

waveScale: number = 1;

Defined in: src/engine/render/water/WaterSurface.ts:60

Multiplies every wave's amplitude; raise it at runtime for a storm.

Inherited from

WaterSurface.waveScale

Accessors

enabled

Get Signature

get enabled(): boolean;

Defined in: src/engine/core/Component.ts:63

Returns

boolean

Set Signature

set enabled(value): void;

Defined in: src/engine/core/Component.ts:67

Parameters
value

boolean

Returns

void

Inherited from

WaterSurface.enabled


gameObject

Get Signature

get gameObject(): GameObject;

Defined in: src/engine/core/Component.ts:43

Unity-style alias for node.

Returns

GameObject

Inherited from

WaterSurface.gameObject


isActiveAndEnabled

Get Signature

get isActiveAndEnabled(): boolean;

Defined in: src/engine/core/Component.ts:74

True when enabled, the node is active in the hierarchy, and the node is in a loaded world.

Returns

boolean

Inherited from

WaterSurface.isActiveAndEnabled


node

Get Signature

get node(): GameObject;

Defined in: src/engine/core/Component.ts:38

The node this component is on.

Returns

GameObject

Inherited from

WaterSurface.node


owner

Get Signature

get owner(): GameObject;

Defined in: src/engine/core/Component.ts:51

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).

Returns

GameObject

Inherited from

WaterSurface.owner


time

Get Signature

get time(): Readonly<TimeState>;

Defined in: src/engine/core/Component.ts:99

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).

Returns

Readonly<TimeState>

Inherited from

WaterSurface.time


transform

Get Signature

get transform(): Transform;

Defined in: src/engine/core/Component.ts:57

The Transform of the node this component is on, if it has one.

Returns

Transform

Inherited from

WaterSurface.transform


world

Get Signature

get world(): WorldHandle;

Defined in: src/engine/core/Component.ts:88

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.

Returns

WorldHandle

Inherited from

WaterSurface.world

Methods

instantiate()

instantiate(prefabPath, options?): GameObject;

Defined in: src/engine/core/Component.ts:109

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.

Parameters

prefabPath

string

options?

InstantiateOptions = {}

Returns

GameObject

Inherited from

WaterSurface.instantiate


sample()

sample(x, z): WaterSample;

Defined in: src/engine/render/water/WaterSurface.ts:144

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.

Parameters

x

number

z

number

Returns

WaterSample

Inherited from

WaterSurface.sample

Clone this wiki locally