public class ProjectionWgs84 extends java.lang.Object implements GeographicProjection
Constructor and Description |
---|
ProjectionWgs84()
Constructs a WGS 84 geographic projection.
|
Modifier and Type | Method and Description |
---|---|
Position |
cartesianToGeographic(Globe globe,
double x,
double y,
double z,
Vec3 offset,
Position result)
Converts a Cartesian point to a geographic position.
|
Matrix4 |
cartesianToLocalTransform(Globe globe,
double x,
double y,
double z,
Vec3 offset,
Matrix4 result) |
Vec3 |
geographicToCartesian(Globe globe,
double latitude,
double longitude,
double altitude,
Vec3 offset,
Vec3 result)
Converts a geographic position to Cartesian coordinates.
|
float[] |
geographicToCartesianGrid(Globe globe,
Sector sector,
int numLat,
int numLon,
double[] elevations,
Vec3 origin,
Vec3 offset,
float[] result,
int stride,
int pos) |
Vec3 |
geographicToCartesianNormal(Globe globe,
double latitude,
double longitude,
Vec3 result) |
Matrix4 |
geographicToCartesianTransform(Globe globe,
double latitude,
double longitude,
double altitude,
Vec3 offset,
Matrix4 result) |
java.lang.String |
getDisplayName()
This projection's display name.
|
boolean |
intersect(Globe globe,
Line line,
Vec3 offset,
Vec3 result)
Computes the first intersection of a specified globe and line.
|
public ProjectionWgs84()
public java.lang.String getDisplayName()
GeographicProjection
getDisplayName
in interface GeographicProjection
public Vec3 geographicToCartesian(Globe globe, double latitude, double longitude, double altitude, Vec3 offset, Vec3 result)
GeographicProjection
geographicToCartesian
in interface GeographicProjection
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 metersoffset
- an offset to apply to the Cartesian output. Typically only projections that are continuous apply
to this offset. Others ignore it. May be null to indicate no offset is applied.result
- a pre-allocated Vec3
in which to store the computed X, Y and Z Cartesian coordinatespublic Vec3 geographicToCartesianNormal(Globe globe, double latitude, double longitude, Vec3 result)
geographicToCartesianNormal
in interface GeographicProjection
public Matrix4 geographicToCartesianTransform(Globe globe, double latitude, double longitude, double altitude, Vec3 offset, Matrix4 result)
geographicToCartesianTransform
in interface GeographicProjection
public float[] geographicToCartesianGrid(Globe globe, Sector sector, int numLat, int numLon, double[] elevations, Vec3 origin, Vec3 offset, float[] result, int stride, int pos)
geographicToCartesianGrid
in interface GeographicProjection
public Position cartesianToGeographic(Globe globe, double x, double y, double z, Vec3 offset, Position result)
GeographicProjection
cartesianToGeographic
in interface GeographicProjection
x
- the Cartesian point's X componenty
- the Cartesian point's Y componentz
- the Cartesian point's Z componentoffset
- an offset to apply to the Cartesian output. Typically only projections that are continuous apply to
this offset. Others ignore it. May be null to indicate no offset is applied.result
- a pre-allocated Position
in which to store the computed geographic positionpublic Matrix4 cartesianToLocalTransform(Globe globe, double x, double y, double z, Vec3 offset, Matrix4 result)
cartesianToLocalTransform
in interface GeographicProjection
public boolean intersect(Globe globe, Line line, Vec3 offset, Vec3 result)
GeographicProjection
intersect
in interface GeographicProjection
globe
- the globe this projection is applied toline
- the line to intersect with the globeoffset
- an offset to apply to the Cartesian output. Typically only projections that are continuous apply to
this offset. Others ignore it. May be null to indicate no offset is applied.result
- a pre-allocated Vec3
in which to return the computed point