onDoubleTap method

dynamic onDoubleTap(
  1. dynamic event
)

Implementation

onDoubleTap(event) {
  if (enabled && enablePan && scene != null) {
    dispatchEvent(_startEvent);

    setCenter(event.clientX, event.clientY);
    var hitP = unprojectOnObj(getCursorNDC(_center.x, _center.y, domElement), camera);

    if (hitP != null && enableAnimations) {
      var self = this;
      if (_animationId != -1) {
        cancelAnimationFrame(_animationId);
      }

      _timeStart = -1;
      _animationId = requestAnimationFrame((t) {
        self.updateTbState(State2.animationFocus, true);
        self.onFocusAnim(t, hitP, self._cameraMatrixState, self._gizmoMatrixState);
      });
    } else if (hitP != null && !enableAnimations) {
      updateTbState(State2.focus, true);
      focus(hitP, scaleFactor);
      updateTbState(State2.idle, false);
      dispatchEvent(_changeEvent);
    }
  }

  dispatchEvent(_endEvent);
}