UNPKG

@pmndrs/pointer-events

Version:

framework agnostic pointer-events implementation for threejs

7 lines (6 loc) 465 B
import { generateUniquePointerId } from './index.js'; import { SphereIntersector } from '../intersections/sphere.js'; import { Pointer } from '../pointer.js'; export function createGrabPointer(getCamera, space, pointerState, options = {}, pointerType = 'grab') { return new Pointer(generateUniquePointerId(), pointerType, pointerState, new SphereIntersector(space, () => options.radius ?? 0.07, options), getCamera, undefined, undefined, undefined, options); }