Package gov.nasa.worldwind.globe
Class ProjectionWgs84
- java.lang.Object
-
- gov.nasa.worldwind.globe.ProjectionWgs84
-
- All Implemented Interfaces:
GeographicProjection
public class ProjectionWgs84 extends java.lang.Object implements GeographicProjection
-
-
Constructor Summary
Constructors Constructor Description ProjectionWgs84()
Constructs a WGS 84 geographic projection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Position
cartesianToGeographic(Globe globe, double x, double y, double z, Position result)
Converts a Cartesian point to a geographic position.Matrix4
cartesianToLocalTransform(Globe globe, double x, double y, double z, Matrix4 result)
Vec3
geographicToCartesian(Globe globe, double latitude, double longitude, double altitude, Vec3 result)
Converts a geographic position to Cartesian coordinates.float[]
geographicToCartesianBorder(Globe globe, Sector sector, int numLat, int numLon, float height, Vec3 origin, float[] result)
float[]
geographicToCartesianGrid(Globe globe, Sector sector, int numLat, int numLon, float[] height, float verticalExaggeration, Vec3 origin, float[] result, int offset, int rowStride)
Vec3
geographicToCartesianNormal(Globe globe, double latitude, double longitude, Vec3 result)
Matrix4
geographicToCartesianTransform(Globe globe, double latitude, double longitude, double altitude, Matrix4 result)
java.lang.String
getDisplayName()
This projection's display name.boolean
intersect(Globe globe, Line line, Vec3 result)
Computes the first intersection of a specified globe and line.
-
-
-
Method Detail
-
getDisplayName
public java.lang.String getDisplayName()
Description copied from interface:GeographicProjection
This projection's display name.- Specified by:
getDisplayName
in interfaceGeographicProjection
- Returns:
- the display name
-
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 interfaceGeographicProjection
- Parameters:
globe
- the globe this projection is applied tolatitude
- the position's latitude in degreeslongitude
- the position's longitude in degreesaltitude
- the position's altitude in metersresult
- a pre-allocatedVec3
in which to store the computed X, Y and Z Cartesian coordinates- Returns:
- the result argument, set to the computed Cartesian coordinates
-
geographicToCartesianNormal
public Vec3 geographicToCartesianNormal(Globe globe, double latitude, double longitude, Vec3 result)
- Specified by:
geographicToCartesianNormal
in interfaceGeographicProjection
-
geographicToCartesianTransform
public Matrix4 geographicToCartesianTransform(Globe globe, double latitude, double longitude, double altitude, Matrix4 result)
- Specified by:
geographicToCartesianTransform
in interfaceGeographicProjection
-
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 interfaceGeographicProjection
-
geographicToCartesianBorder
public float[] geographicToCartesianBorder(Globe globe, Sector sector, int numLat, int numLon, float height, Vec3 origin, float[] result)
- Specified by:
geographicToCartesianBorder
in interfaceGeographicProjection
-
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 interfaceGeographicProjection
- Parameters:
globe
- Globe modelx
- the Cartesian point's X componenty
- the Cartesian point's Y componentz
- the Cartesian point's Z componentresult
- a pre-allocatedPosition
in which to store the computed geographic position- Returns:
- the result argument, set to the computed geographic position
-
cartesianToLocalTransform
public Matrix4 cartesianToLocalTransform(Globe globe, double x, double y, double z, Matrix4 result)
- Specified by:
cartesianToLocalTransform
in interfaceGeographicProjection
-
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 interfaceGeographicProjection
- Parameters:
globe
- the globe this projection is applied toline
- the line to intersect with the globeresult
- a pre-allocatedVec3
in which to return the computed point- Returns:
- true if the ray intersects the globe, otherwise false
-
-