TerrainTile

open class TerrainTile(sector: Sector, level: Level, row: Int, column: Int) : Tile

Represents a portion of a globe's terrain. Applications typically do not interact directly with this class.

Constructors

Link copied to clipboard
constructor(sector: Sector, level: Level, row: Int, column: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val column: Int

The tile's column within its level.

Link copied to clipboard
open override val heightLimits: FloatArray
Link copied to clipboard

The level at which this tile lies within a LevelSet.

Link copied to clipboard

Tile-local bounds of points incl. skirt border (minX, maxX, minY, maxY, minZ, maxZ), refreshed with the point grid. Lets BasicTerrain.intersect reject tiles without walking their triangle strip. Unbounded until the first prepare so the tile is never wrongly rejected.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val row: Int

The tile's row within its level.

Link copied to clipboard

The sector spanned by this tile.

Link copied to clipboard
Link copied to clipboard

A key that uniquely identifies this tile within a level set. Tile keys are not unique to a specific level set.

Functions

Link copied to clipboard

Distance from this tile's nearest point to the camera, cached per camera position and elevation timestamp so the fog cull and the subdivision test share one computation per frame. 3D globes only - offset (2D continuous) globes reposition tiles without moving the camera point.

Link copied to clipboard
Link copied to clipboard

Smooth per-vertex terrain normals for relief shading, derived from the Cartesian point grid by clamped central differences. The skirt ring copies its interior edge normal so skirt walls shade like the rim. Computed lazily on first request after a point update.

Link copied to clipboard
Link copied to clipboard

Indicates whether this tile's Cartesian extent intersects a frustum.

Link copied to clipboard

Indicates whether this tile intersects a specified sector.

Link copied to clipboard

Indicates whether this tile is entirely past full fog saturation and can be culled from assembly. Tall tiles are kept while their peaks can still rise above the horizon (line of sight reaches the camera horizon plus the peak's own horizon distance), so mountain ranges visible beyond the geometric horizon never vanish. Assumes height limits were refreshed this frame - the assembly gates test intersectsFrustum first, which does that.

Link copied to clipboard
open fun mustSubdivide(rc: RenderContext, detailFactor: Double): Boolean

Indicates whether this tile should be subdivided based on the current navigation state and a specified detail factor.

Link copied to clipboard
open fun prepare(rc: RenderContext)
Link copied to clipboard
open fun subdivide(tileFactory: TileFactory): Array<Tile>

Returns the four children formed by subdividing this tile. This tile's sector is subdivided into four quadrants as follows: Southwest; Southeast; Northwest; Northeast. A new tile is then constructed for each quadrant and configured with the next level within this tile's LevelSet and its corresponding row and column within that level. This returns null if this tile's level is the last level within its LevelSet.

Link copied to clipboard
open fun subdivideToCache(tileFactory: TileFactory, cache: LruMemoryCache<String, Array<Tile>>, cacheSize: Int): Array<Tile>

Returns the four children formed by subdividing this tile, drawing those children from a specified cache. The cache is checked for a child collection prior to subdividing. If one exists in the cache it is returned rather than creating a new collection of children. If a new collection is created in the same manner as subdivide and added to the cache.