Renderer · interface
WindField
The world's wind, as one value passed to everything that moves in it.
Explained in Hello world.
interface WindField extends WindStateimport type { WindField } from '@driftengine/core';In depth
Six draw calls each taking two or three loose floats is a contract nobody can see: the rule "everything shares one wind" lives only in the discipline of whoever writes the next call site. As a type it is checkable at a glance, and adding a seventh consumer is a matter of accepting the same object rather than remembering to pass matching numbers.
Sample once per frame and pass it down. A system that samples its own is a second wind however identical the inputs, because nothing then guarantees the two stay in step.
Properties
| Name | Type | Description |
|---|---|---|
driftX | number | Accumulated travel, for anything positioned by wind rather than displaced
by it — clouds, most obviously.MoreAccumulated rather than derived from |
driftZ | number |