PointMemo

open class PointMemo

Per-shape memo of the window-independent terms of a geographic to Cartesian conversion, reused across frames and rendering windows by point shapes (Placemark, Label).

Cached terms: the altitude-zero base point and the altitude direction (every projection is linear in altitude: cartesian(lat, lon, h) = base + normal * h), the global elevation model height and the geoid offset. All of them are identical for every window, so one memo per shape is correct in multi-window rendering. Terrain-clamped surface points are NOT memoized - the tessellated terrain differs per window and per LoD and is still resolved each frame.

Position and globe configuration changes are detected by value, so in-place position edits stay safe. Altitude mode handling mirrors RenderContext.geographicToCartesian (without the useEM flag, which point shapes do not use); the equivalence is pinned by PointMemoTest, which compares both paths for every altitude mode.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun geographicToCartesian(rc: RenderContext, position: Position, altitudeMode: AltitudeMode, result: Vec3): Vec3

Converts a geographic position to Cartesian coordinates according to an altitudeMode, exactly as RenderContext.geographicToCartesian does, reusing the memoized terms.

fun geographicToCartesian(rc: RenderContext, latitude: Angle, longitude: Angle, altitude: Double, altitudeMode: AltitudeMode, result: Vec3): Vec3

Converts a geographic location to Cartesian coordinates according to an altitudeMode, exactly as RenderContext.geographicToCartesian does, reusing the memoized terms.

Link copied to clipboard
fun geographicToCartesianNormal(rc: RenderContext, latitude: Angle, longitude: Angle, result: Vec3): Vec3

Provides the globe's Cartesian surface normal at a geographic location, reusing the memoized value.

Link copied to clipboard

Forgets all cached terms, forcing recomputation on next use.