handleTouchMovePan method

dynamic handleTouchMovePan(
  1. dynamic event
)

Implementation

handleTouchMovePan(event) {
  if (pointers.length == 1) {
    panEnd.set(event.pageX, event.pageY);
  } else {
    var position = getSecondPointerPosition(event);

    var x = 0.5 * (event.pageX + position.x);
    var y = 0.5 * (event.pageY + position.y);

    panEnd.set(x, y);
  }

  panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed);

  pan(panDelta.x, panDelta.y);

  panStart.copy(panEnd);
}