function getBoundingVolume(tile, frameState) {
  if (
    frameState.mode !== SceneMode.SCENE3D &&
    !defined(tile._boundingVolume2D)
  ) {
    const boundingSphere = tile._boundingVolume.boundingSphere;
    const sphere = BoundingSphere.projectTo2D(
      boundingSphere,
      frameState.mapProjection,
      scratchProjectedBoundingSphere,
    );
    tile._boundingVolume2D = new TileBoundingSphere(
      sphere.center,
      sphere.radius,
    );
  }

  return frameState.mode !== SceneMode.SCENE3D
    ? tile._boundingVolume2D
    : tile._boundingVolume;
}
@private
@param {Cesium3DTile} tile
@param {FrameState} frameState
@returns {TileBoundingVolume}