update method

dynamic update()

Implementation

update() {
  _eye.subVectors(scope.object.position, scope.target);

  if (!scope.noRotate) {
    scope.rotateCamera();
  }

  if (!scope.noZoom) {
    scope.zoomCamera();
  }

  if (!scope.noPan) {
    scope.panCamera();
  }

  scope.object.position.addVectors(scope.target, _eye);

  if (scope.object is PerspectiveCamera) {
    scope.checkDistances();

    scope.object.lookAt(scope.target);

    if (lastPosition.distanceToSquared(scope.object.position) > EPS) {
      scope.dispatchEvent(_changeEvent);

      lastPosition.copy(scope.object.position);
    }
  } else if (scope.object is OrthographicCamera) {
    scope.object.lookAt(scope.target);

    if (lastPosition.distanceToSquared(scope.object.position) > EPS ||
        lastZoom != scope.object.zoom) {
      scope.dispatchEvent(_changeEvent);

      lastPosition.copy(scope.object.position);
      lastZoom = scope.object.zoom;
    }
  } else {
    print('THREE.TrackballControls: Unsupported camera type');
  }
}