Renderer · interface
WaterBounds
Where a bounded body sits, how far it reaches and which way it faces.
Explained in Hello world.
interface WaterBoundsimport type { WaterBounds } from '@driftengine/core';In depth
Extents are measured along the body's own axes, x across and z along forward, which is
how addOrientedBox measures a box: one convention for an oriented thing in this engine, so a
reader who has met one has met both.
Properties
| Name | Type | Description |
|---|---|---|
centreX | number | |
centreZ | number | |
halfMoptional | number | Half-extent along both axes, metres: the shorthand for a square.MoreA pool, a tank and a puddle are square often enough to be worth one number, and this is that
number. |
halfXoptional | number | Half-extent across the body, metres. A channel is narrow in this one. |
halfZoptional | number | Half-extent along forward, metres. A channel is long in this one. |
forwardXoptional | number | Which way the body's own +z points, in world XZ. Unset, it points along world +z.MoreA direction and not an angle, because a consumer bounding a channel, a ditch or a gutter arrives holding the direction the run takes — from a road graph, a spline's tangent, two endpoints — and converting that to radians and back is arithmetic nobody needs. It is normalised on the way in, so a length here is not a scale, and a direction of no length at all is read as unturned instead of producing a sheet at NaN. |
forwardZoptional | number |