1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSG_FLYENGINE_H_
40 #define _OSG_FLYENGINE_H_
42 #include "OSGConfig.h"
43 #include "OSGUtilDef.h"
45 #include "OSGVector.h"
46 #include "OSGQuaternion.h"
47 #include "OSGViewport.h"
48 #include "OSGNavigatorEngine.h"
52 /*! \brief Navigator engine for simple fly model. See \ref
53 PageSystemWindowNavigatorsFly for a description.
54 \ingroup GrpUtilNavigation
55 \ingroup GrpLibOSGUtil
58 class OSG_UTIL_DLLMAPPING FlyEngine
: public NavigatorEngine
60 typedef NavigatorEngine Inherited
;
61 typedef FlyEngine Self
;
63 /*========================== PUBLIC =================================*/
67 /*---------------------------------------------------------------------*/
71 OSG_GEN_INTERNAL_MEMOBJPTR(FlyEngine
);
74 /*---------------------------------------------------------------------*/
75 /*! \name Construction */
78 static ObjTransitPtr
create(void);
81 /*---------------------------------------------------------------------*/
82 /*! \name Class Get */
85 const char *getClassname(void) { return "FlyEngine"; }
88 /*---------------------------------------------------------------------*/
92 virtual const Pnt3f
&getFrom (void);
93 virtual const Pnt3f
&getAt (void);
94 virtual const Vec3f
&getUp (void);
95 virtual const Matrix
&getMatrix (void);
96 virtual Real32
getDistance(void);
99 /*---------------------------------------------------------------------*/
103 virtual void setFrom ( Pnt3f new_from
);
104 virtual void setAt ( Pnt3f new_at
);
105 virtual void setUp ( Vec3f new_up
);
106 virtual void set ( Pnt3f new_from
,
109 virtual void set (const Matrix
&new_matrix
);
110 virtual void setDistance( Real32 dist
);
113 /*---------------------------------------------------------------------*/
114 /*! \name navigator engine callbacks */
117 virtual void buttonPress (Int16 button
,
121 virtual void buttonRelease(Int16
,
125 virtual void keyPress (Int16 key
,
129 virtual void moveTo (Int16 x
,
132 virtual void idle (Int16 buttons
,
138 /*---------------------------------------------------------------------*/
139 /*! \name Flyer Transformations */
142 virtual void rotate (Real32 deltaX
,
144 virtual Real32
forward(Real32 step
);
145 virtual Real32
right (Real32 step
);
148 /*========================== PROTECTED ==============================*/
152 /*---------------------------------------------------------------------*/
153 /*! \name Constructors/Destructor */
157 virtual ~FlyEngine(void);
160 /*---------------------------------------------------------------------*/
170 /*---------------------------------------------------------------------*/
174 /* Not implemented */
175 FlyEngine(const FlyEngine
&other
);
176 FlyEngine
&operator =(const FlyEngine
&other
);
179 OSG_GEN_MEMOBJPTR(FlyEngine
);