LuciadCPillar 2024.0.08
|
A camera that uses an orthographic (or parallel) projection. More...
#include <luciad/cameras/OrthographicCamera.h>
Classes | |
class | Builder |
Factory object that can create new OrthographicCamera instances. More... | |
Public Member Functions | |
~OrthographicCamera () override | |
Builder | asBuilder () const |
Returns a Builder that can build cameras identical to this camera. More... | |
Look2D | asLook2D () const |
Returns a description of the camera location targeted towards a 2D top-down view of the map. More... | |
Coordinate | getEye () const override |
Returns the current location of the camera in map coordinates . More... | |
double | getFar () const override |
Returns the distance from the eye to the far clipping plane. More... | |
Coordinate | getForward () const override |
Returns the (normalized) direction corresponding to the forward direction of the view. More... | |
double | getHeight () const override |
Returns the height in device independent pixels of the viewport of this camera. More... | |
double | getNear () const override |
Returns the distance from the eye to the near clipping plane. More... | |
Coordinate | getUp () const override |
Returns the (normalized) direction corresponding to the upward direction of the view. More... | |
double | getWidth () const override |
Returns the width in device independent pixels of the viewport of this camera. More... | |
Coordinate | mapToView (Coordinate mapPoint) const override |
Transforms a point in map coordinates to view coordinates. More... | |
Coordinate | viewToMap (Coordinate viewPoint) const override |
Transforms a view point to map coordinates . More... | |
Public Member Functions inherited from luciad::Camera | |
virtual | ~Camera ()=default |
virtual Coordinate | getEye () const =0 |
Returns the current location of the camera in map coordinates . More... | |
virtual double | getFar () const =0 |
Returns the distance from the eye to the far clipping plane. More... | |
virtual Coordinate | getForward () const =0 |
Returns the (normalized) direction corresponding to the forward direction of the view. More... | |
virtual double | getHeight () const =0 |
Returns the height in device independent pixels of the viewport of this camera. More... | |
virtual double | getNear () const =0 |
Returns the distance from the eye to the near clipping plane. More... | |
virtual Coordinate | getUp () const =0 |
Returns the (normalized) direction corresponding to the upward direction of the view. More... | |
virtual double | getWidth () const =0 |
Returns the width in device independent pixels of the viewport of this camera. More... | |
virtual Coordinate | mapToView (Coordinate mapPoint) const =0 |
Transforms a point in map coordinates to view coordinates. More... | |
virtual Coordinate | viewToMap (Coordinate viewPoint) const =0 |
Transforms a view point to map coordinates . More... | |
A camera that uses an orthographic (or parallel) projection.
That the Camera API is a low-level API. For simple map navigation use cases, it's recommended to use the higher-level API. The MapNavigator
API works in both 2D and 3D, on all map references. If you use the low-level Camera API, keep in mind that the same camera manipulation implementation might not work for other types of cameras (OrthographicCamera
vs PerspectiveCamera
) or other (types of) map references (projected vs. geocentric).
A camera transforms points from the map reference
to the view (device independent pixel coordinates).
Cameras in LuciadCPillar are immutable. You can manipulate the map's camera by creating a modified copy using the builder
. The new camera can then be set
on the map.
Currently, the OrthographicCamera is only used in combination with projected (grid) references (aka 2D maps). For now, you cannot use this camera if the map has a geocentric (3D) reference.
For projected (grid) references, the camera should be positioned along the positive Z axis, facing the negative Z direction. This way, the camera is positioned facing the XY-plane, where the map is rendered in.
To manipulate an orthographic camera on a projected (grid) or cartesian reference, we recommend using look2D. This allows you to reason about the camera in 2D space, instead of a 3D space. It also allows you to easily rotate and zoom the camera around any arbitrary view / map point.
Map navigation constraints configured on MapNavigator
are not enforced when this camera is updated on the map. Constraints are only respected when using MapNavigator.
|
override |
Builder luciad::OrthographicCamera::asBuilder | ( | ) | const |
Returns a Builder that can build cameras identical to this camera.
Look2D luciad::OrthographicCamera::asLook2D | ( | ) | const |
Returns a description of the camera location targeted towards a 2D top-down view of the map.
|
overridevirtual |
Returns the current location of the camera in map coordinates
.
map coordinates
. Implements luciad::Camera.
|
overridevirtual |
Returns the distance from the eye to the far clipping plane.
Points that fall outside of the near/far interval are clipped.
Implements luciad::Camera.
|
overridevirtual |
Returns the (normalized) direction corresponding to the forward direction of the view.
It is defined in the map reference
.
Implements luciad::Camera.
|
overridevirtual |
Returns the height in device independent pixels of the viewport of this camera.
Implements luciad::Camera.
|
overridevirtual |
Returns the distance from the eye to the near clipping plane.
Points that fall outside of the near/far interval are clipped.
Implements luciad::Camera.
|
overridevirtual |
Returns the (normalized) direction corresponding to the upward direction of the view.
It is defined in the map reference
.
Implements luciad::Camera.
|
overridevirtual |
Returns the width in device independent pixels of the viewport of this camera.
Implements luciad::Camera.
|
overridevirtual |
Transforms a point in map coordinates
to view coordinates.
For perspective cameras, the resulting view coordinate will contain a z-coordinate. This allows to transform the resulting view point back to the original point.
mapPoint | A point, defined in the reference of the Map. |
Implements luciad::Camera.
|
overridevirtual |
Transforms a view point to map coordinates
.
When the camera is a perspective camera, the z-value of the view point is used to determine the depth of the Map point:
viewPoint | A view point, in device independent pixels. (0, 0) is defined in the top-left corner of the screen. |
Implements luciad::Camera.