public class Globe
extends java.lang.Object
Constructor and Description |
---|
Globe(Ellipsoid ellipsoid,
GeographicProjection projection)
Constructs a globe with a specified reference ellipsoid and projection.
|
Modifier and Type | Method and Description |
---|---|
Position |
cartesianToGeographic(double x,
double y,
double z,
Position result)
Converts a Cartesian point to a geographic position.
|
Matrix4 |
cartesianToLocalTransform(double x,
double y,
double z,
Matrix4 result) |
Vec3 |
geographicToCartesian(double latitude,
double longitude,
double altitude,
Vec3 result)
Converts a geographic position to Cartesian coordinates.
|
float[] |
geographicToCartesianBorder(Sector sector,
int numLat,
int numLon,
float height,
Vec3 origin,
float[] result) |
float[] |
geographicToCartesianGrid(Sector sector,
int numLat,
int numLon,
float[] height,
float verticalExaggeration,
Vec3 origin,
float[] result,
int offset,
int rowStride) |
Vec3 |
geographicToCartesianNormal(double latitude,
double longitude,
Vec3 result) |
Matrix4 |
geographicToCartesianTransform(double latitude,
double longitude,
double altitude,
Matrix4 result) |
double |
getEccentricitySquared()
Indicates the eccentricity squared parameter of the globe's ellipsoid.
|
ElevationModel |
getElevationModel() |
Ellipsoid |
getEllipsoid()
Indicates the reference ellipsoid defining this globe's equatorial radius and polar radius.
|
double |
getEquatorialRadius()
Indicates the radius in meters of the globe's ellipsoid at the equator.
|
double |
getPolarRadius()
Indicates the radius in meters of the globe's ellipsoid at the poles.
|
GeographicProjection |
getProjection()
Indicates the geographic projection used by this globe.
|
double |
getRadiusAt(double latitude,
double longitude)
Indicates the radius in meters of the globe's ellipsoid at a specified location.
|
double |
horizonDistance(double height)
Indicates the distance to the globe's horizon from a specified height above the globe's ellipsoid.
|
boolean |
intersect(Line line,
Vec3 result)
Computes the first intersection of this globe with a specified line.
|
void |
setElevationModel(ElevationModel elevationModel) |
void |
setEllipsoid(Ellipsoid ellipsoid)
Sets the reference ellipsoid that defines this globe's equatorial radius and polar radius.
|
void |
setProjection(GeographicProjection projection)
Sets the geographic projection used by this globe.
|
public Globe(Ellipsoid ellipsoid, GeographicProjection projection)
ellipsoid
- the reference ellipsoid defining the globe's equatorial radius and polar radiusprojection
- the geographic projection used by the globe, specifies the globe's Cartesian coordinate systemjava.lang.IllegalArgumentException
- If the ellipsoid is nullpublic Ellipsoid getEllipsoid()
public void setEllipsoid(Ellipsoid ellipsoid)
ellipsoid
- the new reference ellipsoidjava.lang.IllegalArgumentException
- If the ellipsoid is nullpublic double getEquatorialRadius()
public double getPolarRadius()
public double getRadiusAt(double latitude, double longitude)
latitude
- the location's latitude in degreeslongitude
- the location's longitude in degreespublic double getEccentricitySquared()
2*f -
f*f
, where f
is the ellipsoid's flattening parameter.public ElevationModel getElevationModel()
public void setElevationModel(ElevationModel elevationModel)
public GeographicProjection getProjection()
public void setProjection(GeographicProjection projection)
projection
- the projection to usejava.lang.IllegalArgumentException
- if the projection is nullpublic Vec3 geographicToCartesian(double latitude, double longitude, double altitude, Vec3 result)
latitude
- the position's latitude in degreeslongitude
- the position's longitude in degreesaltitude
- the position's altitude in metersresult
- a pre-allocated Vec3
in which to store the computed X, Y and Z Cartesian coordinatesjava.lang.IllegalArgumentException
- if the result is nullpublic Vec3 geographicToCartesianNormal(double latitude, double longitude, Vec3 result)
public Matrix4 geographicToCartesianTransform(double latitude, double longitude, double altitude, Matrix4 result)
public float[] geographicToCartesianGrid(Sector sector, int numLat, int numLon, float[] height, float verticalExaggeration, Vec3 origin, float[] result, int offset, int rowStride)
public float[] geographicToCartesianBorder(Sector sector, int numLat, int numLon, float height, Vec3 origin, float[] result)
public Position cartesianToGeographic(double x, double y, double z, Position result)
x
- the Cartesian point's X componenty
- the Cartesian point's Y componentz
- the Cartesian point's Z componentresult
- a pre-allocated Position
in which to store the computed geographic positionjava.lang.IllegalArgumentException
- if the result is nullpublic Matrix4 cartesianToLocalTransform(double x, double y, double z, Matrix4 result)
public double horizonDistance(double height)
height
- the viewer's height above the globe's ellipsoid in meterspublic boolean intersect(Line line, Vec3 result)
line
- the line to intersect with this globeresult
- a pre-allocated Vec3
in which to return the computed pointjava.lang.IllegalArgumentException
- If either argument is null