Altus Mapping Engine JavaScript API Reference - v2.0.ut.2153.g60764257e - Tuesday May 16, 2022 | SDK Documentation | Builds | BA3 Home |
A virtual camera that controls how the map is viewed. More...
Public Member Functions | |
GeographicPosition | getLocationThatFitsCoordinates (VectorGeographicPosition2D coords, double horizontalBuffer, double verticalBuffer) |
Returns a position where the camera can be placed so that it can see all the locations in coords. More... | |
GeographicPosition | getLocationThatFitsBoundingBox (BoundingBox bounds, double horizontalBuffer, double verticalBuffer) |
Returns a position where the camera can be placed so that it can see everything in a bounding box. More... | |
vec3d | getRay (ScreenSpacePercentagePoint p) |
Returns the 3D vector, in world coordinates, for an imaginary ray that passes from the center of the camera through a point on the screen. You can intersect the Earth with this ray to determine what is behind a screen point (however, see Camera::GetGeographicPosition2D for a faster method). More... | |
ScreenSpacePercentagePoint | getScreenSpacePercentagePoint (GeographicPosition geographicPosition) |
Returns the screen space position of a point on the spherical Earth. Take special note that the result of this function is only sensible if the geographic position is on screen. If it is behind the camera, the result will be misleading. If 3D terrain is used, the result will not be accurate. More... | |
GeographicPosition2D | getGeographicPosition2D (ScreenSpacePercentagePoint p) |
Returns the location on the spherical Earth behind a screen point. If 3D terrain is used, the result will not be accurate. More... | |
void | setVerticalFov (float verticalFovInRadiansWhenPortrait, float verticalFovInRadiansWhenLandscape) |
Sets the vertical field of view (the angle in radians between the top and bottom of the screen). More... | |
double | verticalFov () |
Returns the current vertical field of view. See SetVerticalFov. More... | |
double | aspectHorizontalOverVertical () |
Returns the aspect ratio of the screen. More... | |
float | getScreenSpaceRotationForGeographicPosition (GeographicPosition2D geographicPosition, float headingInRadians) |
Calculate the screen space orientation in radians of an object on the Earth with a particular heading (yaw). Use this if you would like to create a screen space marker that matches the orientation of a 3D object. More... | |
float | getScreenSpaceRotationForPoint (ScreenSpacePercentagePoint p, float headingInRadians) |
Calculate the screen space orientation in radians of an object on the spherical Earth at a particular point on the screen at a with a particular heading (yaw). If 3D terrain is used, the result will not be accurate. More... | |
Public Attributes | |
TransformPtr | transform |
The camera's transform. Use this to control the position and orientation of the camera. More... | |
A virtual camera that controls how the map is viewed.
double AltusUnified::Camera::aspectHorizontalOverVertical | ( | ) |
Returns the aspect ratio of the screen.
GeographicPosition2D AltusUnified::Camera::getGeographicPosition2D | ( | ScreenSpacePercentagePoint | p | ) |
Returns the location on the spherical Earth behind a screen point. If 3D terrain is used, the result will not be accurate.
p | The screen point. |
GeographicPosition AltusUnified::Camera::getLocationThatFitsBoundingBox | ( | BoundingBox | bounds, |
double | horizontalBuffer, | ||
double | verticalBuffer | ||
) |
Returns a position where the camera can be placed so that it can see everything in a bounding box.
bounds | The bounding box the camera should see. |
horizontalBuffer | The verticalBuffer screen space size, in points, at the left and right of the screen where the bounding box should not lie. |
GeographicPosition AltusUnified::Camera::getLocationThatFitsCoordinates | ( | VectorGeographicPosition2D | coords, |
double | horizontalBuffer, | ||
double | verticalBuffer | ||
) |
Returns a position where the camera can be placed so that it can see all the locations in coords.
coords | The list of locations the camera should see. |
horizontalBuffer | The verticalBuffer screen space size, in points, at the left and right of the screen where the points should not lie. |
vec3d AltusUnified::Camera::getRay | ( | ScreenSpacePercentagePoint | p | ) |
Returns the 3D vector, in world coordinates, for an imaginary ray that passes from the center of the camera through a point on the screen. You can intersect the Earth with this ray to determine what is behind a screen point (however, see Camera::GetGeographicPosition2D for a faster method).
p | The point on the screen the ray will pass through. |
ScreenSpacePercentagePoint AltusUnified::Camera::getScreenSpacePercentagePoint | ( | GeographicPosition | geographicPosition | ) |
Returns the screen space position of a point on the spherical Earth. Take special note that the result of this function is only sensible if the geographic position is on screen. If it is behind the camera, the result will be misleading. If 3D terrain is used, the result will not be accurate.
geographicPosition | The location. |
float AltusUnified::Camera::getScreenSpaceRotationForGeographicPosition | ( | GeographicPosition2D | geographicPosition, |
float | headingInRadians | ||
) |
Calculate the screen space orientation in radians of an object on the Earth with a particular heading (yaw). Use this if you would like to create a screen space marker that matches the orientation of a 3D object.
geographicPosition | The location of the object. |
headingInRadians | The heading (yaw) of the object, in radians. |
float AltusUnified::Camera::getScreenSpaceRotationForPoint | ( | ScreenSpacePercentagePoint | p, |
float | headingInRadians | ||
) |
Calculate the screen space orientation in radians of an object on the spherical Earth at a particular point on the screen at a with a particular heading (yaw). If 3D terrain is used, the result will not be accurate.
p | The screen space position where the orientation should be calculated. |
headingInRadians | The heading (yaw) of the object, in radians. |
void AltusUnified::Camera::setVerticalFov | ( | float | verticalFovInRadiansWhenPortrait, |
float | verticalFovInRadiansWhenLandscape | ||
) |
Sets the vertical field of view (the angle in radians between the top and bottom of the screen).
verticalFovInRadiansWhenPortrait | The field of view when the screen is vertically aligned (especially useful for mobile devices). |
verticalFovInRadiansWhenLandscape | The field of view when the screen is horizontally aligned (especially useful for mobile devices). |
double AltusUnified::Camera::verticalFov | ( | ) |
Returns the current vertical field of view. See SetVerticalFov.
TransformPtr AltusUnified::Camera::transform |
The camera's transform. Use this to control the position and orientation of the camera.