FlightManipulator
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_FLIGHT_MANIPULATOR
#define OSGGA_FLIGHT_MANIPULATOR 1
#include <osgGA/FirstPersonManipulator>
namespace osgGA {
class OSGGA_EXPORT FlightManipulator : public FirstPersonManipulator
{
typedef FirstPersonManipulator inherited;
public:
enum YawControlMode
{
YAW_AUTOMATICALLY_WHEN_BANKED,
NO_AUTOMATIC_YAW
};
FlightManipulator( int flags = UPDATE_MODEL_SIZE | COMPUTE_HOME_USING_BBOX );
FlightManipulator( const FlightManipulator& fpm,
const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY );
META_Object( osgGA, FlightManipulator );
virtual void setYawControlMode( YawControlMode ycm );
inline YawControlMode getYawControlMode() const;
virtual void home( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual void init( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual void getUsage( osg::ApplicationUsage& usage ) const;
protected:
virtual bool handleFrame( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMouseMove( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMouseDrag( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMousePush( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleMouseRelease( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool handleKeyDown( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool flightHandleEvent( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
virtual bool performMovement();
virtual bool performMovementLeftMouseButton( const double eventTimeDelta, const double dx, const double dy );
virtual bool performMovementMiddleMouseButton( const double eventTimeDelta, const double dx, const double dy );
virtual bool performMovementRightMouseButton( const double eventTimeDelta, const double dx, const double dy );
YawControlMode _yawMode;
};
//
// inline methods
//
inline FlightManipulator::YawControlMode FlightManipulator::getYawControlMode() const { return _yawMode; }
}
#endif /* OSGGA_FLIGHT_MANIPULATOR */
FirstPersonManipulator
osgGA::FirstPersonManipulator::FirstPersonManipulator
FirstPersonManipulator(int flags=DEFAULT_SETTINGS)
osgGA::FlightManipulator::flightHandleEvent
virtual bool flightHandleEvent(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::handleFrame
virtual bool handleFrame(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::init
virtual void init(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::home
virtual void home(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::getUsage
virtual void getUsage(osg::ApplicationUsage &usage) const
osgGA::FlightManipulator::performMovementRightMouseButton
virtual bool performMovementRightMouseButton(const double eventTimeDelta, const double dx, const double dy)
osgGA::FlightManipulator::FlightManipulator
FlightManipulator(const FlightManipulator &fpm, const osg::CopyOp &copyOp=osg::CopyOp::SHALLOW_COPY)
osgGA::FlightManipulator::FlightManipulator
FlightManipulator(int flags=UPDATE_MODEL_SIZE|COMPUTE_HOME_USING_BBOX)
osgGA::FlightManipulator::handleMouseMove
virtual bool handleMouseMove(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::META_Object
META_Object(osgGA, FlightManipulator)
osgGA::FlightManipulator::performMovementLeftMouseButton
virtual bool performMovementLeftMouseButton(const double eventTimeDelta, const double dx, const double dy)
osgGA::FlightManipulator::setYawControlMode
virtual void setYawControlMode(YawControlMode ycm)
osgGA::FlightManipulator::getYawControlMode
YawControlMode getYawControlMode() const
Returns the Yaw control for the flight model.
Definition FlightManipulator:78
osgGA::FlightManipulator::handleMouseDrag
virtual bool handleMouseDrag(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::performMovementMiddleMouseButton
virtual bool performMovementMiddleMouseButton(const double eventTimeDelta, const double dx, const double dy)
osgGA::FlightManipulator::YawControlMode
YawControlMode
Definition FlightManipulator:35
osgGA::FlightManipulator::YAW_AUTOMATICALLY_WHEN_BANKED
@ YAW_AUTOMATICALLY_WHEN_BANKED
Definition FlightManipulator:36
osgGA::FlightManipulator::NO_AUTOMATIC_YAW
@ NO_AUTOMATIC_YAW
Definition FlightManipulator:37
osgGA::FlightManipulator::_yawMode
YawControlMode _yawMode
Definition FlightManipulator:68
osgGA::FlightManipulator::handleMousePush
virtual bool handleMousePush(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::handleMouseRelease
virtual bool handleMouseRelease(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::handleKeyDown
virtual bool handleKeyDown(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
osgGA::FlightManipulator::performMovement
virtual bool performMovement()
osgGA::GUIActionAdapter
Definition GUIActionAdapter:62
osgGA::GUIEventAdapter
Definition GUIEventAdapter:82
osgGA::StandardManipulator::COMPUTE_HOME_USING_BBOX
@ COMPUTE_HOME_USING_BBOX
Definition StandardManipulator:40
osgGA::StandardManipulator::UPDATE_MODEL_SIZE
@ UPDATE_MODEL_SIZE
Definition StandardManipulator:39
osg::ApplicationUsage
Definition ApplicationUsage:26
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osgGA
Definition Callback:21
OSGGA_EXPORT
#define OSGGA_EXPORT
Definition osgGA/Export:40