OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CameraView.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSG_CAMERAVIEW
15 #define OSG_CAMERAVIEW 1
16 
17 #include <osg/Group>
18 #include <osg/Transform>
19 #include <osg/AnimationPath>
20 #include <osg/Vec3d>
21 #include <osg/Quat>
22 
23 namespace osg {
24 
30 {
31  public :
32  CameraView();
33 
34  CameraView(const CameraView& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
35  Transform(pat,copyop),
36  _position(pat._position),
37  _attitude(pat._attitude),
38  _fieldOfView(pat._fieldOfView),
39  _fieldOfViewMode(pat._fieldOfViewMode),
40  _focalLength(pat._focalLength) {}
41 
42 
44 
46  inline void setPosition(const Vec3d& pos) { _position = pos; dirtyBound(); }
47 
49  inline const Vec3d& getPosition() const { return _position; }
50 
52  inline void setAttitude(const Quat& quat) { _attitude = quat; dirtyBound(); }
53 
55  inline const Quat& getAttitude() const { return _attitude; }
56 
61  inline void setFieldOfView(double fieldOfView) { _fieldOfView = fieldOfView; }
62 
64  inline double getFieldOfView() const { return _fieldOfView; }
65 
67  {
70  VERTICAL
71  };
72 
74  inline void setFieldOfViewMode(FieldOfViewMode mode) { _fieldOfViewMode = mode; }
75 
77  inline FieldOfViewMode getFieldOfViewMode() const { return _fieldOfViewMode; }
78 
82  inline void setFocalLength(double focalLength) { _focalLength = focalLength; }
83 
85  inline double getFocalLength() const { return _focalLength; }
86 
87 
88  virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
89  virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
90 
91 
92  protected :
93 
94  virtual ~CameraView() {}
95 
98  double _fieldOfView;
100  double _focalLength;
101 };
102 
103 }
104 
105 #endif
const Vec3d & getPosition() const
Definition: CameraView.h:49
#define OSG_EXPORT
Definition: Export.h:43
virtual ~CameraView()
Definition: CameraView.h:94
void setFieldOfView(double fieldOfView)
Definition: CameraView.h:61
#define META_Node(library, name)
Definition: Node.h:59
void setFocalLength(double focalLength)
Definition: CameraView.h:82
void setPosition(const Vec3d &pos)
Definition: CameraView.h:46
FieldOfViewMode _fieldOfViewMode
Definition: CameraView.h:99
void setAttitude(const Quat &quat)
Definition: CameraView.h:52
FieldOfViewMode getFieldOfViewMode() const
Definition: CameraView.h:77
void setFieldOfViewMode(FieldOfViewMode mode)
Definition: CameraView.h:74
const Quat & getAttitude() const
Definition: CameraView.h:55
double _focalLength
Definition: CameraView.h:100
double getFieldOfView() const
Definition: CameraView.h:64
double getFocalLength() const
Definition: CameraView.h:85
double _fieldOfView
Definition: CameraView.h:98
Definition: AlphaFunc.h:19
CameraView(const CameraView &pat, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition: CameraView.h:34
Definition: Quat.h:29