LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Camera.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef CAMERA_H_6014714286
16#define CAMERA_H_6014714286
17
24
25namespace LibCarna
26{
27
28namespace base
29{
30
31
32
33// ----------------------------------------------------------------------------------
34// Camera
35// ----------------------------------------------------------------------------------
36
42class LIBCARNA Camera : public Spatial
43{
44
45 math::Matrix4f myViewTransform;
46
47 math::Matrix4f myProjection;
48
49 bool orthogonalProjectionHint;
50
51public:
52
57
64
70 const math::Matrix4f& projection() const;
71
76
81
87
91 virtual void updateWorldTransform() override;
92
93}; // Camera
94
95
96
97} // namespace LibCarna :: base
98
99} // namespace LibCarna
100
101#endif // CAMERA_H_6014714286
Defines LibCarna::base::Spatial.
Represents an association.
Represents the point-of-view and defines the 3D to 2D projection.
Definition Camera.hpp:43
Camera()
Instantiates with setOrthogonalProjectionHint set to false.
const math::Matrix4f & viewTransform() const
References the view matrix, that is the inverse worldTransform matrix.
void setProjection(const math::Matrix4f &)
Sets the matrix that is to be used for mapping view space to clipping coordinates....
virtual void updateWorldTransform() override
Updates the viewTransform matrix.
bool isOrthogonalProjectionHintSet() const
Tells whether projection is likely to be orthogonal or perspectival.
void setOrthogonalProjectionHint(bool isOrthogonalProjection)
Sets hint whether projection is orthogonal or perspectival.
const math::Matrix4f & projection() const
References the projection matrix of this camera. The projection matrix maps from view space to clippi...
Represents a spatial scene element. It's location is determined relatively to another spatial that is...
Definition Spatial.hpp:48
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition math.hpp:197