SpatialTerrainGeometry

class SpatialTerrainGeometry(source: SpatialHeightGrid, val transform: SpatialModelTransform, skirtDepth: Float = DEFAULT_SKIRT_DEPTH)(source)

The terrain mesh plus the height field it was built from, in model units. The mesh is a disk inscribed in the box: a regular grid with the vertices outside the circle moved onto it, and a round skirt below the edge so the model reads as a solid table. Buffers are flat: positions and normals hold xyz triples, textureCoordinates uv pairs.

Constructors

Link copied to clipboard
constructor(source: SpatialHeightGrid, transform: SpatialModelTransform, skirtDepth: Float = DEFAULT_SKIRT_DEPTH)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Row-major ground heights in model units (y).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Height of the highest point on the map's edge, in model units, so the bezel can stand above it.

Link copied to clipboard
val rows: Int
Link copied to clipboard

Vertices on the top of the skirt, copies of the surface's edge; the same number again sit below them.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun groundHeight(coordinate: LatLon): Float

Ground height (model units) under a coordinate, clamped to the box.

Link copied to clipboard
fun overlaySurface(lift: Float = OVERLAY_LIFT): SpatialOverlayMesh

The top surface alone, raised by lift, for an overlay drawn over the terrain with the same texture coordinates. The skirt's vertices and triangles come after the surface's, so the first columns * rows vertices and surfaceTriangleCount triangles are the surface.

Link copied to clipboard
fun surfacePosition(coordinate: LatLon, clearance: Float = 0.0f): Vec3

Where to put something that sits on the ground at a coordinate.