Class LinesOfSight


  • public class LinesOfSight
    extends ApplicationTemplate
    Computes and displays line-of-sight intersections for terrain and renderables. Uses a Terrain object in order to determine accurate intersections relative to the highest-resolution elevation data associated with a specified globe.

    This class uses a TerrainLineIntersector and a ShapeLineIntersector to compute the intersections.

    Usage:
    Shift-click: Calculate lines of sight for a position.
    Ctrl-click: Cancel the running computation.
    Alt-click: Re-run the most recent line of sight calculation.

    • Field Detail

      • GRID_RADIUS

        protected static final Angle GRID_RADIUS
        The width and height in degrees of the grid used to calculate intersections.
      • GRID_DIMENSION

        protected static final int GRID_DIMENSION
        The number of cells along each edge of the grid.
        See Also:
        Constant Field Values
      • REFERENCE_POSITION_HEIGHT

        protected static final int REFERENCE_POSITION_HEIGHT
        See Also:
        Constant Field Values
      • TARGET_RESOLUTION

        protected static final java.lang.Double TARGET_RESOLUTION
        The desired terrain resolution to use in the intersection calculations.
      • CACHE_SIZE

        protected static final long CACHE_SIZE
        The size of the Terrain's cache. *
        See Also:
        Constant Field Values
      • SHOW_ONLY_FIRST_INTERSECTIONS

        protected static final boolean SHOW_ONLY_FIRST_INTERSECTIONS
        See Also:
        Constant Field Values
    • Constructor Detail

      • LinesOfSight

        public LinesOfSight()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)