class
#include <Magnum/Trade/CameraData.h>
CameraData Camera data.
Provides access to perspective and orthographic camera properties. Populated instances of this class are returned from AbstractImporter::
Constructors, destructors, conversion operators
- CameraData(CameraType type, Rad fov, Float aspectRatio, Float near, Float far, const void* importerState = nullptr) explicit noexcept
- Construct a camera using a field of view.
- CameraData(CameraType type, const Vector2& size, Float near, Float far, const void* importerState = nullptr) explicit noexcept
- Construct a camera using a projection size.
- CameraData(const CameraData&) deleted
- Copying is not allowed.
- CameraData(CameraData&&) defaulted noexcept
- Move constructor.
Public functions
- auto operator=(const CameraData&) -> CameraData& deleted
- Copying is not allowed.
- auto operator=(CameraData&&) -> CameraData& defaulted noexcept
- Move assignment.
- auto type() const -> CameraType
- Camera type.
- auto size() const -> Vector2
- Size of the near clipping plane.
- auto fov() const -> Rad
- Field-of-view angle.
- auto aspectRatio() const -> Float
- Aspect ratio.
- auto near() const -> Float
- Near clipping plane.
- auto far() const -> Float
- Far clipping plane.
- auto importerState() const -> const void*
- Importer-specific state.
Function documentation
Magnum:: Trade:: CameraData:: CameraData(CameraType type,
Rad fov,
Float aspectRatio,
Float near,
Float far,
const void* importerState = nullptr) explicit noexcept
Construct a camera using a field of view.
Parameters | |
---|---|
type | Camera type |
fov | Horizontal field-of-view angle |
aspectRatio | Horizontal:vertical aspect ratio |
near | Near clipping plane |
far | Far clipping plane . Set to Constants:: |
importerState | Importer-specific state |
The constructor converts the fov
and aspectRatio
to near plane size using the following formula and stores that:
The type
parameter has to be CameraType::
Magnum:: Trade:: CameraData:: CameraData(CameraType type,
const Vector2& size,
Float near,
Float far,
const void* importerState = nullptr) explicit noexcept
Construct a camera using a projection size.
Parameters | |
---|---|
type | Camera type |
size | Size of the near clipping plane |
near | Near clipping plane |
far | Far clipping plane. Set to Constants:: |
importerState | Importer-specific state |
For CameraType::near
and far
is expected to be 0.0f
.
Vector2 Magnum:: Trade:: CameraData:: size() const
Size of the near clipping plane.
For CameraType::
Rad Magnum:: Trade:: CameraData:: fov() const
Field-of-view angle.
Expects that type() is CameraType::
Float Magnum:: Trade:: CameraData:: aspectRatio() const
Aspect ratio.
const void* Magnum:: Trade:: CameraData:: importerState() const
Importer-specific state.
See AbstractImporter::