Terrain

interface Terrain

Surface of a planet or celestial object.
Models the geometric surface defined by an ellipsoidal globe and its associated elevations. Terrain uses the Cartesian coordinate system specified by a GeographicProjection and is capable of representing both a 3D ellipsoid and a 2D map projection, though not simultaneously.

Caching Terrain Queries

Terrain implementations typically model a subset of the globe's surface at varying resolution. In this case results from the methods intersect and surfacePoint cannot be cached. Either method may fail to compute a result when the terrain surface has no geometry in the region queried, and even if computation is successful the result is based on an unknown resolution. However, if the terrain implementation is known to model a pre-determined resolution and region of interest results from the methods intersect and surfacePoint may be cached.

Inheritors

Properties

Link copied to clipboard
abstract val sector: Sector

Indicates the geographic rectangular region that contains this terrain. The returned sector may contain geographic areas where the terrain is nonexistent.

Functions

Link copied to clipboard
abstract fun heightLimits(levelNumberDepth: Int, result: FloatArray)

Computes minimal and maximal height from available tiles with tile level offset not more than specified depth

Link copied to clipboard
abstract fun intersect(line: Line, result: Vec3): Boolean

Computes the first intersection of this terrain with a specified line in Cartesian coordinates. The line is interpreted as a ray; intersection points behind the line's origin are ignored. If the line does not intersect the geometric surface modeled by this terrain, this returns false and does not modify the result argument.

Link copied to clipboard
abstract fun surfacePoint(latitude: Angle, longitude: Angle, result: Vec3): Boolean

Computes the Cartesian coordinates of a geographic location on the terrain surface. If the latitude and longitude are outside the geometric surface modeled by this terrain, this returns false and does not modify the result argument.