@@ -249,7 +249,8 @@ class CameraControls {
249249
250250 const orbit = + ( this . _mode === 'orbit' ) ;
251251 const fly = + ( this . _mode === 'fly' ) ;
252- const pan = + ( this . _state . touches > 1 ) ;
252+ const double = + ( this . _state . touches > 1 ) ;
253+ const pan = this . _state . mouse [ 2 ] || + ( button [ 2 ] === - 1 ) || double ;
253254 const distance = this . _pose . distance ;
254255
255256 const { deltas } = frame ;
@@ -259,7 +260,7 @@ class CameraControls {
259260 const keyMove = this . _state . axis . clone ( ) . normalize ( ) ;
260261 v . add ( keyMove . mulScalar ( fly * this . moveSpeed * ( this . _state . shift ? 2 : this . _state . ctrl ? 0.5 : 1 ) * dt ) ) ;
261262 const panMove = screenToWorld ( this . _camera , mouse [ 0 ] , mouse [ 1 ] , distance ) ;
262- v . add ( panMove . mulScalar ( this . _state . mouse [ 2 ] ) ) ;
263+ v . add ( panMove . mulScalar ( pan ) ) ;
263264 const wheelMove = new Vec3 ( 0 , 0 , - wheel [ 0 ] ) ;
264265 v . add ( wheelMove . mulScalar ( this . wheelSpeed * dt ) ) ;
265266 // FIXME: need to flip z axis for orbit camera
@@ -268,7 +269,7 @@ class CameraControls {
268269 // desktop rotate
269270 v . set ( 0 , 0 , 0 ) ;
270271 const mouseRotate = new Vec3 ( mouse [ 0 ] , mouse [ 1 ] , 0 ) ;
271- v . add ( mouseRotate . mulScalar ( ( 1 - this . _state . mouse [ 2 ] ) * this . orbitSpeed * dt ) ) ;
272+ v . add ( mouseRotate . mulScalar ( ( 1 - pan ) * this . orbitSpeed * dt ) ) ;
272273 deltas . rotate . append ( [ v . x , v . y , v . z ] ) ;
273274
274275 // mobile move
@@ -278,7 +279,7 @@ class CameraControls {
278279 const flyMove = new Vec3 ( leftInput [ 0 ] , 0 , - leftInput [ 1 ] ) ;
279280 v . add ( flyMove . mulScalar ( fly * this . moveSpeed * this . touchSensitivity * dt ) ) ;
280281 const pinchMove = new Vec3 ( 0 , 0 , pinch [ 0 ] ) ;
281- v . add ( pinchMove . mulScalar ( orbit * pan * this . pinchSpeed * dt ) ) ;
282+ v . add ( pinchMove . mulScalar ( orbit * double * this . pinchSpeed * dt ) ) ;
282283 deltas . move . append ( [ v . x , v . y , v . z ] ) ;
283284
284285 // mobile rotate
0 commit comments