From c0211c98d599360f2e1b663e6954016c2ff4121a Mon Sep 17 00:00:00 2001 From: yosi <48201022+yosipy@users.noreply.github.com> Date: Tue, 3 Jan 2023 08:08:43 +0900 Subject: [PATCH] fix: mouseButtons and touches allow undefined in OrbitControls (#220) --- src/controls/OrbitControls.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/controls/OrbitControls.ts b/src/controls/OrbitControls.ts index 6a0382e5..9e0b7328 100644 --- a/src/controls/OrbitControls.ts +++ b/src/controls/OrbitControls.ts @@ -67,13 +67,20 @@ class OrbitControls extends EventDispatcher { // The four arrow keys keys = { LEFT: 'ArrowLeft', UP: 'ArrowUp', RIGHT: 'ArrowRight', BOTTOM: 'ArrowDown' } // Mouse buttons - mouseButtons = { + mouseButtons: Partial<{ + LEFT: MOUSE + MIDDLE: MOUSE + RIGHT: MOUSE + }> = { LEFT: MOUSE.ROTATE, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.PAN, } // Touch fingers - touches = { ONE: TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN } + touches: Partial<{ + ONE: TOUCH + TWO: TOUCH + }> = { ONE: TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN } target0: Vector3 position0: Vector3 zoom0: number