1.0.0 • Published 3 years ago
jonlo-threejs-mouse2scene v1.0.0
threejs-input-mouse2scene
Input module to get the mouse position in a threejs 3d scene,
installation
npm install threejs-input-mouse2scene
Quick Start
import { InputMouseToScene } from 'threejs-input-mouse2scene';
let inputMouse = new InputMouseToScene(this.container, this.camera, this.scene);
inputMouse.subscribe('m2sMouseDown', (params) => { this.mouseDown(params); });
inputMouse.subscribe('m2sMouseUp', (params) => { this.mouseUp(params); });
inputMouse.subscribe('m2sMouseMove', (params) => { this.mouseMove(params); });
function mouseDown(params) {
}
function mouseUp(params) {
}
function mouseMove(params) {
}
params
{
mousePosInScene: mousePosInScene,
mouseNormalized: mouseNormalized,
e: e
}
Dependencies
Classes
InputMouseToScene
Kind: global class Version: 1 Author: jon
new InputMouseToScene(container, camera)
Param | Description |
---|---|
container | the threejs scene container |
camera | the threejs camera |
1.0.0
3 years ago