public interface Terrain
Models the geometric surface defined by an ellipsoidal globe and its
associated elevations. Terrain uses the Cartesian coordinate system specified by a GeographicProjection
and
is capable of representing both a 3D ellipsoid and a 2D map projection, though not simultaneously.
Terrain implementations typically model a subset of the globe's surface at varying
resolution. In this case results from the methods intersect
and surfacePoint
cannot be cached. Either
method may fail to compute a result when the terrain surface has no geometry in the region queried, and even if
computation is successful the result is based on an unknown resolution. However, if the terrain implementation is
known to model a pre-determined resolution and region of interest results from the methods intersect
and
surfacePoint
may be cached.
GeographicProjection
Modifier and Type | Method and Description |
---|---|
Sector |
getSector()
Indicates the geographic rectangular region that contains this terrain.
|
boolean |
intersect(Line line,
Vec3 result)
Computes the first intersection of this terrain with a specified line in Cartesian coordinates.
|
boolean |
surfacePoint(double latitude,
double longitude,
Vec3 result)
Computes the Cartesian coordinates of a geographic location on the terrain surface.
|
Sector getSector()
boolean intersect(Line line, Vec3 result)
line
- the line to intersect with this terrainresult
- a pre-allocated Vec3
in which to return the intersection pointjava.lang.IllegalArgumentException
- if either argument is nullboolean surfacePoint(double latitude, double longitude, Vec3 result)
latitude
- the location's latitude in degreeslongitude
- the location's longitude in degreesresult
- a pre-allocated Vec3
in which to store the computed X, Y and Z Cartesian coordinatesjava.lang.IllegalArgumentException
- if the result is null