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_WALKENGINE_H_
40 #define _OSG_WALKENGINE_H_
42 #include "OSGConfig.h"
43 #include "OSGUtilDef.h"
45 #include "OSGVector.h"
46 #include "OSGQuaternion.h"
47 #include "OSGViewport.h"
48 #include "OSGFlyEngine.h"
49 #include "OSGIntersectAction.h"
53 /*! \brief Base class for all navigator engines.
54 \ingroup GrpUtilNavigation
55 \ingroup GrpLibOSGUtil
58 class OSG_UTIL_DLLMAPPING WalkEngine
: public FlyEngine
60 typedef FlyEngine Inherited
;
61 typedef WalkEngine Self
;
63 /*========================== PUBLIC =================================*/
67 /*---------------------------------------------------------------------*/
71 OSG_GEN_INTERNAL_MEMOBJPTR(WalkEngine
);
74 /*---------------------------------------------------------------------*/
75 /*! \name Construction */
78 static ObjTransitPtr
create(void);
81 /*---------------------------------------------------------------------*/
82 /*! \name Class Get */
85 const char *getClassname(void) { return "WalkEngine"; }
88 /*---------------------------------------------------------------------*/
93 /*---------------------------------------------------------------------*/
97 void setGround (Node
* const new_ground
);
98 void setWorld (Node
* const new_world
);
100 void setGroundDistance (Real32 groundDistance
);
101 void setMinWallDistance (Real32 wallDistance
);
103 void setPersonDimensions(Real32 height
, Real32 width
, Real32 fatness
);
106 /*---------------------------------------------------------------------*/
107 /*! \name navigator engine callbacks */
110 virtual void idle(Int16 buttons
, Int16 x
, Int16 y
, Navigator
* nav
);
112 virtual void onViewportChanged(Navigator
* nav
);
115 /*---------------------------------------------------------------------*/
116 /*! \name Walker Transformations */
119 virtual void rotate (Real32 deltaX
, Real32 deltaY
);
120 virtual Real32
forward(Real32 step
);
121 virtual Real32
right (Real32 step
);
124 /*========================== PROTECTED ==============================*/
128 /*---------------------------------------------------------------------*/
129 /*! \name Constructors/Destructor */
133 virtual ~WalkEngine(void);
135 /*---------------------------------------------------------------------*/
142 Real32 _groundDistance
;
143 Real32 _wallDistance
;
148 IntersectActionRefPtr _act
;
154 /* Not implemented */
155 WalkEngine(const WalkEngine
&other
);
156 WalkEngine
&operator =(const WalkEngine
&other
);
159 OSG_GEN_MEMOBJPTR(WalkEngine
);