39class CESIUM3DTILESSELECTION_API
Tileset final {
51 std::unique_ptr<TilesetContentLoader>&& pCustomLoader,
52 std::unique_ptr<Tile>&& pRootTile,
63 const std::string& url,
80 const std::string& ionAccessToken,
82 const std::string& ionAssetEndpointUrl =
"https://api.cesium.com/");
101 CesiumAsync::SharedFuture<
void>& getAsyncDestructionCompleteEvent();
119 void setShowCreditsOnScreen(
bool showCreditsOnScreen) noexcept;
132 return this->_externals;
140 return this->_asyncSystem;
145 return this->_asyncSystem;
160 return this->_options.ellipsoid;
165 return this->_options.ellipsoid;
176 const
Tile* getRootTile() const noexcept;
218 updateView(const
std::vector<
ViewState>& frustums,
float deltaTime = 0.0f);
223 int32_t getNumberOfTilesLoaded() const;
229 float computeLoadProgress() noexcept;
236 void forEachLoadedTile(const
std::function<
void(
Tile& tile)>& callback);
243 void forEachLoadedTile(
244 const
std::function<
void(const
Tile& tile)>& callback) const;
250 int64_t getTotalDataBytes() const noexcept;
325 struct TraversalDetails {
333 bool allAreRenderable =
true;
344 bool anyWereRenderedLastFrame =
false;
364 uint32_t notYetRenderableCount = 0;
375 const std::vector<ViewState>& frustums;
376 std::vector<double> fogDensities;
377 int32_t lastFrameNumber;
378 int32_t currentFrameNumber;
381 TraversalDetails _renderLeaf(
382 const FrameState& frameState,
385 ViewUpdateResult& result);
386 TraversalDetails _renderInnerTile(
387 const FrameState& frameState,
389 ViewUpdateResult& result);
390 bool _kickDescendantsAndRenderTile(
391 const FrameState& frameState,
393 ViewUpdateResult& result,
394 TraversalDetails& traversalDetails,
395 size_t firstRenderedDescendantIndex,
396 size_t workerThreadLoadQueueIndex,
397 size_t mainThreadLoadQueueIndex,
399 double tilePriority);
401 _checkOcclusion(
const Tile& tile,
const FrameState& frameState);
403 TraversalDetails _visitTile(
404 const FrameState& frameState,
407 bool ancestorMeetsSse,
410 ViewUpdateResult& result);
414 bool shouldVisit =
true;
422 const FrameState& frameState,
423 bool cullWithChildrenBounds,
424 CullResult& cullResult);
426 const FrameState& frameState,
427 const std::vector<double>& distances,
428 CullResult& cullResult);
430 const std::vector<ViewState>& frustums,
432 const std::vector<double>& distances,
433 bool culled)
const noexcept;
435 TraversalDetails _visitTileIfNeeded(
436 const FrameState& frameState,
438 bool ancestorMeetsSse,
440 ViewUpdateResult& result);
441 TraversalDetails _visitVisibleChildrenNearToFar(
442 const FrameState& frameState,
444 bool ancestorMeetsSse,
446 ViewUpdateResult& result);
463 bool _loadAndRenderAdditiveRefinedTile(
465 ViewUpdateResult& result,
469 void _processWorkerThreadLoadQueue();
470 void _processMainThreadLoadQueue();
472 void _unloadCachedTiles(
double timeBudget)
noexcept;
473 void _markTileVisited(Tile& tile)
noexcept;
475 void _updateLodTransitions(
476 const FrameState& frameState,
478 ViewUpdateResult& result)
const noexcept;
480 TilesetExternals _externals;
483 TilesetOptions _options;
485 int32_t _previousFrameNumber;
486 ViewUpdateResult _updateResult;
488 enum class TileLoadPriorityGroup {
509 struct TileLoadTask {
522 TileLoadPriorityGroup group;
531 bool operator<(
const TileLoadTask& rhs)
const noexcept {
532 if (this->group == rhs.group)
533 return this->priority < rhs.priority;
535 return this->group > rhs.group;
539 std::vector<TileLoadTask> _mainThreadLoadQueue;
540 std::vector<TileLoadTask> _workerThreadLoadQueue;
541 std::vector<Tile*> _heightQueryLoadQueue;
543 Tile::LoadedLinkedList _loadedTiles;
547 std::vector<double> _distances;
551 std::vector<const TileOcclusionRendererProxy*> _childOcclusionProxies;
554 _pTilesetContentManager;
556 std::list<TilesetHeightRequest> _heightRequests;
558 void addTileToLoadQueue(
560 TileLoadPriorityGroup priorityGroup,
563 static TraversalDetails createTraversalDetailsForSingleTile(
564 const FrameState& frameState,
566 const TileSelectionState& lastFrameSelectionState);
568 Tileset(
const Tileset& rhs) =
delete;
569 Tileset& operator=(
const Tileset& rhs) =
delete;