OpenSceneGraph 3.6.5
CameraView
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
23namespace osg {
24
30{
31 public :
33
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
72
75
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
101};
102
103}
104
105#endif
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Matrixd Matrix
Definition Matrix:27
void setFieldOfViewMode(FieldOfViewMode mode)
Set the field of view mode - controlling how the field of view of the camera is constrained by the Ca...
Definition CameraView:74
FieldOfViewMode
Definition CameraView:67
@ HORIZONTAL
Definition CameraView:69
@ VERTICAL
Definition CameraView:70
@ UNCONSTRAINED
Definition CameraView:68
virtual ~CameraView()
Definition CameraView:94
Quat _attitude
Definition CameraView:97
void setFocalLength(double focalLength)
Set the focal length of the camera.
Definition CameraView:82
void setFieldOfView(double fieldOfView)
Set the field of view.
Definition CameraView:61
FieldOfViewMode _fieldOfViewMode
Definition CameraView:99
double _focalLength
Definition CameraView:100
double getFocalLength() const
Get the focal length of the camera.
Definition CameraView:85
void setAttitude(const Quat &quat)
Set the attitude of the camera view.
Definition CameraView:52
virtual bool computeLocalToWorldMatrix(Matrix &matrix, NodeVisitor *nv) const
void setPosition(const Vec3d &pos)
Set the position of the camera view.
Definition CameraView:46
Vec3d _position
Definition CameraView:96
double _fieldOfView
Definition CameraView:98
const Quat & getAttitude() const
Get the attitude of the camera view.
Definition CameraView:55
double getFieldOfView() const
Get the field of view.
Definition CameraView:64
virtual bool computeWorldToLocalMatrix(Matrix &matrix, NodeVisitor *nv) const
FieldOfViewMode getFieldOfViewMode() const
Get the field of view mode.
Definition CameraView:77
CameraView(const CameraView &pat, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition CameraView:34
META_Node(osg, CameraView)
const Vec3d & getPosition() const
Get the position of the camera view.
Definition CameraView:49
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
void dirtyBound()
Mark this node's bounding sphere dirty.
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
A quaternion class.
Definition Quat:30
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.