pointer
The pointer's position, for a simulation step that reacts to the cursor.
pointer(opts?: {teleportGuard?: 'on' | 'off'}): PointerSignal
Import signal from shaders/std and use signal.pointer.
The teleport guard is on by default: when the cursor jumps a long way in one frame, the jump adds no motion, so a cursor entering the canvas does not slam the simulation.
Parameters
| Name | Type | Notes |
|---|---|---|
opts | {teleportGuard?: 'on' | 'off'} | Optional. |
Example
op.splat({at: pointer({teleportGuard: 'on'}), amount: pointerSpeed({max: 2}), radius: p('radius')})
Tip. Keep the default
'on'for cursor effects. Use'off'only when a jump should count as a stroke — a pointer that is set by code rather than a real cursor, for example.
See also
pointerSpeed— The pointer's speed, capped atmax, as the strength of a simulation step.