|
16 | 16 | </ul> |
17 | 17 | </div> |
18 | 18 |
|
19 | | -<script async src="https://unpkg.com/es-module-shims@1.8.2/dist/es-module-shims.js"></script> |
| 19 | +<script async src="https://unpkg.com/es-module-shims@2.6.1/dist/es-module-shims.js"></script> |
20 | 20 | <script type="importmap"> |
21 | 21 | { |
22 | 22 | "imports": { |
23 | | - "three": "https://unpkg.com/three@0.161.0/build/three.module.js", |
24 | | - "three/addons/": "https://unpkg.com/three@0.161.0/examples/jsm/" |
| 23 | + "three": "https://unpkg.com/three@0.178.0/build/three.module.js", |
| 24 | + "three/addons/": "https://unpkg.com/three@0.178.0/examples/jsm/" |
25 | 25 | } |
26 | 26 | } |
27 | 27 | </script> |
|
44 | 44 | let lastTapTime = performance.now(); |
45 | 45 | const doubleTapTimeout = 250; |
46 | 46 | const customPointerEvent = new THREE.EventDispatcher(); |
47 | | -const detectDoubleTap = function() { |
| 47 | +const detectDoubleTap = () => { |
48 | 48 |
|
49 | 49 | const now = performance.now(); |
50 | 50 | const isDoubleTap = now - lastTapTime < doubleTapTimeout; |
|
58 | 58 | const cameraControls = new CameraControls( camera, renderer.domElement ); |
59 | 59 |
|
60 | 60 | // switch the behavior with the pointer condition |
61 | | -customPointerEvent.addEventListener( 'doubletap', function() { |
| 61 | +customPointerEvent.addEventListener( 'doubletap', () => { |
62 | 62 |
|
63 | 63 | cameraControls.mouseButtons.left = CameraControls.ACTION.ZOOM; |
64 | 64 | cameraControls.touches.one = CameraControls.ACTION.ZOOM; |
65 | 65 |
|
66 | 66 | } ); |
67 | | -customPointerEvent.addEventListener( 'tap', function() { |
| 67 | +customPointerEvent.addEventListener( 'tap', () => { |
68 | 68 |
|
69 | 69 | cameraControls.mouseButtons.left = CameraControls.ACTION.ROTATE; |
70 | 70 | cameraControls.touches.one = CameraControls.ACTION.TOUCH_ROTATE; |
|
0 commit comments