TrackballControls constructor

TrackballControls(
  1. Camera object,
  2. GlobalKey<DomLikeListenableState> listenableKey
)

Implementation

TrackballControls(this.object, this.listenableKey) : super() {
  scope = this;

  // this.domElement.style.touchAction = 'none'; // disable touch scroll

  // API

  // for reset

  target0 = target.clone();
  position0 = object.position.clone();
  up0 = object.up.clone();
  zoom0 = object.zoom;

  domElement.addEventListener('contextmenu', contextmenu);

  domElement.addEventListener('pointerdown', onPointerDown);
  domElement.addEventListener('pointercancel', onPointerCancel);
  domElement.addEventListener('wheel', onMouseWheel);

  // TODO
  // window.addEventListener( 'keydown', keydown );
  // window.addEventListener( 'keyup', keyup );

  handleResize();

  // force an update at start
  update();
}