CameraView
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_CAMERAVIEW
#define OSG_CAMERAVIEW 1
#include <osg/Group>
#include <osg/Transform>
#include <osg/AnimationPath>
#include <osg/Vec3d>
#include <osg/Quat>
namespace osg {
class OSG_EXPORT CameraView : public Transform
{
public :
CameraView();
CameraView(const CameraView& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Transform(pat,copyop),
_position(pat._position),
_attitude(pat._attitude),
_fieldOfView(pat._fieldOfView),
_fieldOfViewMode(pat._fieldOfViewMode),
_focalLength(pat._focalLength) {}
META_Node(osg, CameraView);
inline void setPosition(const Vec3d& pos) { _position = pos; dirtyBound(); }
inline const Vec3d& getPosition() const { return _position; }
inline void setAttitude(const Quat& quat) { _attitude = quat; dirtyBound(); }
inline const Quat& getAttitude() const { return _attitude; }
inline void setFieldOfView(double fieldOfView) { _fieldOfView = fieldOfView; }
inline double getFieldOfView() const { return _fieldOfView; }
enum FieldOfViewMode
{
UNCONSTRAINED,
HORIZONTAL,
VERTICAL
};
inline void setFieldOfViewMode(FieldOfViewMode mode) { _fieldOfViewMode = mode; }
inline FieldOfViewMode getFieldOfViewMode() const { return _fieldOfViewMode; }
inline void setFocalLength(double focalLength) { _focalLength = focalLength; }
inline double getFocalLength() const { return _focalLength; }
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
protected :
virtual ~CameraView() {}
Vec3d _position;
Quat _attitude;
double _fieldOfView;
FieldOfViewMode _fieldOfViewMode;
double _focalLength;
};
}
#endif
AnimationPath
Group
Quat
Transform
Vec3d
osg::CameraView::setFieldOfViewMode
void setFieldOfViewMode(FieldOfViewMode mode)
Definition CameraView:74
osg::CameraView::FieldOfViewMode
FieldOfViewMode
Definition CameraView:67
osg::CameraView::HORIZONTAL
@ HORIZONTAL
Definition CameraView:69
osg::CameraView::VERTICAL
@ VERTICAL
Definition CameraView:70
osg::CameraView::UNCONSTRAINED
@ UNCONSTRAINED
Definition CameraView:68
osg::CameraView::~CameraView
virtual ~CameraView()
Definition CameraView:94
osg::CameraView::_attitude
Quat _attitude
Definition CameraView:97
osg::CameraView::setFocalLength
void setFocalLength(double focalLength)
Definition CameraView:82
osg::CameraView::setFieldOfView
void setFieldOfView(double fieldOfView)
Definition CameraView:61
osg::CameraView::_fieldOfViewMode
FieldOfViewMode _fieldOfViewMode
Definition CameraView:99
osg::CameraView::_focalLength
double _focalLength
Definition CameraView:100
osg::CameraView::getFocalLength
double getFocalLength() const
Definition CameraView:85
osg::CameraView::setAttitude
void setAttitude(const Quat &quat)
Definition CameraView:52
osg::CameraView::computeLocalToWorldMatrix
virtual bool computeLocalToWorldMatrix(Matrix &matrix, NodeVisitor *nv) const
osg::CameraView::setPosition
void setPosition(const Vec3d &pos)
Definition CameraView:46
osg::CameraView::_position
Vec3d _position
Definition CameraView:96
osg::CameraView::_fieldOfView
double _fieldOfView
Definition CameraView:98
osg::CameraView::getAttitude
const Quat & getAttitude() const
Definition CameraView:55
osg::CameraView::getFieldOfView
double getFieldOfView() const
Definition CameraView:64
osg::CameraView::computeWorldToLocalMatrix
virtual bool computeWorldToLocalMatrix(Matrix &matrix, NodeVisitor *nv) const
osg::CameraView::getFieldOfViewMode
FieldOfViewMode getFieldOfViewMode() const
Definition CameraView:77
osg::CameraView::CameraView
CameraView(const CameraView &pat, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition CameraView:34
osg::CameraView::CameraView
CameraView()
osg::CameraView::META_Node
META_Node(osg, CameraView)
osg::CameraView::getPosition
const Vec3d & getPosition() const
Definition CameraView:49
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::NodeVisitor
Definition NodeVisitor:82
osg::Node::dirtyBound
void dirtyBound()
osg::Quat
Definition Quat:30
osg::Transform::Transform
Transform()
osg::Vec3d
Definition Vec3d:30
osg
Definition AlphaFunc:19
osg::Matrix
Matrixd Matrix
Definition Matrix:27
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39