38class CESIUM3DTILESSELECTION_API
Tileset final {
50 std::unique_ptr<TilesetContentLoader>&& pCustomLoader,
51 std::unique_ptr<Tile>&& pRootTile,
62 const std::string& url,
79 const std::string& ionAccessToken,
81 const std::string& ionAssetEndpointUrl =
"https://api.cesium.com/");
114 CesiumAsync::SharedFuture<
void>& getAsyncDestructionCompleteEvent();
132 void setShowCreditsOnScreen(
bool showCreditsOnScreen) noexcept;
145 return this->_externals;
153 return this->_asyncSystem;
158 return this->_asyncSystem;
173 return this->_options.ellipsoid;
178 return this->_options.ellipsoid;
189 const
Tile* getRootTile() const noexcept;
231 updateView(const
std::vector<
ViewState>& frustums,
float deltaTime = 0.0f);
236 int32_t getNumberOfTilesLoaded() const;
242 float computeLoadProgress() noexcept;
249 void forEachLoadedTile(const
std::function<
void(
Tile& tile)>& callback);
256 void forEachLoadedTile(
257 const
std::function<
void(const
Tile& tile)>& callback) const;
263 int64_t getTotalDataBytes() const noexcept;
341 struct TraversalDetails {
349 bool allAreRenderable =
true;
360 bool anyWereRenderedLastFrame =
false;
380 uint32_t notYetRenderableCount = 0;
391 const std::vector<ViewState>& frustums;
392 std::vector<double> fogDensities;
393 int32_t lastFrameNumber;
394 int32_t currentFrameNumber;
397 TraversalDetails _renderLeaf(
398 const FrameState& frameState,
401 ViewUpdateResult& result);
402 TraversalDetails _renderInnerTile(
403 const FrameState& frameState,
405 ViewUpdateResult& result);
406 bool _kickDescendantsAndRenderTile(
407 const FrameState& frameState,
409 ViewUpdateResult& result,
410 TraversalDetails& traversalDetails,
411 size_t firstRenderedDescendantIndex,
412 size_t workerThreadLoadQueueIndex,
413 size_t mainThreadLoadQueueIndex,
415 double tilePriority);
417 _checkOcclusion(
const Tile& tile,
const FrameState& frameState);
419 TraversalDetails _visitTile(
420 const FrameState& frameState,
423 bool ancestorMeetsSse,
426 ViewUpdateResult& result);
430 bool shouldVisit =
true;
438 const FrameState& frameState,
439 bool cullWithChildrenBounds,
440 CullResult& cullResult);
442 const FrameState& frameState,
443 const std::vector<double>& distances,
444 CullResult& cullResult);
446 const std::vector<ViewState>& frustums,
448 const std::vector<double>& distances,
449 bool culled)
const noexcept;
451 TraversalDetails _visitTileIfNeeded(
452 const FrameState& frameState,
454 bool ancestorMeetsSse,
456 ViewUpdateResult& result);
457 TraversalDetails _visitVisibleChildrenNearToFar(
458 const FrameState& frameState,
460 bool ancestorMeetsSse,
462 ViewUpdateResult& result);
479 bool _loadAndRenderAdditiveRefinedTile(
481 ViewUpdateResult& result,
485 void _processWorkerThreadLoadQueue();
486 void _processMainThreadLoadQueue();
488 void _clearChildrenRecursively(Tile* pTile)
noexcept;
489 void _unloadCachedTiles(
double timeBudget)
noexcept;
490 void _markTileVisited(Tile& tile)
noexcept;
492 void _updateLodTransitions(
493 const FrameState& frameState,
495 ViewUpdateResult& result)
const noexcept;
497 TilesetExternals _externals;
500 TilesetOptions _options;
502 int32_t _previousFrameNumber;
503 ViewUpdateResult _updateResult;
505 enum class TileLoadPriorityGroup {
526 struct TileLoadTask {
539 TileLoadPriorityGroup group;
548 bool operator<(
const TileLoadTask& rhs)
const noexcept {
549 if (this->group == rhs.group)
550 return this->priority < rhs.priority;
552 return this->group > rhs.group;
556 std::vector<TileLoadTask> _mainThreadLoadQueue;
557 std::vector<TileLoadTask> _workerThreadLoadQueue;
558 std::vector<Tile*> _heightQueryLoadQueue;
560 Tile::LoadedLinkedList _loadedTiles;
564 std::vector<double> _distances;
568 std::vector<const TileOcclusionRendererProxy*> _childOcclusionProxies;
571 _pTilesetContentManager;
573 std::list<TilesetHeightRequest> _heightRequests;
575 void addTileToLoadQueue(
577 TileLoadPriorityGroup priorityGroup,
580 static TraversalDetails createTraversalDetailsForSingleTile(
581 const FrameState& frameState,
583 const TileSelectionState& lastFrameSelectionState);