public class BasicGlobe extends java.lang.Object implements Globe
Constructor and Description |
---|
BasicGlobe(double semiMajorAxis,
double inverseFlattening,
GeographicProjection projection)
Constructs a generic Globe implementation with specified ellipsoid parameters.
|
Modifier and Type | Method and Description |
---|---|
Matrix4 |
cameraToCartesianTransform(Camera camera,
Matrix4 result) |
LookAt |
cameraToLookAt(Camera camera,
LookAt result) |
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[] |
geographicToCartesianGrid(Sector sector,
int numLat,
int numLon,
double[] elevations,
Vec3 origin,
float[] result,
int stride,
int pos) |
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.
|
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.
|
Tessellator |
getTessellator() |
double |
horizonDistance(double eyeAltitude)
Indicates the distance to the globe's horizon from a specified eye altitude.
|
double |
horizonDistance(double eyeAltitude,
double objectAltitude)
Indicates the distance to an object passing over the globe's horizon from a specified eye altitude.
|
boolean |
intersect(Line line,
Vec3 result)
Computes the first intersection of this globe with a specified line.
|
Camera |
lookAtToCamera(LookAt lookAt,
Camera result) |
Matrix4 |
lookAtToCartesianTransform(LookAt lookAt,
Matrix4 result) |
void |
setProjection(GeographicProjection projection)
Sets the geographic projection used by this globe.
|
void |
setTessellator(Tessellator tessellator) |
public BasicGlobe(double semiMajorAxis, double inverseFlattening, GeographicProjection projection)
semiMajorAxis
- one half of the globe's major axis, which runs through the center to opposite points on
the equatorinverseFlattening
- a measure of the ellipsoid's compressionprojection
- the geographic projection used by this globe, which specifies the Cartesian coordinate
systemjava.lang.IllegalArgumentException
- if either of the semi-major axis or the inverse flattening are less than or
equal to zero, or if the projection is nullpublic double getEquatorialRadius()
Globe
getEquatorialRadius
in interface Globe
public double getPolarRadius()
Globe
getPolarRadius
in interface Globe
public double getRadiusAt(double latitude, double longitude)
Globe
getRadiusAt
in interface Globe
latitude
- the location's latitude in degreeslongitude
- the location's longitude in degreespublic double getEccentricitySquared()
Globe
2*f -
f*f
, where f
is the ellipsoid's flattening parameter.getEccentricitySquared
in interface Globe
public GeographicProjection getProjection()
Globe
getProjection
in interface Globe
public void setProjection(GeographicProjection projection)
Globe
setProjection
in interface Globe
projection
- the projection to usepublic Tessellator getTessellator()
getTessellator
in interface Globe
public void setTessellator(Tessellator tessellator)
setTessellator
in interface Globe
public Vec3 geographicToCartesian(double latitude, double longitude, double altitude, Vec3 result)
Globe
geographicToCartesian
in interface Globe
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 coordinatespublic Vec3 geographicToCartesianNormal(double latitude, double longitude, Vec3 result)
geographicToCartesianNormal
in interface Globe
public Matrix4 geographicToCartesianTransform(double latitude, double longitude, double altitude, Matrix4 result)
geographicToCartesianTransform
in interface Globe
public float[] geographicToCartesianGrid(Sector sector, int numLat, int numLon, double[] elevations, Vec3 origin, float[] result, int stride, int pos)
geographicToCartesianGrid
in interface Globe
public Position cartesianToGeographic(double x, double y, double z, Position result)
Globe
cartesianToGeographic
in interface Globe
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 positionpublic Matrix4 cartesianToLocalTransform(double x, double y, double z, Matrix4 result)
cartesianToLocalTransform
in interface Globe
public Matrix4 cameraToCartesianTransform(Camera camera, Matrix4 result)
cameraToCartesianTransform
in interface Globe
public LookAt cameraToLookAt(Camera camera, LookAt result)
cameraToLookAt
in interface Globe
public Matrix4 lookAtToCartesianTransform(LookAt lookAt, Matrix4 result)
lookAtToCartesianTransform
in interface Globe
public Camera lookAtToCamera(LookAt lookAt, Camera result)
lookAtToCamera
in interface Globe
public double horizonDistance(double eyeAltitude)
Globe
horizonDistance
in interface Globe
eyeAltitude
- the eye altitude in meterspublic double horizonDistance(double eyeAltitude, double objectAltitude)
Globe
horizonDistance
in interface Globe
eyeAltitude
- the eye altitude in metersobjectAltitude
- the object altitude in meters