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()
GlobegetEquatorialRadius in interface Globepublic double getPolarRadius()
GlobegetPolarRadius in interface Globepublic double getRadiusAt(double latitude,
double longitude)
GlobegetRadiusAt in interface Globelatitude - the location's latitude in degreeslongitude - the location's longitude in degreespublic double getEccentricitySquared()
Globe2*f -
f*f, where f is the ellipsoid's flattening parameter.getEccentricitySquared in interface Globepublic GeographicProjection getProjection()
GlobegetProjection in interface Globepublic void setProjection(GeographicProjection projection)
GlobesetProjection in interface Globeprojection - the projection to usepublic Tessellator getTessellator()
getTessellator in interface Globepublic void setTessellator(Tessellator tessellator)
setTessellator in interface Globepublic Vec3 geographicToCartesian(double latitude, double longitude, double altitude, Vec3 result)
GlobegeographicToCartesian in interface Globelatitude - 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 Globepublic Matrix4 geographicToCartesianTransform(double latitude, double longitude, double altitude, Matrix4 result)
geographicToCartesianTransform in interface Globepublic float[] geographicToCartesianGrid(Sector sector, int numLat, int numLon, double[] elevations, Vec3 origin, float[] result, int stride, int pos)
geographicToCartesianGrid in interface Globepublic Position cartesianToGeographic(double x, double y, double z, Position result)
GlobecartesianToGeographic in interface Globex - 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 Globepublic Matrix4 cameraToCartesianTransform(Camera camera, Matrix4 result)
cameraToCartesianTransform in interface Globepublic LookAt cameraToLookAt(Camera camera, LookAt result)
cameraToLookAt in interface Globepublic Matrix4 lookAtToCartesianTransform(LookAt lookAt, Matrix4 result)
lookAtToCartesianTransform in interface Globepublic Camera lookAtToCamera(LookAt lookAt, Camera result)
lookAtToCamera in interface Globepublic double horizonDistance(double eyeAltitude)
GlobehorizonDistance in interface GlobeeyeAltitude - the eye altitude in meterspublic double horizonDistance(double eyeAltitude,
double objectAltitude)
GlobehorizonDistance in interface GlobeeyeAltitude - the eye altitude in metersobjectAltitude - the object altitude in meters