Class ElevationBasedClipPlanesEvaluatorAbstract

Abstract evaluator class that adds support for elevation constraints.

Remarks

Classes derived from this should implement algorithms that takes into account rendered features height (elevations), such as ground plane is no more flat (or spherical), but contains geometry that should be overlapped by frustum planes.

Hierarchy

Implements

Constructors

Accessors

Methods

Constructors

Accessors

  • get maxElevation(): number
  • Get maximum elevation to be covered by camera frustum.

    Returns number

  • set maxElevation(elevation): void
  • Set maximum elevation above sea level to be rendered.

    Parameters

    • elevation: number

      the elevation (altitude) value in world units (meters).

    Returns void

    Remarks

    Note

    If you set this exactly to the maximum rendered feature height (altitude above the sea, you may notice some flickering or even polygons disappearing related to rounding errors or depth buffer precision. In such cases increase [[nearFarMargin]] or add a little bit offset to your assumed maximum elevation.

    Note

    Reasonable values are in between (-DeadSeeDepression, MtEverestHeight>, both values are defined in [[EarthConstant]] as [[EarthConstant.MIN_ELEVATION]] and [[EarthConstant.MAX_ELEVATION]] respectively.

    See

    minElevation for more information about precision and rounding errors.

  • get minElevation(): number
  • Get minimum elevation to be covered by camera frustum.

    Returns number

  • set minElevation(elevation): void
  • Set minimum elevation to be rendered, values beneath the sea level are negative.

    Parameters

    • elevation: number

      the minimum elevation (depression) in world units (meters).

    Returns void

    Remarks

    Note

    If you set this parameter to zero you may not see any features rendered if they are just below the sea level more than half of [[nearFarMargin]] assumed. Similarly if set to -100m and rendered features lays exactly in such depression, you may notice that problem. The errors usually come from projection precision loss and depth buffer nature (significant precision loss closer to far plane). Thus is such cases either increase the margin (if you are sure features are just at this elevation, or setup bigger offset for [[minElevation]]. Reasonable values are between <-DeadSeaDepression, MtEverestHeight), where the first denotes lowest depression on the Earth defined as [[EarthConstants.MIN_ELEVATION]] and the second is the highest point our planet.

    See

    https://developer.nvidia.com/content/depth-precision-visualized

Methods

  • Compute near and far clipping planes distance.

    Parameters

    • camera: Camera

      The camera in use.

    • projection: Projection

      The geo-projection currently used for encoding geographic data.

    • Optional elevationProvider: ElevationProvider

      The optional elevation provider for fine tuned range calculation, taking into account terrain variability and unevenness.

    Returns ViewRanges

    Remarks

    Evaluation method should be called on every frame and camera clip planes updated. This is related to evaluator implementation and its input data, that may suddenly change such as camera position or angle, projection type or so. Some evaluators may not depend on all or even any of input objects, but to preserve compatibility with any evaluator type it is strongly recommended to update on every frame.

    Note

    The camera clipping planes (near/far properties) aren't automatically updated via #evaluateClipPlanes() call, user should do it manually if needed.

Generated using TypeDoc