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.TOUCH_ROTATE;

          break;

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

          handleTouchStartPan();

          state = STATE.TOUCH_PAN;

          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.TOUCH_DOLLY_PAN;

          break;

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

          handleTouchStartDollyRotate();

          state = STATE.TOUCH_DOLLY_ROTATE;

          break;

        default:
          state = STATE.NONE;
      }

      break;

    default:
      state = STATE.NONE;
  }

  if (state != STATE.NONE) {
    scope.dispatchEvent(_startEvent);
  }
}