OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FlightManipulator.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 OSGGA_FLIGHT_MANIPULATOR
15 #define OSGGA_FLIGHT_MANIPULATOR 1
16 
17 #include <osgGA/FirstPersonManipulator>
18 
19 
20 namespace osgGA {
21 
22 
29 {
31 
32  public:
33 
35  {
37  NO_AUTOMATIC_YAW
38  };
39 
40  FlightManipulator( int flags = UPDATE_MODEL_SIZE | COMPUTE_HOME_USING_BBOX );
42  const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY );
43 
45 
46  virtual void setYawControlMode( YawControlMode ycm );
47  inline YawControlMode getYawControlMode() const;
48 
49  virtual void home( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
50  virtual void init( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
51  virtual void getUsage( osg::ApplicationUsage& usage ) const;
52 
53  protected:
54 
55  virtual bool handleFrame( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
56  virtual bool handleMouseMove( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
57  virtual bool handleMouseDrag( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
58  virtual bool handleMousePush( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
59  virtual bool handleMouseRelease( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
60  virtual bool handleKeyDown( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
61  virtual bool flightHandleEvent( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
62 
63  virtual bool performMovement();
64  virtual bool performMovementLeftMouseButton( const double eventTimeDelta, const double dx, const double dy );
65  virtual bool performMovementMiddleMouseButton( const double eventTimeDelta, const double dx, const double dy );
66  virtual bool performMovementRightMouseButton( const double eventTimeDelta, const double dx, const double dy );
67 
69 
70 };
71 
72 
73 //
74 // inline methods
75 //
76 
79 
80 
81 }
82 
83 #endif /* OSGGA_FLIGHT_MANIPULATOR */
YawControlMode getYawControlMode() const
Returns the Yaw control for the flight model.
#define OSGGA_EXPORT
Definition: Export.h:40
#define META_Object(library, name)
Definition: Object.h:42