Renderer · interface

WindProfile

One wind, sampled by everything that moves in it.

Explained in Hello world.

interface WindProfile
import 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

NameTypeDescription
directionXnumberPrevailing direction; normalised on sampling, so any non-zero pair works.
directionZnumber
baseSpeednumberSpeed with no gust, in metres per second.
gustSpeednumberPeak deviation from the base, either way.
directionWandernumberHow far the direction swings from prevailing, radians.
cycleSecondsnumberPeriod after which the whole signal repeats exactly.
phasenumberOffset into the cycle, so two profiles are not in lockstep.