onTouchStart method

dynamic onTouchStart(
  1. dynamic event
)

Implementation

onTouchStart(event) {
  trackPointer(event);

  switch (pointers.length) {
    case 1:
      switch (scope.touches['ONE']) {
        case TOUCH.ROTATE:
          if (scope.enableRotate == false) return;

          handleTouchStartRotate();

          state = State.touchRotate;

          break;

        case TOUCH.PAN:
          if (scope.enablePan == false) return;

          handleTouchStartPan();

          state = State.touchPan;

          break;

        default:
          state = State.none;
      }

      break;

    case 2:
      switch (scope.touches['TWO']) {
        case TOUCH.DOLLY_PAN:
          if (scope.enableZoom == false && scope.enablePan == false) return;

          handleTouchStartDollyPan();

          state = State.touchDollyPan;

          break;

        case TOUCH.DOLLY_ROTATE:
          if (scope.enableZoom == false && scope.enableRotate == false) return;

          handleTouchStartDollyRotate();

          state = State.touchDollyRotate;

          break;

        default:
          state = State.none;
      }

      break;

    default:
      state = State.none;
  }

  if (state != State.none) {
    scope.dispatchEvent(_startEvent);
  }
}