Download node_modules/three/examples/jsm/controls/MapControls.js from SimWorld-AI/industrial-harbor-viewer: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/examples/jsm/controls/MapControls.js
- Command line
-
hf download hf://spaces/SimWorld-AI/industrial-harbor-viewer/node_modules/three/examples/jsm/controls/MapControls.js
-
curl -L -o MapControls.js https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/examples/jsm/controls/MapControls.js
863 Bytes
| import { MOUSE, TOUCH } from 'three'; | |
| import { OrbitControls } from './OrbitControls.js'; | |
| // MapControls performs orbiting, dollying (zooming), and panning. | |
| // Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default). | |
| // | |
| // Orbit - right mouse, or left mouse + ctrl/meta/shiftKey / touch: two-finger rotate | |
| // Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish | |
| // Pan - left mouse, or arrow keys / touch: one-finger move | |
| class MapControls extends OrbitControls { | |
| constructor( object, domElement ) { | |
| super( object, domElement ); | |
| this.screenSpacePanning = false; // pan orthogonal to world-space direction camera.up | |
| this.mouseButtons = { LEFT: MOUSE.PAN, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.ROTATE }; | |
| this.touches = { ONE: TOUCH.PAN, TWO: TOUCH.DOLLY_ROTATE }; | |
| } | |
| } | |
| export { MapControls }; | |