Node

Source: Node.ts:92

Quad tree planet segment node.


Constructor

new Node( segmentPrototype: Segment, quadTreeStrategy: QuadTreeStrategy, partId: number, parent: Node, id: number, tileZoom: number, extent: Extent, ): Node

Parameters

  • segmentPrototype (Segment) — Planet segment node constructor.
  • quadTreeStrategy (QuadTreeStrategy) — Quad tree strategy handler.
  • partId (number) — NorthEast, SouthWest etc.
  • parent (Node) — Parent of this node.
  • id (number) — Tree node identifier (id * 4 + 1);
  • tileZoom (number) — Deep index of the quad tree.
  • extent (Extent) — Segment extent.

Instance Methods

getEqualNeighbor(side: number): Node

Returns the same deep existent neighbour node.

Parameters

  • side (number) — Neighbour side index e.g. og.quadTree.N, og.quadTree.W etc.

Returns

getFrustumMask(cam: Camera): number

Bit mask of the camera frustums the node is in, the same test renderTree makes.

Parameters

Returns

  • number

renderViewCameraTree()

Tree traversal of a view (depth) camera, after the main camera one. While mainState is true the node state was set by the main traversal in this frame: it stops at the main rendered nodes (the strategy takes them) and goes down where the main camera went down. Elsewhere the nodes are chosen by the main camera LOD and the node state is not read anymore. It never changes the node state.

isRenderedOrFading(): boolean

Returns true if the node is rendered, or fades in or out after a level of detail change.

Returns

  • boolean

isInFadingTransition(): boolean

Returns true if the node is drawn this frame as a fading node of a level of detail change: a parent fading out after zooming in, or a child fading out after zooming out. Unlike isFading(), it also covers the fading children, whose state is NOTRENDERING.

Returns

  • boolean

addToRender()

Picking up current node to render processing.

getRenderedNodesNeighbors(frame: number)

Links the node with its neighbors of the same or lower zoom among the nodes marked with the frame. The deeper ones find this node themselves, as both sides of a pair are set by applyNeighbor.

Parameters

  • frame (number) — Neighbor search counter of the strategy.

_linkSideNeighbors()

Climbs to the node that holds both this node and the tile next to it, or to the neighbor tree when the side lies on the edge of the tree, and goes down to the tile by the mirrored path.

clearTree(keepViewCameraBranches?: boolean)

Destroys the branches the main camera does not render.

Parameters

  • keepViewCameraBranches (boolean, optional, default: false) — Keeps the branches the last view camera collection has gone through, they lead to the nodes the depth cameras render.

getCornerNeighbor( side: number, corner: number, ): Node | null | undefined

Returns the neighbor behind the side that has a corner in the same point as the corner of this node.

Parameters

  • side (number) — The side that the corner belongs to.
  • corner (number) — Corner index, NW, NE, SW or SE.

Returns

  • Node | null | undefined

getNeighborCorner(side: number, corner: number): number

Returns the corner of the neighbors behind the side that lies in the same point as the corner of this node.

Parameters

  • side (number) — The side that the corner belongs to.
  • corner (number) — Corner index, NW, NE, SW or SE.

Returns

  • number