Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PerspectiveCamera.h
Go to the documentation of this file.
1 
2 /* Copyright (c) 2014-2016 "Omnidome" by cr8tr
3  * Dome Mapping Projection Software (http://omnido.me).
4  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
5  *
6  * This file is part of Omnidome.
7  *
8  * Omnidome is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Affero General Public License as
10  * published by the Free Software Foundation, either version 3 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Affero General Public License for more details.
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef OMNI_VISUAL_PERSPECTIVECAMERA_H_
22 #define OMNI_VISUAL_PERSPECTIVECAMERA_H_
23 
25 
26 namespace omni {
27  namespace visual {
28  /// A perspective camera
30  {
31  public:
32  PerspectiveCamera(qreal _fov = 30.0);
33  PerspectiveCamera(const Tracker& _tracker,
34  qreal _fov = 30.0,
35  qreal _near = 0.1,
36  qreal _far = 1000.0,
37  const QVector3D& _up = QVector3D(0.0, 0.0, 1.0));
38 
39  /// Setup perspective camera in OpenGL
40  void setup(qreal _aspect) const;
41 
42  /// Return field of view value
43  qreal fov() const;
44 
45  /// Set new field of view value
46  void setFov(qreal _fov);
47 
48  /// Deserialize from stream
49  void fromStream(QDataStream&);
50 
51  /// Serialize to stream
52  void toStream(QDataStream&) const;
53 
54  /// Test for equality. ScreenSetup is ignored
55  friend bool operator==(PerspectiveCamera const&,
56  PerspectiveCamera const&);
57 
58  private:
59  /// Field of View Angle
60  qreal fov_ = 30.0;
61  };
62  }
63 }
64 
66 
67 #endif /* OMNI_VISUAL_PERSPECTIVECAMERA_H_ */
A generic camera interface.
Definition: CameraInterface.h:29
void fromStream(QDataStream &)
Deserialize from stream.
Definition: PerspectiveCamera.cpp:65
void setup(qreal _aspect) const
Setup perspective camera in OpenGL.
Definition: PerspectiveCamera.cpp:49
qreal fov() const
Return field of view value.
Definition: PerspectiveCamera.cpp:40
void setFov(qreal _fov)
Set new field of view value.
Definition: PerspectiveCamera.cpp:44
qreal fov_
Field of View Angle.
Definition: PerspectiveCamera.h:60
#define OMNI_DECL_STREAM_OPERATORS(CLASS)
Definition: Interface.h:53
A perspective camera.
Definition: PerspectiveCamera.h:29
Definition: Tracker.h:27
friend bool operator==(PerspectiveCamera const &, PerspectiveCamera const &)
Test for equality. ScreenSetup is ignored.
Definition: PerspectiveCamera.cpp:77
void toStream(QDataStream &) const
Serialize to stream.
Definition: PerspectiveCamera.cpp:71
PerspectiveCamera(qreal _fov=30.0)
Definition: PerspectiveCamera.cpp:25