MapLibre Native Core
|
#include <camera.hpp>
Public Member Functions | |
void | setLocation (const LatLngAltitude &location) |
std::optional< LatLngAltitude > | getLocation () const |
void | lookAtPoint (const LatLng &location, const std::optional< vec3 > &upVector=std::nullopt) |
void | setPitchBearing (double pitch, double bearing) |
Public Attributes | |
std::optional< vec3 > | position = std::nullopt |
std::optional< vec4 > | orientation = std::nullopt |
Various options for accessing physical properties of the underlying camera entity. A direct access to these properties allows more flexible and precise controlling of the camera while also being fully compatible and interchangeable with CameraOptions. All fields are optional.
Definition at line 104 of file camera.hpp.
std::optional<LatLngAltitude> mbgl::FreeCameraOptions::getLocation | ( | ) | const |
Helper function for converting mercator position into Lat&Lng and altitude in meters. This function fails to return a value if position
is invalid or is not set
void mbgl::FreeCameraOptions::lookAtPoint | ( | const LatLng & | location, |
const std::optional< vec3 > & | upVector = std::nullopt |
||
) |
Helper function for setting orientation of the camera by defining a focus point on the map. Up vector is required in certain scenarios where bearing can't be deduced from the viewing direction
void mbgl::FreeCameraOptions::setLocation | ( | const LatLngAltitude & | location | ) |
Helper function for setting the mercator position as Lat&Lng and altitude in meters
void mbgl::FreeCameraOptions::setPitchBearing | ( | double | pitch, |
double | bearing | ||
) |
Helper function for setting the orientation of the camera as a pitch and a bearing. Both values are in degrees
std::optional<vec4> mbgl::FreeCameraOptions::orientation = std::nullopt |
Orientation of the camera represented as a unit quaternion [x, y, z, w]. The default pose of the camera is such that the forward vector is looking up the -Z axis and the up vector is aligned with north orientation of the map: forward: [0, 0, -1] up: [0, -1, 0] right [1, 0, 0]
Orientation can be set freely but certain constraints still apply
Definition at line 123 of file camera.hpp.
std::optional<vec3> mbgl::FreeCameraOptions::position = std::nullopt |
Position of the camera in slightly modified web mercator coordinates
Definition at line 111 of file camera.hpp.