Physics · interface
ClothDevice
What moves a skinned cloth's particles: the CPU's arrays, or a GPU's buffers.
Explained in Your first game, Rigid bodies.
interface ClothDeviceimport type { ClothDevice } from '@driftengine/physics';Methods
targetsChanged
targetsChanged(change: 'posed' | 'settled' | 'consumed'): voidThe targets changed what they hold — took a pose, settled on it, or consumed the one a frame stepped toward. A device that keeps its own copy of the skinned positions follows here.
| Parameter | Type | Description |
|---|---|---|
change | 'posed' | 'settled' | 'consumed' |
rest
rest(): voidEvery particle at its latest skinned position, at rest, its step start with it.
step
step(fraction: number, blend: number): voidOne fixed step, fraction of the way from the last pose to the latest. blend is the share of
the simulation kept against the skinned pose after it, or 0 for no blend at all — not 1, which
is a real last step of a blend and is applied.
| Parameter | Type | Description |
|---|---|---|
fraction | number | |
blend | number |