UFOManipulator
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 OSGGA_UFO_MANIPULATOR_DEF
#define OSGGA_UFO_MANIPULATOR_DEF 1
#include <iostream>
#include <osgGA/CameraManipulator>
#include <osg/Node>
#include <osg/Matrix>
namespace osgGA {
class OSGGA_EXPORT UFOManipulator : public osgGA::CameraManipulator
{
public:
UFOManipulator();
virtual const char* className() const;
virtual void setByMatrix( const osg::Matrixd &matrix ) ;
virtual void setByInverseMatrix( const osg::Matrixd &invmat);
virtual osg::Matrixd getMatrix() const;
virtual osg::Matrixd getInverseMatrix() const ;
virtual void setNode(osg::Node* node);
virtual const osg::Node* getNode() const;
virtual osg::Node* getNode();
virtual void computeHomePosition();
virtual void home(const osgGA::GUIEventAdapter&, osgGA::GUIActionAdapter&) ;
void home(double);
virtual void init(const GUIEventAdapter& ,GUIActionAdapter&);
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter &aa);
void getUsage(osg::ApplicationUsage& usage) const;
void getCurrentPositionAsLookAt( osg::Vec3d& eye, osg::Vec3d& center, osg::Vec3d& up );
void setMinHeight( double in_min_height ) { _minHeightAboveGround = in_min_height; }
double getMinHeight() const { return _minHeightAboveGround; }
void setMinDistance( double in_min_dist ) { _minDistanceInFront = in_min_dist; }
double getMinDistance() const { return _minDistanceInFront; }
void setForwardSpeed( double in_fs ) { _forwardSpeed = in_fs; }
double getForwardSpeed() const { return _forwardSpeed; }
void setSideSpeed( double in_ss ) { _sideSpeed = in_ss; }
double getSideSpeed() const { return _sideSpeed; }
void setRotationSpeed( double in_rot_speed ) { _directionRotationRate = in_rot_speed; }
double getRotationSpeed() const { return _directionRotationRate; }
protected:
virtual ~UFOManipulator();
bool intersect(const osg::Vec3d& start, const osg::Vec3d& end, osg::Vec3d& intersection) const;
osg::observer_ptr<osg::Node> _node;
osg::Matrixd _matrix;
osg::Matrixd _inverseMatrix;
osg::Matrixd _offset;
double _minHeightAboveGround;
double _minDistanceInFront;
double _speedEpsilon;
double _forwardSpeed;
double _sideSpeed;
double _upSpeed;
double _speedAccelerationFactor;
double _speedDecelerationFactor;
bool _decelerateUpSideRate;
double _directionRotationEpsilon;
double _directionRotationRate;
double _directionRotationAcceleration;
double _directionRotationDeceleration;
double _viewOffsetDelta;
double _pitchOffsetRate;
double _pitchOffset;
double _yawOffsetRate;
double _yawOffset;
double _t0;
double _dt;
osg::Vec3d _direction;
osg::Vec3d _position;
bool _shift;
bool _ctrl;
bool _decelerateOffsetRate;
bool _straightenOffset;
void _stop();
void _keyDown( const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &);
void _keyUp( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter &);
void _frame(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter &);
void _adjustPosition();
};
}
#endif
CameraManipulator
Matrix
Node
osgGA::CameraManipulator
Definition CameraManipulator:40
osgGA::GUIActionAdapter
Definition GUIActionAdapter:62
osgGA::GUIEventAdapter
Definition GUIEventAdapter:82
osgGA::UFOManipulator::_stop
void _stop()
osgGA::UFOManipulator::_viewOffsetDelta
double _viewOffsetDelta
Definition UFOManipulator:159
osgGA::UFOManipulator::_decelerateOffsetRate
bool _decelerateOffsetRate
Definition UFOManipulator:173
osgGA::UFOManipulator::getRotationSpeed
double getRotationSpeed() const
Definition UFOManipulator:128
osgGA::UFOManipulator::home
void home(double)
osgGA::UFOManipulator::setForwardSpeed
void setForwardSpeed(double in_fs)
Definition UFOManipulator:121
osgGA::UFOManipulator::computeHomePosition
virtual void computeHomePosition()
osgGA::UFOManipulator::_speedEpsilon
double _speedEpsilon
Definition UFOManipulator:145
osgGA::UFOManipulator::_node
osg::observer_ptr< osg::Node > _node
Definition UFOManipulator:137
osgGA::UFOManipulator::UFOManipulator
UFOManipulator()
osgGA::UFOManipulator::getNode
virtual const osg::Node * getNode() const
osgGA::UFOManipulator::setByMatrix
virtual void setByMatrix(const osg::Matrixd &matrix)
osgGA::UFOManipulator::_adjustPosition
void _adjustPosition()
osgGA::UFOManipulator::_offset
osg::Matrixd _offset
Definition UFOManipulator:140
osgGA::UFOManipulator::_ctrl
bool _ctrl
Definition UFOManipulator:172
osgGA::UFOManipulator::_directionRotationRate
double _directionRotationRate
Definition UFOManipulator:155
osgGA::UFOManipulator::_directionRotationEpsilon
double _directionRotationEpsilon
Definition UFOManipulator:154
osgGA::UFOManipulator::setByInverseMatrix
virtual void setByInverseMatrix(const osg::Matrixd &invmat)
osgGA::UFOManipulator::_shift
bool _shift
Definition UFOManipulator:171
osgGA::UFOManipulator::home
virtual void home(const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &)
osgGA::UFOManipulator::getCurrentPositionAsLookAt
void getCurrentPositionAsLookAt(osg::Vec3d &eye, osg::Vec3d &center, osg::Vec3d &up)
osgGA::UFOManipulator::_inverseMatrix
osg::Matrixd _inverseMatrix
Definition UFOManipulator:139
osgGA::UFOManipulator::_directionRotationDeceleration
double _directionRotationDeceleration
Definition UFOManipulator:157
osgGA::UFOManipulator::getMinHeight
double getMinHeight() const
Definition UFOManipulator:116
osgGA::UFOManipulator::_pitchOffset
double _pitchOffset
Definition UFOManipulator:161
osgGA::UFOManipulator::getNode
virtual osg::Node * getNode()
osgGA::UFOManipulator::_t0
double _t0
Definition UFOManipulator:165
osgGA::UFOManipulator::getMinDistance
double getMinDistance() const
Definition UFOManipulator:119
osgGA::UFOManipulator::~UFOManipulator
virtual ~UFOManipulator()
osgGA::UFOManipulator::_keyUp
void _keyUp(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
osgGA::UFOManipulator::_yawOffsetRate
double _yawOffsetRate
Definition UFOManipulator:162
osgGA::UFOManipulator::_dt
double _dt
Definition UFOManipulator:166
osgGA::UFOManipulator::_frame
void _frame(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
osgGA::UFOManipulator::getMatrix
virtual osg::Matrixd getMatrix() const
osgGA::UFOManipulator::getForwardSpeed
double getForwardSpeed() const
Definition UFOManipulator:122
osgGA::UFOManipulator::_minDistanceInFront
double _minDistanceInFront
Definition UFOManipulator:143
osgGA::UFOManipulator::_sideSpeed
double _sideSpeed
Definition UFOManipulator:147
osgGA::UFOManipulator::setNode
virtual void setNode(osg::Node *node)
osgGA::UFOManipulator::setSideSpeed
void setSideSpeed(double in_ss)
Definition UFOManipulator:124
osgGA::UFOManipulator::setMinHeight
void setMinHeight(double in_min_height)
Definition UFOManipulator:115
osgGA::UFOManipulator::getUsage
void getUsage(osg::ApplicationUsage &usage) const
osgGA::UFOManipulator::_direction
osg::Vec3d _direction
Definition UFOManipulator:167
osgGA::UFOManipulator::_straightenOffset
bool _straightenOffset
Definition UFOManipulator:175
osgGA::UFOManipulator::className
virtual const char * className() const
osgGA::UFOManipulator::_keyDown
void _keyDown(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
osgGA::UFOManipulator::getSideSpeed
double getSideSpeed() const
Definition UFOManipulator:125
osgGA::UFOManipulator::_position
osg::Vec3d _position
Definition UFOManipulator:168
osgGA::UFOManipulator::_pitchOffsetRate
double _pitchOffsetRate
Definition UFOManipulator:160
osgGA::UFOManipulator::setRotationSpeed
void setRotationSpeed(double in_rot_speed)
Definition UFOManipulator:127
osgGA::UFOManipulator::setMinDistance
void setMinDistance(double in_min_dist)
Definition UFOManipulator:118
osgGA::UFOManipulator::_speedDecelerationFactor
double _speedDecelerationFactor
Definition UFOManipulator:150
osgGA::UFOManipulator::_speedAccelerationFactor
double _speedAccelerationFactor
Definition UFOManipulator:149
osgGA::UFOManipulator::intersect
bool intersect(const osg::Vec3d &start, const osg::Vec3d &end, osg::Vec3d &intersection) const
osgGA::UFOManipulator::_upSpeed
double _upSpeed
Definition UFOManipulator:148
osgGA::UFOManipulator::_yawOffset
double _yawOffset
Definition UFOManipulator:163
osgGA::UFOManipulator::init
virtual void init(const GUIEventAdapter &, GUIActionAdapter &)
osgGA::UFOManipulator::_forwardSpeed
double _forwardSpeed
Definition UFOManipulator:146
osgGA::UFOManipulator::_directionRotationAcceleration
double _directionRotationAcceleration
Definition UFOManipulator:156
osgGA::UFOManipulator::_minHeightAboveGround
double _minHeightAboveGround
Definition UFOManipulator:142
osgGA::UFOManipulator::getInverseMatrix
virtual osg::Matrixd getInverseMatrix() const
osgGA::UFOManipulator::handle
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
osgGA::UFOManipulator::_matrix
osg::Matrixd _matrix
Definition UFOManipulator:138
osgGA::UFOManipulator::_decelerateUpSideRate
bool _decelerateUpSideRate
Definition UFOManipulator:152
osg::ApplicationUsage
Definition ApplicationUsage:26
osg::Matrixd
Definition Matrixd:27
osg::Node
Definition Node:72
osg::Vec3d
Definition Vec3d:30
osg::observer_ptr
Definition observer_ptr:39
osgGA
Definition Callback:21
OSGGA_EXPORT
#define OSGGA_EXPORT
Definition osgGA/Export:40