BoundingVolume

sealed interface BoundingVolume

One of the three bounding-volume shapes defined in the 3D Tiles 1.0 spec. Each variant carries the raw spec numbers; runtime traversal works against the worldBoundingSphere conservatively wrapping the volume.

Region is world-aligned in the spec: the tile's transform matrix does NOT apply to region bounds (they're geographic). Box and Sphere are in tile-local coordinates and the world transform applies.

Inheritors

Types

Link copied to clipboard
data class Box(val centerX: Double, val centerY: Double, val centerZ: Double, val halfXx: Double, val halfXy: Double, val halfXz: Double, val halfYx: Double, val halfYy: Double, val halfYz: Double, val halfZx: Double, val halfZy: Double, val halfZz: Double) : BoundingVolume

Oriented box: ECEF center + 3 half-axis vectors. Layout per spec is [cx, cy, cz, hX.x, hX.y, hX.z, hY.x, hY.y, hY.z, hZ.x, hZ.y, hZ.z]. Coordinates are in tile-local frame; the tile-to-world transform maps them into ECEF.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Region(val west: Double, val south: Double, val east: Double, val north: Double, val minHeight: Double, val maxHeight: Double) : BoundingVolume

Geographic region: west, south, east, north (radians) + minHeight, maxHeight (meters).

Link copied to clipboard
data class Sphere(val centerX: Double, val centerY: Double, val centerZ: Double, val radius: Double) : BoundingVolume

Sphere: center + radius in tile-local frame. Tile-to-world transform applies.

Functions

Link copied to clipboard
abstract fun worldBoundingSector(globe: Globe, tileToWorld: Matrix4, result: Sector): Sector

Geographic lat/lon envelope of this volume in world space. Used for fly-to / zoom-to-extent. Naive lat/lon union — datasets straddling the antimeridian get a too-wide envelope; that's acceptable for the fly-to use case (sector defines the camera framing, not culling). Returns an empty sector for degenerate (NaN/Inf) inputs.

Link copied to clipboard
abstract fun worldBoundingSphere(globe: Globe, tileToWorld: Matrix4, result: BoundingSphere): BoundingSphere

Conservative world-space sphere used for frustum culling + nearest-point distance.