Show
Ignore:
Timestamp:
11/26/07 22:53:32 (1 year ago)
Author:
vossg
Message:

changed: more flexible navigators, allow user navigator (thanks to M. Spindler for the code)

: add _d when pulling windows dlls

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/System/Window/Utilities/OSGWalkEngine.h

    r106 r1021  
    33 *                                                                           * 
    44 *                                                                           * 
    5  *             Copyright (C) 2000,2001 by the OpenSG Forum                   * 
     5 *             Copyright (C) 2000-2002 by the OpenSG Forum                   * 
    66 *                                                                           * 
    77 *                            www.opensg.org                                 * 
     
    3737\*---------------------------------------------------------------------------*/ 
    3838 
    39 #ifndef _OSG_WALKNAVIGATOR_H_ 
    40 #define _OSG_WALKNAVIGATOR_H_ 
     39#ifndef _OSG_WALKENGINE_H_ 
     40#define _OSG_WALKENGINE_H_ 
    4141 
    42 #include "OSGFlyNavigator.h" 
    43 #include "OSGIntersectAction.h" 
     42#include "OSGConfig.h" 
     43#include "OSGUtilDef.h" 
     44 
     45#include "OSGVector.h" 
     46#include "OSGQuaternion.h" 
     47#include "OSGViewport.h" 
     48#include "OSGFlyEngine.h" 
    4449 
    4550OSG_BEGIN_NAMESPACE 
    4651 
    47 /*! \brief WalkNavigator class 
    48  */ 
     52/*! \brief Base class for all navigator engines. 
     53*/ 
     54class OSG_UTIL_DLLMAPPING WalkEngine : public FlyEngine 
     55
     56    typedef FlyEngine Inherited; 
    4957 
    50 class OSG_UTIL_DLLMAPPING WalkNavigator: public FlyNavigator 
    51 { 
    5258    /*==========================  PUBLIC  =================================*/ 
    5359  public: 
     60 
     61 
     62 
    5463    /*---------------------------------------------------------------------*/ 
    5564    /*! \name                   Constructors                               */ 
    5665    /*! \{                                                                 */ 
    5766 
    58     WalkNavigator(); 
     67    WalkEngine(void); 
    5968 
    6069    /*! \}                                                                 */ 
     
    6372    /*! \{                                                                 */ 
    6473 
    65     ~WalkNavigator(); 
     74    ~WalkEngine(void); 
     75 
     76    /*! \}                                                                 */ 
     77    /*---------------------------------------------------------------------*/ 
     78    /*! \name                    Class Get                                 */ 
     79    /*! \{                                                                 */ 
     80 
     81    const char *getClassname(void) { return "WalkEngine"; } 
    6682 
    6783    /*! \}                                                                 */ 
     
    7490    /*! \name                        Set                                   */ 
    7591    /*! \{                                                                 */ 
    76      
     92 
    7793    void setGround  (const NodePtr &new_ground); 
    7894    void setWorld   (const NodePtr &new_world ); 
     
    8298 
    8399    void setPersonDimensions(Real32 height, Real32 width, Real32 fatness); 
    84      
     100 
     101    /*! \}                                                                 */ 
     102    /*---------------------------------------------------------------------*/ 
     103    /*! \name              navigator engine callbacks                      */ 
     104    /*! \{                                                                 */ 
     105 
     106    virtual void idle(Int16 buttons, Int16 x, Int16 y, Navigator* nav); 
     107 
     108    virtual void onViewportChanged(ViewportPtr new_viewport); 
     109 
    85110    /*! \}                                                                 */ 
    86111    /*---------------------------------------------------------------------*/ 
     
    88113    /*! \{                                                                 */ 
    89114 
    90     void   rotate (Real32 deltaX, Real32 deltaY); 
    91     Real32 forward(Real32 step); 
    92     Real32 right  (Real32 step); 
     115    virtual void   rotate (Real32 deltaX, Real32 deltaY); 
     116    virtual Real32 forward(Real32 step); 
     117    virtual Real32 right  (Real32 step); 
    93118 
    94119    /*! \}                                                                 */ 
    95     /*==========================  PRIVATE  ================================*/ 
    96   private: 
     120    /*==========================  PROTECTED  ==============================*/ 
     121  protected: 
     122     
    97123    /*---------------------------------------------------------------------*/ 
    98124    /*! \name                     Members                                  */ 
    99     /*! \{                                                                 */     
    100    
     125    /*! \{                                                                 */ 
     126 
    101127    NodePtr _ground; 
    102128    NodePtr _world; 
     
    109135     
    110136    IntersectAction *_act; 
    111            
     137 
    112138    /*! \}                                                                 */ 
     139 
     140  private: 
     141    /* Not implemented */ 
     142    WalkEngine(const WalkEngine &other); 
     143    WalkEngine &operator =(const WalkEngine &other); 
    113144}; 
    114145 
    115146OSG_END_NAMESPACE 
     147 
    116148#endif