Class ProjectionWgs84

    • Constructor Detail

      • ProjectionWgs84

        public ProjectionWgs84()
        Constructs a WGS 84 geographic projection.
    • Method Detail

      • geographicToCartesian

        public Vec3 geographicToCartesian​(Globe globe,
                                          double latitude,
                                          double longitude,
                                          double altitude,
                                          Vec3 result)
        Description copied from interface: GeographicProjection
        Converts a geographic position to Cartesian coordinates.
        Specified by:
        geographicToCartesian in interface GeographicProjection
        Parameters:
        globe - the globe this projection is applied to
        latitude - the position's latitude in degrees
        longitude - the position's longitude in degrees
        altitude - the position's altitude in meters
        result - a pre-allocated Vec3 in which to store the computed X, Y and Z Cartesian coordinates
        Returns:
        the result argument, set to the computed Cartesian coordinates
      • geographicToCartesianGrid

        public float[] geographicToCartesianGrid​(Globe globe,
                                                 Sector sector,
                                                 int numLat,
                                                 int numLon,
                                                 float[] height,
                                                 float verticalExaggeration,
                                                 Vec3 origin,
                                                 float[] result,
                                                 int offset,
                                                 int rowStride)
        Specified by:
        geographicToCartesianGrid in interface GeographicProjection
      • cartesianToGeographic

        public Position cartesianToGeographic​(Globe globe,
                                              double x,
                                              double y,
                                              double z,
                                              Position result)
        Description copied from interface: GeographicProjection
        Converts a Cartesian point to a geographic position.
        Specified by:
        cartesianToGeographic in interface GeographicProjection
        Parameters:
        globe - Globe model
        x - the Cartesian point's X component
        y - the Cartesian point's Y component
        z - the Cartesian point's Z component
        result - a pre-allocated Position in which to store the computed geographic position
        Returns:
        the result argument, set to the computed geographic position
      • intersect

        public boolean intersect​(Globe globe,
                                 Line line,
                                 Vec3 result)
        Description copied from interface: GeographicProjection
        Computes the first intersection of a specified globe and line. The line is interpreted as a ray; intersection points behind the line's origin are ignored.
        Specified by:
        intersect in interface GeographicProjection
        Parameters:
        globe - the globe this projection is applied to
        line - the line to intersect with the globe
        result - a pre-allocated Vec3 in which to return the computed point
        Returns:
        true if the ray intersects the globe, otherwise false