onDoubleTap method

dynamic onDoubleTap(
  1. dynamic event
)

Implementation

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

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

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

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

  this.dispatchEvent(_endEvent);
}