![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
The virtual camera within a Surface3D scene.
The Camera class allows an application to modify the view within a Surface3D by configuring the parameters of a virtual Camera:
The units used by the Camera are:
The camera's orientation may be set in several ways:
In order to move the camera the application should use the methods on this class, which will update the camera's parameters for any subsequent calls to Surface3D::redraw().
Public Member Functions | |
void | position (const GeodeticPoint &pos) |
GeodeticPoint | position () const |
void | latitude (double lat) |
double | latitude () const |
void | longitude (double lon) |
double | longitude () const |
void | altitude (double alt) |
double | altitude () const |
void | translate (const GeodeticPoint &translation) |
void | minAltitude (double alt) |
double | minAltitude () const |
Get the minimum altitude limit of the camera. | |
void | minAltitudeRelativeToTerrain (bool relative) |
bool | minAltitudeRelativeToTerrain () const |
Get whether the minimum altitude limit is relative to the terrain. | |
void | maxAltitude (double alt) |
double | maxAltitude () const |
Get the maximum altitude limit of the camera. | |
void | maxAltitudeRelativeToTerrain (bool relative) |
bool | maxAltitudeRelativeToTerrain () const |
Get whether the maximum altitude limit is relative to the terrain. | |
void | lookAt (const GeodeticPoint &targetPos) |
GeodeticPoint | lookAt () const |
void | lookAt (const GeodeticPoint &cameraPos, const GeodeticPoint &targetPos, double roll) |
void | lookAt (const GeodeticPoint &cameraPos, const GeodeticPoint &targetPos, const GeodeticDirection &cameraUp) |
void | orientationVectors (const GeodeticDirection &forward, const GeodeticDirection &right, const GeodeticDirection &up) |
GeodeticDirection | forward () const |
GeodeticDirection | right () const |
GeodeticDirection | up () const |
void | roll (double angle) |
double | roll () const |
void | positionGeocentric (const GeocentricPoint &pos) |
Set the position of the camera in geocentric (ECEF) space. | |
GeocentricPoint | positionGeocentric () const |
Get the position of the camera in geocentric (ECEF) space. | |
void | translateGeocentric (const GeocentricPoint &translation) |
Translate the camera in geocentric (ECEF) space. | |
void | orientationGeocentric (const Rotation &angles) |
void | lookAtGeocentric (const GeocentricPoint &targetPos) |
GeocentricPoint | lookAtGeocentric () const |
void | lookAtGeocentric (const GeocentricPoint &cameraPos, const GeocentricPoint &targetPos, double roll) |
void | lookAtGeocentric (const GeocentricPoint &cameraPos, const GeocentricPoint &targetPos, const GeocentricDirection &cameraUp) |
void | orientationVectorsGeocentric (const GeocentricDirection &forward, const GeocentricDirection &right, const GeocentricDirection &up) |
GeocentricDirection | forwardGeocentric () const |
Get the forward vector of the camera in geocentric space. | |
GeocentricDirection | rightGeocentric () const |
Get the right vector of the camera in geocentric space. | |
GeocentricDirection | upGeocentric () const |
Get the up vector of the camera in geocentric space. | |
void | fov (double angle) |
double | fov () const |
double envitia::maplink::earth::Camera::altitude | ( | ) | const |
Get the altitude of the camera.
void envitia::maplink::earth::Camera::altitude | ( | double | alt | ) |
Set the altitude of the camera.
alt | The altitude of the camera in meters. |
GeodeticDirection envitia::maplink::earth::Camera::forward | ( | ) | const |
Get the forward vector of the camera.
GeocentricDirection envitia::maplink::earth::Camera::forwardGeocentric | ( | ) | const |
Get the forward vector of the camera in geocentric space.
double envitia::maplink::earth::Camera::fov | ( | ) | const |
Get the field of view of the camera.
void envitia::maplink::earth::Camera::fov | ( | double | angle | ) |
Set the field of view of the camera.
angle | The camera's field of view in degrees. |
double envitia::maplink::earth::Camera::latitude | ( | ) | const |
Get the latitude of the camera.
void envitia::maplink::earth::Camera::latitude | ( | double | lat | ) |
Set the latitude of the camera.
lat | The latitude of the camera in degrees. |
double envitia::maplink::earth::Camera::longitude | ( | ) | const |
Get the longitude of the camera.
void envitia::maplink::earth::Camera::longitude | ( | double | lon | ) |
Set the longitude of the camera.
lon | The longitude of the camera in degrees. |
GeodeticPoint envitia::maplink::earth::Camera::lookAt | ( | ) | const |
Query the camera's target point.
void envitia::maplink::earth::Camera::lookAt | ( | const GeodeticPoint & | cameraPos, |
const GeodeticPoint & | targetPos, | ||
const GeodeticDirection & | cameraUp ) |
Set the camera to point at a target
cameraPos | The position of the camera. |
targetPos | The target position. |
cameraUp | The up vector of the camera. Will be used to calculate the camera's roll angle. |
void envitia::maplink::earth::Camera::lookAt | ( | const GeodeticPoint & | cameraPos, |
const GeodeticPoint & | targetPos, | ||
double | roll ) |
Set the camera to point at a target
cameraPos | The position of the camera. |
targetPos | The target position. |
roll | The roll angle of the camera in degrees around the camera's forward vector. Zero roll corresponds to the camera being 'flat' relative to the earth's surface. |
void envitia::maplink::earth::Camera::lookAt | ( | const GeodeticPoint & | targetPos | ) |
Set the camera to point at a target.
targetPos | The target position. |
GeocentricPoint envitia::maplink::earth::Camera::lookAtGeocentric | ( | ) | const |
Query the camera's target point in geocentric space.
void envitia::maplink::earth::Camera::lookAtGeocentric | ( | const GeocentricPoint & | cameraPos, |
const GeocentricPoint & | targetPos, | ||
const GeocentricDirection & | cameraUp ) |
Set the camera to point at a target in geocentric space.
cameraPos | The position of the camera. |
targetPos | The target position. |
cameraUp | The up vector of the camera, used to calculate the camera's roll angle. |
void envitia::maplink::earth::Camera::lookAtGeocentric | ( | const GeocentricPoint & | cameraPos, |
const GeocentricPoint & | targetPos, | ||
double | roll ) |
Set the camera to point at a target in geocentric space.
cameraPos | The position of the camera. |
targetPos | The target position. |
roll | The roll angle of the camera in degrees around the camera's forward vector. Zero roll corresponds to the camera being 'flat' relative to the earth's surface. |
void envitia::maplink::earth::Camera::lookAtGeocentric | ( | const GeocentricPoint & | targetPos | ) |
Set the camera to point at a target in geocentric space.
targetPos | The target position. |
double envitia::maplink::earth::Camera::maxAltitude | ( | ) | const |
Get the maximum altitude limit of the camera.
void envitia::maplink::earth::Camera::maxAltitude | ( | double | alt | ) |
Set the maximum altitude limit of the camera.
If set the camera's altitude will be restricted to be less than or equal to this value.
The default altitude limit is std::numeric_limits<double>::max (no limit).
alt | The maximum altitude limit. |
bool envitia::maplink::earth::Camera::maxAltitudeRelativeToTerrain | ( | ) | const |
Get whether the maximum altitude limit is relative to the terrain.
void envitia::maplink::earth::Camera::maxAltitudeRelativeToTerrain | ( | bool | relative | ) |
Set whether the maximum altitude limit is relative to the terrain.
If true the camera's maximum altitude will be based on the terrain height at the camera's latitude/longitude.
If false the maximum altitude will be based on the globe.
By default this option is disabled.
relative | true if the limit should be relative to the terrain, false otherwise. |
double envitia::maplink::earth::Camera::minAltitude | ( | ) | const |
Get the minimum altitude limit of the camera.
void envitia::maplink::earth::Camera::minAltitude | ( | double | alt | ) |
Set the minimum altitude limit of the camera.
If set the camera's altitude will be restricted to be greater than or equal to this value.
The default altitude limit is zero, relative to the terrain.
alt | The minimum altitude limit. |
bool envitia::maplink::earth::Camera::minAltitudeRelativeToTerrain | ( | ) | const |
Get whether the minimum altitude limit is relative to the terrain.
void envitia::maplink::earth::Camera::minAltitudeRelativeToTerrain | ( | bool | relative | ) |
Set whether the minimum altitude limit is relative to the terrain.
If true the camera's minimum altitude will be based on the terrain height at the camera's latitude/longitude.
If false the minimum altitude will be based on the globe, and the camera may be positioned below the terrain.
By default this option is enabled.
relative | true if the limit should be relative to the terrain, false otherwise. |
void envitia::maplink::earth::Camera::orientationGeocentric | ( | const Rotation & | angles | ) |
Set the camera's orientation in geocentric space.
The provided vector will be interpreted as rotation around the 3 axis in geocentric(ECEF) space.
The rotation will be applied as an extrinsic rotation (The rotation axis will remain fixed). The rotation will be applied in the order x, y, z.
Prior to the rotation the camera's orientation is
angles | The orientation angles of the camera. |
void envitia::maplink::earth::Camera::orientationVectors | ( | const GeodeticDirection & | forward, |
const GeodeticDirection & | right, | ||
const GeodeticDirection & | up ) |
Set the camera orientation as vectors
As directions in geodetic space do not correspond to straight lines in geocentric space the recommended approach for this method should be to base the directions on other points, or to provide vectors with a short length. Vectors with a length of > 1.0 degrees in x/y may represent a significantly different direction due to the curvature of the earth.
forward | The direction the camera is pointing. |
right | A vector pointing to the right from the camera's position. |
up | A vector pointing up from the camera's position. |
void envitia::maplink::earth::Camera::orientationVectorsGeocentric | ( | const GeocentricDirection & | forward, |
const GeocentricDirection & | right, | ||
const GeocentricDirection & | up ) |
Set the camera orientation as vectors in geocentric space.
forward | The direction the camera is pointing. |
right | A vector pointing to the right from the camera's position. |
up | A vector pointing up from the camera's position. |
GeodeticPoint envitia::maplink::earth::Camera::position | ( | ) | const |
Get the position of the camera.
void envitia::maplink::earth::Camera::position | ( | const GeodeticPoint & | pos | ) |
Set the position of the camera.
pos | The position of the camera. |
GeocentricPoint envitia::maplink::earth::Camera::positionGeocentric | ( | ) | const |
Get the position of the camera in geocentric (ECEF) space.
void envitia::maplink::earth::Camera::positionGeocentric | ( | const GeocentricPoint & | pos | ) |
Set the position of the camera in geocentric (ECEF) space.
GeodeticDirection envitia::maplink::earth::Camera::right | ( | ) | const |
Get the right vector of the camera.
GeocentricDirection envitia::maplink::earth::Camera::rightGeocentric | ( | ) | const |
Get the right vector of the camera in geocentric space.
double envitia::maplink::earth::Camera::roll | ( | ) | const |
Get the roll angle of the camera.
void envitia::maplink::earth::Camera::roll | ( | double | angle | ) |
Set the roll angle of the camera.
The roll angle is specified in degrees, around the camera's forward vector. Zero roll corresponds to the camera being 'flat' relative to the earth's surface.
angle | The roll angle of the camera. |
void envitia::maplink::earth::Camera::translate | ( | const GeodeticPoint & | translation | ) |
Translate the camera's position.
translation | The translation to apply to the camera's position. |
void envitia::maplink::earth::Camera::translateGeocentric | ( | const GeocentricPoint & | translation | ) |
Translate the camera in geocentric (ECEF) space.
GeodeticDirection envitia::maplink::earth::Camera::up | ( | ) | const |
Get the up vector of the camera.
GeocentricDirection envitia::maplink::earth::Camera::upGeocentric | ( | ) | const |
Get the up vector of the camera in geocentric space.