Renderer · interface
WindProfile
One wind, sampled by everything that moves in it.
Explained in Hello world.
interface WindProfileimport type { WindProfile } from '@driftengine/core';In depth
Grass, foliage, smoke, clouds and water all bend to weather. If each system animates on its own noise they disagree — smoke drifting one way while grass leans another is the single clearest tell that a scene is a collection of effects rather than a place. So the signal lives here, once, and every consumer samples it.
Cyclic by construction: the sum of a fundamental and integer harmonics repeats exactly at the fundamental's period. That matters because a run is recorded and replayed — a replay watched an hour later must see the same gust the character did, and a signal that drifts cannot offer that.
Game-agnostic: a profile carries no date, no biome, no game-specific meaning.
Properties
| Name | Type | Description |
|---|---|---|
directionX | number | Prevailing direction; normalised on sampling, so any non-zero pair works. |
directionZ | number | |
baseSpeed | number | Speed with no gust, in metres per second. |
gustSpeed | number | Peak deviation from the base, either way. |
directionWander | number | How far the direction swings from prevailing, radians. |
cycleSeconds | number | Period after which the whole signal repeats exactly. |
phase | number | Offset into the cycle, so two profiles are not in lockstep. |