color? |
ColorRepresentation |
"#ffffff" |
The foam’s tint, set on the engine’s material before material is handed it. |
emitting? |
boolean |
true |
Whether it lays new foam; false lets what it laid fade, and the next stretch starts apart from it. |
ground? |
Entity |
undefined |
The ground of the Landscape whose sea to read, as useLandscapeEntity or spawnGround returns it: needed only where two Landscapes stand. Left out, the world’s one. |
lifetimeSeconds? |
number |
3 |
Seconds a stretch of the wake lasts, fading out over them, above 1/60 s. |
material? |
ModelMaterial |
the engine's material as it is |
The game’s function over the engine’s material, a lit MeshLambertMaterial holding the foam’s texture, as the sea’s material is: it returns it patched, or a material of the game’s in its place, such as an unlit MeshBasicMaterial with a texture of its own. The wake writes its fade in the vertex colour’s alpha, and lays its texture with u from 0 to 1 across and v along the water, a repeat each textureLength metres. So a long voyage keeps it fine, v drops now and then by the fewest whole repeats, up to 1,024, over which every map the material reads on it repeats, by its repeat, rotation and wrap, so none moves; where none does, such as a clamped map, a ShaderMaterial or a shader patched through onBeforeCompile, v keeps its count. So a material of the game’s sets vertexColors and transparent to fade, and a texture of its own repeats along v. Its second texture coordinate, uv1, holds the same u and, as v, each stretch’s normalized age, the share of lifetimeSeconds it has lived, as a WakeCurve key’s share reads it: a map with channel 1 reads it, such as white water at the stern that thins behind. It lays an up normal and a tangent along u, handed to the coordinate the normal map reads, so a material with a normalMap shades. Define the function once, outside a component: each new function is asked again. The engine frees its own material and never the game’s. |
maxStepDistance? |
number |
10 |
Metres the stern may move in one frame and still lay one strip: a longer step, such as a teleport, ends the strip and starts the next where it landed. Give the wake a new React key to clear it after a shorter one. |
minSpeed? |
number |
0.5 |
Metres a second the stern must move to lay foam, so a moored boat rocking at its berth lays none. |
minVertexDistance? |
number |
0.25 |
Metres the stern moves between two points the wake lays. It lays at most 60 points a second, so a stern faster than 60 times this lays them further apart, and a short-lived wake lays them nearer, as far as the stern goes in a quarter of its life. |
opacity? |
number |
0.9 |
The foam’s opacity at the stern, from 0 to 1. |
opacityCurve? |
WakeCurve |
[{ share: 0, value: 1 }, { share: 1, value: 0 }], a fade to nothing |
× opacity over each stretch’s life, from 0 to 1. |
position? |
Vector3Tuple |
[0, 0, 0] |
Metres from the object it is mounted under, in that object’s own axes, such as a boat’s stern on its waterline. |
spreadSpeed? |
number |
1.5 |
Metres a second the wake widens behind the stern, half to each side, so it spreads into a V; 0 keeps it as wide as it was laid. |
textureLength? |
number |
4 |
Metres along the water the foam’s pattern repeats over. |
width? |
number |
1 |
Metres across the wake where it leaves the stern. |
widthCurve? |
WakeCurve |
[{ share: 0, value: 1 }], the width as it is |
× the width, width and spreadSpeed’s, over each stretch’s life, such as [{ share: 0, value: 0 }, { share: 0.2, value: 1 }] for a wake that opens from a point at the stern. Values from 0 up; 0 pinches the wake. |