Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

docs(water): surfHeight's comment within the prose limit

yhh5cba9cd7978e
diff --git a/sdk/src/water/waves.ts b/sdk/src/water/waves.ts
index ed30b7dcf..5eb649313 100644
--- a/sdk/src/water/waves.ts
+++ b/sdk/src/water/waves.ts
@@ -88,11 +88,10 @@ export function waveSlope(p: WaveParams, x: number, z: number, time: number): [n
}
/**
- * The surf: waves that run in toward the shore across the last `4 * length` of water, steepen and break on it, and run up the ground past
- * it. `shore` is the distance to the shore (above zero on the water), `height` how high a breaker stands at most; the crests are lines
- * of `phase` (by default the shore distance; a zone's is that smoothed, so they come in straight from open water). Each has a steep face
- * toward the shore and a long back, and they travel at the speed of a deep-water wave of their length times `speed`. The Water shader
- * draws the same.
+ * The surf: waves that run in across the last `4 * length` of water, break on the shore and run up past it. `shore` is the distance to
+ * the shore (above zero on the water), `height` a breaker's most; the crests are lines of `phase` (a zone's is the shore's, smoothed,
+ * so they come in straight). Each has a steep face shoreward and a long back, at a deep-water wave's speed for their length times
+ * `speed`. The Water shader draws the same.
*/
export function surfHeight(shore: number, height: number, length: number, speed: number, time: number, phase = shore): number {
if (height <= 0 || length <= 0) return 0;