InputController - Handles mouse/touch input and raycasting
This class provides a decoupled input handling system that:
The controller communicates via callbacks, making it independent from the main presenter and suitable for testing and custom implementations.
const controller = new InputController({ domElement: canvas, getCamera: () => camera, getModels: () => [model1, model2], getAnnotations: () => annotations.children, onModelDoubleClick: (point) => console.log('Clicked at', point), onAnnotationClick: (obj, isMulti) => handleAnnotationSelect(obj), onBackgroundClick: () => deselectAll()});// For creating new annotations via pickingcontroller.setPickingMode(true); Copy
const controller = new InputController({ domElement: canvas, getCamera: () => camera, getModels: () => [model1, model2], getAnnotations: () => annotations.children, onModelDoubleClick: (point) => console.log('Clicked at', point), onAnnotationClick: (obj, isMulti) => handleAnnotationSelect(obj), onBackgroundClick: () => deselectAll()});// For creating new annotations via pickingcontroller.setPickingMode(true);
Private
Helper to update mouse coordinates
InputController - Handles mouse/touch input and raycasting
This class provides a decoupled input handling system that:
The controller communicates via callbacks, making it independent from the main presenter and suitable for testing and custom implementations.
Example
See