From d0789a61330ac57b759c93c76ff7a82f96af1e05 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Sat, 20 Feb 2021 15:47:09 +0100 Subject: [PATCH] Fix more Hammer imports --- src/controls/freeflight/FreeFlightControls.js | 4 ++-- src/controls/map/MapControls.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/controls/freeflight/FreeFlightControls.js b/src/controls/freeflight/FreeFlightControls.js index 519a2fa..80c0881 100644 --- a/src/controls/freeflight/FreeFlightControls.js +++ b/src/controls/freeflight/FreeFlightControls.js @@ -24,7 +24,7 @@ */ import {MathUtils, Vector2} from "three"; -import {Manager} from "hammerjs"; +import {Manager, Pan, DIRECTION_ALL} from "hammerjs"; import {animate, EasingFunctions} from "../../util/Utils"; import {KeyMoveControls} from "./keyboard/KeyMoveControls"; import {MouseRotateControls} from "./mouse/MouseRotateControls"; @@ -129,7 +129,7 @@ export class FreeFlightControls { } initializeHammer() { - let touchMove = new Hammer.Pan({ event: 'move', pointers: 1, direction: Hammer.DIRECTION_ALL, threshold: 0 }); + let touchMove = new Pan({ event: 'move', pointers: 1, direction: DIRECTION_ALL, threshold: 0 }); this.hammer.add(touchMove); } diff --git a/src/controls/map/MapControls.js b/src/controls/map/MapControls.js index c3d79c5..b205d43 100644 --- a/src/controls/map/MapControls.js +++ b/src/controls/map/MapControls.js @@ -28,7 +28,7 @@ import {MouseZoomControls} from "./mouse/MouseZoomControls"; import {MouseRotateControls} from "./mouse/MouseRotateControls"; import {MouseAngleControls} from "./mouse/MouseAngleControls"; import {MathUtils, Vector2} from "three"; -import {Manager} from "hammerjs"; +import {Manager, Pan, Pinch, Rotate, Tap, DIRECTION_ALL, DIRECTION_VERTICAL} from "hammerjs"; import {animate, EasingFunctions, softClamp} from "../../util/Utils"; import {MapHeightControls} from "./MapHeightControls"; import {KeyMoveControls} from "./keyboard/KeyMoveControls"; @@ -244,11 +244,11 @@ export class MapControls { } initializeHammer() { - let touchTap = new Hammer.Tap({ event: 'tap', pointers: 1, taps: 1, threshold: 2 }); - let touchMove = new Hammer.Pan({ event: 'move', pointers: 1, direction: Hammer.DIRECTION_ALL, threshold: 0 }); - let touchTilt = new Hammer.Pan({ event: 'tilt', pointers: 2, direction: Hammer.DIRECTION_VERTICAL, threshold: 0 }); - let touchRotate = new Hammer.Rotate({ event: 'rotate', pointers: 2, threshold: 0 }); - let touchZoom = new Hammer.Pinch({ event: 'zoom', pointers: 2, threshold: 0 }); + let touchTap = new Tap({ event: 'tap', pointers: 1, taps: 1, threshold: 2 }); + let touchMove = new Pan({ event: 'move', pointers: 1, direction: DIRECTION_ALL, threshold: 0 }); + let touchTilt = new Pan({ event: 'tilt', pointers: 2, direction: DIRECTION_VERTICAL, threshold: 0 }); + let touchRotate = new Rotate({ event: 'rotate', pointers: 2, threshold: 0 }); + let touchZoom = new Pinch({ event: 'zoom', pointers: 2, threshold: 0 }); touchMove.recognizeWith(touchRotate); touchMove.recognizeWith(touchTilt);