createHandle(opts)
Drag a point on a sphere, a plane, an axis or a dial ring, or freely in the view, with the mouse or a finger. Choose the constraint and whether it reports a POINT or a DIRECTION, place it with anchor, radius, axis or normal, and add snap, hover, a bound target or the onGrab, onChange and onRelease callbacks as needed (see the SPHERE, from: EYE and snap examples). Drive it from draw() with Handle.update() and read it with value(); needs a WEBGL canvas.
| Parameter | Type | Default | Description |
|---|---|---|---|
opts |
{
constraint: number | Object,
report?: number,
anchor?: p5.Vector | number[],
radius?: number,
axis?: p5.Vector | number[],
normal?: p5.Vector | number[],
zero?: p5.Vector | number[],
from?: *,
extent?: number[],
grabPx?: number,
snap?: number | number[],
hover?: boolean,
enabled?: boolean,
bind?: p5.Vector | number[] | { get: Function, set: Function },
drawLocus?: Function,
onGrab?: Function,
onChange?: Function,
onRelease?: Function,
onCancel?: Function,
} |
Returns Handle|null The Handle, or null on an invalid constraint.