@realsee/five
Version:
Realsee Renderer SDK
61 lines (60 loc) • 2.78 kB
TypeScript
import type { Tileset } from './tileset';
import type { Tile } from './tile';
import type { FrameState } from './types';
import { TilesetBaseTraverser } from './tileset-base-traverser';
declare class TilesetSkipTraverser extends TilesetBaseTraverser {
private baseScreenSpaceError;
private skipScreenSpaceErrorFactor;
private skipLevels;
private _traversalStack;
private _descendantTraversalStack;
private _selectionTraversalStack;
private _selectionTraversalancestorStack;
constructor(tileset: Tileset);
traverse(root: Tile, frameState: FrameState, cacheFrameStates?: FrameState[]): void;
reset(): void;
private executeTraversal;
private updateAndPushChildren;
private selectDesiredTile;
/**
* Mark descendant tiles for rendering, and update as needed
*/
private selectDescendants;
/**
* Determine if a tile has reached the limit of level of detail skipping.
* If so, it should _not_ be skipped: it should be loaded and rendered
*
* @private
* @param {Cesium3DTileset} tileset
* @param {Cesium3DTile} tile
* @returns {boolean} true if this tile should not be skipped
*/
private reachedSkippingThreshold;
/**
* Update links to the ancestor tiles that have content
*/
private updateTileAncestorContentLinks;
/**
* Determine if a tile is part of the base traversal.
* If not, this tile could be considered for level of detail skipping
*/
private inBaseTraversal;
/**
* Traverse the tree and check if their selected frame is the current frame. If so, add it to a selection queue.
* This is a preorder traversal so children tiles are selected before ancestor tiles.
*
* The reason for the preorder traversal is so that tiles can easily be marked with their
* selection depth. A tile's _selectionDepth is its depth in the tree where all non-selected tiles are removed.
* This property is important for use in the stencil test because we want to render deeper tiles on top of their
* ancestors. If a tileset is very deep, the depth is unlikely to fit into the stencil buffer.
*
* We want to select children before their ancestors because there is no guarantee on the relationship between
* the children's z-depth and the ancestor's z-depth. We cannot rely on Z because we want the child to appear on top
* of ancestor regardless of true depth. The stencil tests used require children to be drawn first.
*
* NOTE: 3D Tiles uses 3 bits from the stencil buffer meaning this will not work when there is a chain of
* selected tiles that is deeper than 7. This is not very likely.
*/
private traverseAndSelect;
}
export { TilesetSkipTraverser };