Used to register event handlers for renderable components.
Example
consteventHandler = useEventEmitter()
Remarks
The generator is an async function that process and returns data required
by your components, such as geometry for a mesh.
An optional threshold value may be provided in the register method. This is used
to weight the distance when performing GPU picking, making objects with a
higher threshold more likely to be hit. This is usually used for thin/small objects,
which may otherwise be hard to hit.
if (onPointerClick) handlers.click = onPointerClick if (onPointerEnter) handlers.enter = onPointerEnter if (onPointerLeave) handlers.leave = onPointerLeave if (onPointerMove) handlers.move = onPointerMove
if (Object.keys(handlers).length) { unregister = eventHandler.register(ref.current, handlers, id) } }
Used to register event handlers for renderable components.
Example
Remarks
The generator is an async function that process and returns data required by your components, such as geometry for a mesh.
An optional threshold value may be provided in the register method. This is used to weight the distance when performing GPU picking, making objects with a higher threshold more likely to be hit. This is usually used for thin/small objects, which may otherwise be hard to hit.
Example
See
EventEmitter