pointerSpeed

The pointer's speed, capped at max, as the strength of a simulation step.

pointerSpeed(opts?: {max?: number}): PointerSpeedSignal

Import signal from shaders/std and use signal.pointerSpeed.

Speed is in uv per second. A still cursor gives 0, a flick across the canvas gives a value near max. Default cap is 2.

Parameters

NameTypeNotes
opts{max?: number}Optional.

Example

op.splat({at: pointer(), amount: pointerSpeed({max: 2}), radius: p('radius')})

See also

  • pointer — The pointer's position, for a simulation step that reacts to the cursor.

Used by

CursorRipples