Changeset 1913

Show
Ignore:
Timestamp:
05/12/00 17:15:53 (9 years ago)
Author:
kevn
Message:

pfNav now works with the new navigation system
pfNav is very much like the old CAVE style one now.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/juggler_1.0/samples/pf/pfNav/Makefile.in

    r1891 r1913  
    1212COMPILE         = @CXX@ @DEFS@ $(VJ_INCLUDES) @CPPFLAGS@ @CXXFLAGS@ @DBG_FLAGS@ 
    1313LINK            = @CXX@ @CPPFLAGS@ @CXXFLAGS@ @EXTRA_LINK_FLAGS@ 
    14 VJ_INCLUDES     = @INCLUDES@ -I$(VJ_BASE_DIR)/include -I$(srcdir) -I$(srcdir)/../nav 
     14VJ_INCLUDES     = @INCLUDES@ -I$(VJ_BASE_DIR)/include -I$(VJ_BASE_DIR)/include/Math -I$(srcdir) -I$(srcdir)/../nav 
    1515VJ_LIBS         = @TEST_VJ_LIBS_BASIC@ @TEST_VJ_LIBS_GL@ @TEST_VJ_LIBS_PF@ @TEST_LIBS_BASIC@ 
    1616VPATH           = @srcdir@ 
     
    3030EXTRA_LIBS      = @TEST_EXTRA_LIBS_BASIC@ @TEST_EXTRA_LIBS_PF@ @TEST_EXTRA_LIBS_GL@ 
    3131 
    32 OBJECTS         = pfNav.@OBJ_FILE_SUFFIX@ 
     32OBJECTS         = pfNav.@OBJ_FILE_SUFFIX@ ../nav/pfTerryCollide.@OBJ_FILE_SUFFIX@ ../nav/pfTerryPogoCollide.@OBJ_FILE_SUFFIX@ ../nav/pfTerryBoxCollide.@OBJ_FILE_SUFFIX@ 
    3333 
    3434# ----------------------------------------------------------------------------- 
  • trunk/juggler_1.0/samples/pf/pfNav/pfNav.cpp

    r1888 r1913  
    4949    // --- VR Juggler Stuff --- // 
    5050#include <Kernel/vjKernel.h> 
    51 #include <Kernel/Pf/vjPfApp.h> 
     51#include <Kernel/Pf/vjPfApp.h>    // the performer application base type 
    5252#include <Kernel/vjDebug.h> 
    53 #include <Kernel/vjProjection.h> 
    54  
    55 #include <pfNaver.h> 
    56 #include <collidor.h> 
    57 #include <planeCollidor.h> 
    58 #include <pfCollidor.h> 
     53#include <Kernel/vjProjection.h>  // for setNearFar (for setting clipping planes) 
     54#include <Input/InputManager/vjPosInterface.h> 
     55#include <Input/InputManager/vjDigitalInterface.h> 
     56 
     57 
     58// nav includes 
     59#include <CaveNavigator.h> 
     60#include <collider.h> 
     61#include <planeCollider.h> 
     62#include <pfPogoCollider.h> 
     63#include <pfRayCollider.h> 
     64#include <pfBoxCollider.h> 
    5965 
    6066char* filename = NULL; 
     
    6268 
    6369// Declare my application class 
    64 class myApp : public vjPfApp 
     70class pfNavJugglerApplication : public vjPfApp 
    6571{ 
    6672public: 
    67    myApp(vjKernel* kern) : vjPfApp(kern) 
    68    { 
    69       //rotation = 0.0f; 
    70       //zPos = 0.0f; 
     73   pfNavJugglerApplication( vjKernel* kern ) : mFpsEmitCount(0), vjPfApp( kern ) 
     74   { 
     75      // get a valid time on the stopwatch... 
     76      stopWatch.stop(); 
     77      stopWatch.start(); 
    7178   } 
    7279 
     
    7582      vjDEBUG(vjDBG_ALL, 1) << "app::init\n" << vjDEBUG_FLUSH; 
    7683      vjProjection::setNearFar(0.5, 1000); 
     84       
     85      mWand.init( "VJWand" ); 
     86      mHead.init( "VJHead" ); 
     87      mActionButton.init( "VJButton0" ); 
     88      mActionButton2.init( "VJButton1" ); 
     89      mModeChangeButton.init( "VJButton2" ); 
    7790   } 
    7891 
     
    8699      // Initialize type system 
    87100      vjDEBUG(vjDBG_ALL,1) << "app::preForkInit: Initializing new types.\n" << vjDEBUG_FLUSH; 
    88       pfNaver::init(); 
    89101 
    90102      // Initialize loaders 
    91    } 
    92  
     103      pfdInitConverter("terrain.flt"); 
     104   } 
     105 
     106   inline void textures( bool state ) const 
     107   { 
     108      if (state == true) 
     109      { 
     110         pfEnable( PFEN_TEXTURE ); 
     111         pfOverride(PFSTATE_ENTEXTURE, PF_ON); 
     112      } 
     113       
     114      else 
     115      { 
     116         pfDisable( PFEN_TEXTURE ); 
     117         pfOverride(PFSTATE_ENTEXTURE, PF_OFF); 
     118      }       
     119   }    
     120    
    93121   /// Initialize the scene graph 
    94122   virtual void initScene() 
     
    103131      rootNode = new pfGroup; 
    104132 
    105       naver = new pfNaver(); 
     133      mNavigationDCS = new pfDCS(); 
    106134 
    107135      sun1 = new pfLightSource; 
     
    111139      sun1->setColor(PFLT_SPECULAR, 1.0f, 1.0f, 1.0f); 
    112140      sun1->on(); 
    113       naver->addChild(sun1); 
     141      mNavigationDCS->addChild(sun1); 
    114142 
    115143      // Light the root node 
     
    128156      //pfNode* obj = pfdLoadFile("/usr/share/Performer/data/klingon.flt"); 
    129157      pfNode* obj = pfdLoadFile( filename ); 
    130       rootNode->addChild(naver); 
     158      rootNode->addChild( mNavigationDCS ); 
    131159 
    132160      pfDCS* world_model = new pfDCS;    // The node with the world under it 
    133       //rootNode->addChild(world_model); 
    134161      world_model->addChild(obj); 
    135162      world_model->setScale(0.25f); 
    136163      world_model->setTrans(0.0,5.0,-5.0); 
    137  
    138       vjMatrix initial_pos; 
    139       initial_pos.setTrans(0,0,0); 
    140       naver->getNavigator()->setCurPos(initial_pos); 
    141       naver->addChild(world_model); 
    142       //*/ 
    143  
     164      mNavigationDCS->addChild(world_model); 
     165       
    144166      // Load the TOWN 
    145        
    146167      //pfFilePath("/usr/share/Performer/data:/usr/share/Performer/data/town"); 
    147168      //pfNode* obj = pfdLoadFile("/usr/share/Performer/data/town/town_ogl_pfi.pfb"); 
    148169      //pfDCS* world_model = new pfDCS;    // The node with the world under it 
    149       //rootNode->addChild(naver); 
    150  
     170      //rootNode->addChild(mNavigationDCS); 
    151171      //world_model->addChild(obj); 
    152172      //world_model->setScale(3.0f); 
    153       //vjMatrix initial_pos; 
     173       
     174      // Configure the Navigator DCS node: 
     175      // Set it's initial position: 
     176      vjMatrix initial_pos; 
    154177      //initial_pos.setTrans(7500,50,-7500); 
    155       //naver->getNavigator()->setCurPos(initial_pos); 
    156       //naver->addChild(world_model); 
    157  
    158       //planeCollidor* collide = new planeCollidor; 
    159       pfVolumeCollidor* correction_collide = new pfVolumeCollidor(world_model); 
    160       pfRideCollidor*  ride_collide = new pfRideCollidor(world_model); 
    161  
    162       naver->getNavigator()->setGravityCollidor(ride_collide); 
    163       naver->getNavigator()->setCorrectingCollidor(correction_collide); 
    164        
    165  
    166       //pfuTravPrintNodes(rootNode, "nodes.out"); 
    167       //pfdStoreFile(rootNode, "nodes.pfb"); 
     178      initial_pos.setTrans(0, 6, 0); 
     179      mNavigator.getNavigator()->setCurPos(initial_pos); 
     180 
     181      // Set its terrain follower 
     182      //planeCollider* collide = new planeCollider; 
     183      pfPogoCollider*  ride_collide = new pfPogoCollider(world_model); 
     184      mNavigator.getNavigator()->addCollider(ride_collide); 
     185 
     186      // Set the navigator's collider. 
     187      pfBoxCollider* correction_collide = new pfBoxCollider( world_model ); 
     188      mNavigator.getNavigator()->addCollider( correction_collide ); 
     189       
     190 
     191      // load these files into perfly to see just what your scenegraph  
     192      // looked like. . . . .useful for debugging. 
     193      pfuTravPrintNodes( rootNode, "nodes.out" ); 
     194      pfdStoreFile( rootNode, "nodes.pfb" ); 
    168195   } 
    169196 
     
    179206   virtual void preDrawChan(pfChannel* chan, void* chandata) 
    180207   { 
    181       pfDisable(PFEN_TEXTURE); 
    182       pfOverride(PFSTATE_TEXTURE,PF_ON);     // Override texturing to turn it off; 
     208      this->textures( true );     // Override texturing to turn it on; 
    183209   } 
    184210 
     
    193219   virtual void preFrame() 
    194220   { 
    195       //vjDEBUG(vjDBG_ALL, 1) << "app::preFrame\n" << vjDEBUG_FLUSH; 
    196       static float x=10; 
    197       static float y=-5; 
    198       static float z=3; 
    199       static float amb=0.0f; 
    200  
    201       x+=0.05; 
    202       y+=0.04; 
    203       z+=0.02; 
    204       amb += 0.025f; 
    205  
    206       if(x>20.0f) 
    207          x = -20.0f; 
    208       if(y>20.0f) 
    209          y = -20.0f; 
    210       if(z>20.0f) 
    211          z = -20.0f; 
    212       if(amb>1.0f) 
    213          amb = 0.0f; 
    214  
    215       //sun1->setPos(x,y,z, 1.0f); 
    216       //cerr << "set ambient: " << amb << endl; 
    217       //sun1->setColor(PFLT_AMBIENT, amb, amb, amb); 
    218    } 
    219  
     221      // Keep time, for FPS measurments... 
     222      stopWatch.stop(); 
     223      stopWatch.start(); 
     224       
     225      ///////////////////////////////////////////////////////// 
     226      //: Handle navigation 
     227 
     228      if (mActionButton2->getData() == vjDigital::TOGGLE_ON) 
     229         cout<<"Brake\n"<<flush; 
     230      if (mActionButton->getData() == vjDigital::TOGGLE_ON) 
     231         cout<<"Accelerate\n"<<flush; 
     232 
     233      // let the navigator collect some instructions from input devices... 
     234      mNavigator.accelerate( mActionButton->getData() == vjDigital::ON || 
     235                             mActionButton->getData() == vjDigital::TOGGLE_ON ); 
     236      mNavigator.brake( mActionButton2->getData() == vjDigital::ON || 
     237                       mActionButton2->getData() == vjDigital::TOGGLE_ON ); 
     238      mNavigator.rotate( mActionButton2->getData() != vjDigital::ON &&  
     239                         mActionButton2->getData() != vjDigital::TOGGLE_ON ); 
     240      vjMatrix* wandMatrix = mWand->getData(); 
     241      vjMatrix rotMatrix = *wandMatrix; 
     242      rotMatrix( 0, 3 ) = 0.0f; 
     243      rotMatrix( 1, 3 ) = 0.0f; 
     244      rotMatrix( 2, 3 ) = 0.0f; 
     245      mNavigator.setMatrix( rotMatrix ); 
     246       
     247      // tell the navigator to update itself with any new instructions just given to it. 
     248      mNavigator.update(); 
     249       
     250      // notify the navigator DCS of the mNavigator's new matrix 
     251      pfMatrix mNavigator_pf = vjGetPfMatrix( mNavigator ); 
     252      mNavigationDCS->setMat( mNavigator_pf ); 
     253       
     254      // output the FPS so the team artist can get metrics on their model 
     255      ++mFpsEmitCount; 
     256      if (mFpsEmitCount >= 15) 
     257      { 
     258         cout<<"FPS: "<<stopWatch.fpsAverage<<"\n"<<flush; 
     259         mFpsEmitCount = 0; 
     260      } 
     261   } 
     262 
     263   int mFpsEmitCount; 
     264   StopWatch stopWatch; 
     265    
    220266   /// Function called after pfDraw 
    221267   virtual void intraFrame() 
     
    225271 
    226272public: 
     273   // the sun 
    227274   pfLightSource* sun1; 
    228275 
    229    pfNaver*    naver; 
    230    //pfDCS*      baseDCS; 
     276   // navigation objects. 
     277   CaveNavigator  mNavigator; 
     278   pfDCS*         mNavigationDCS; 
     279    
     280   // juggler device interface objects 
     281   vjPosInterface          mWand;      // the Wand 
     282   vjPosInterface          mHead;      // the Head 
     283   vjDigitalInterface      mActionButton; 
     284   vjDigitalInterface      mActionButton2; 
     285   vjDigitalInterface      mModeChangeButton; 
     286    
     287   // scene's root (as far as we're concerned here) 
    231288   pfGroup*   rootNode; 
    232289}; 
     
    239296{ 
    240297    vjKernel* kernel = vjKernel::instance(); // Declare a new Kernel 
    241     myApp* application = new myApp(kernel);  // Delcare an instance of my application 
     298    pfNavJugglerApplication* application = new pfNavJugglerApplication(kernel);  // Delcare an instance of my application 
    242299 
    243300    if (argc < 2) 
  • trunk/juggler_1.0/samples/pfNav/Makefile.in

    r1891 r1913  
    1212COMPILE         = @CXX@ @DEFS@ $(VJ_INCLUDES) @CPPFLAGS@ @CXXFLAGS@ @DBG_FLAGS@ 
    1313LINK            = @CXX@ @CPPFLAGS@ @CXXFLAGS@ @EXTRA_LINK_FLAGS@ 
    14 VJ_INCLUDES     = @INCLUDES@ -I$(VJ_BASE_DIR)/include -I$(srcdir) -I$(srcdir)/../nav 
     14VJ_INCLUDES     = @INCLUDES@ -I$(VJ_BASE_DIR)/include -I$(VJ_BASE_DIR)/include/Math -I$(srcdir) -I$(srcdir)/../nav 
    1515VJ_LIBS         = @TEST_VJ_LIBS_BASIC@ @TEST_VJ_LIBS_GL@ @TEST_VJ_LIBS_PF@ @TEST_LIBS_BASIC@ 
    1616VPATH           = @srcdir@ 
     
    3030EXTRA_LIBS      = @TEST_EXTRA_LIBS_BASIC@ @TEST_EXTRA_LIBS_PF@ @TEST_EXTRA_LIBS_GL@ 
    3131 
    32 OBJECTS         = pfNav.@OBJ_FILE_SUFFIX@ 
     32OBJECTS         = pfNav.@OBJ_FILE_SUFFIX@ ../nav/pfTerryCollide.@OBJ_FILE_SUFFIX@ ../nav/pfTerryPogoCollide.@OBJ_FILE_SUFFIX@ ../nav/pfTerryBoxCollide.@OBJ_FILE_SUFFIX@ 
    3333 
    3434# ----------------------------------------------------------------------------- 
  • trunk/juggler_1.0/samples/pfNav/pfNav.cpp

    r1888 r1913  
    4949    // --- VR Juggler Stuff --- // 
    5050#include <Kernel/vjKernel.h> 
    51 #include <Kernel/Pf/vjPfApp.h> 
     51#include <Kernel/Pf/vjPfApp.h>    // the performer application base type 
    5252#include <Kernel/vjDebug.h> 
    53 #include <Kernel/vjProjection.h> 
    54  
    55 #include <pfNaver.h> 
    56 #include <collidor.h> 
    57 #include <planeCollidor.h> 
    58 #include <pfCollidor.h> 
     53#include <Kernel/vjProjection.h>  // for setNearFar (for setting clipping planes) 
     54#include <Input/InputManager/vjPosInterface.h> 
     55#include <Input/InputManager/vjDigitalInterface.h> 
     56 
     57 
     58// nav includes 
     59#include <CaveNavigator.h> 
     60#include <collider.h> 
     61#include <planeCollider.h> 
     62#include <pfPogoCollider.h> 
     63#include <pfRayCollider.h> 
     64#include <pfBoxCollider.h> 
    5965 
    6066char* filename = NULL; 
     
    6268 
    6369// Declare my application class 
    64 class myApp : public vjPfApp 
     70class pfNavJugglerApplication : public vjPfApp 
    6571{ 
    6672public: 
    67    myApp(vjKernel* kern) : vjPfApp(kern) 
    68    { 
    69       //rotation = 0.0f; 
    70       //zPos = 0.0f; 
     73   pfNavJugglerApplication( vjKernel* kern ) : mFpsEmitCount(0), vjPfApp( kern ) 
     74   { 
     75      // get a valid time on the stopwatch... 
     76      stopWatch.stop(); 
     77      stopWatch.start(); 
    7178   } 
    7279 
     
    7582      vjDEBUG(vjDBG_ALL, 1) << "app::init\n" << vjDEBUG_FLUSH; 
    7683      vjProjection::setNearFar(0.5, 1000); 
     84       
     85      mWand.init( "VJWand" ); 
     86      mHead.init( "VJHead" ); 
     87      mActionButton.init( "VJButton0" ); 
     88      mActionButton2.init( "VJButton1" ); 
     89      mModeChangeButton.init( "VJButton2" ); 
    7790   } 
    7891 
     
    8699      // Initialize type system 
    87100      vjDEBUG(vjDBG_ALL,1) << "app::preForkInit: Initializing new types.\n" << vjDEBUG_FLUSH; 
    88       pfNaver::init(); 
    89101 
    90102      // Initialize loaders 
    91    } 
    92  
     103      pfdInitConverter("terrain.flt"); 
     104   } 
     105 
     106   inline void textures( bool state ) const 
     107   { 
     108      if (state == true) 
     109      { 
     110         pfEnable( PFEN_TEXTURE ); 
     111         pfOverride(PFSTATE_ENTEXTURE, PF_ON); 
     112      } 
     113       
     114      else 
     115      { 
     116         pfDisable( PFEN_TEXTURE ); 
     117         pfOverride(PFSTATE_ENTEXTURE, PF_OFF); 
     118      }       
     119   }    
     120    
    93121   /// Initialize the scene graph 
    94122   virtual void initScene() 
     
    103131      rootNode = new pfGroup; 
    104132 
    105       naver = new pfNaver(); 
     133      mNavigationDCS = new pfDCS(); 
    106134 
    107135      sun1 = new pfLightSource; 
     
    111139      sun1->setColor(PFLT_SPECULAR, 1.0f, 1.0f, 1.0f); 
    112140      sun1->on(); 
    113       naver->addChild(sun1); 
     141      mNavigationDCS->addChild(sun1); 
    114142 
    115143      // Light the root node 
     
    128156      //pfNode* obj = pfdLoadFile("/usr/share/Performer/data/klingon.flt"); 
    129157      pfNode* obj = pfdLoadFile( filename ); 
    130       rootNode->addChild(naver); 
     158      rootNode->addChild( mNavigationDCS ); 
    131159 
    132160      pfDCS* world_model = new pfDCS;    // The node with the world under it 
    133       //rootNode->addChild(world_model); 
    134161      world_model->addChild(obj); 
    135162      world_model->setScale(0.25f); 
    136163      world_model->setTrans(0.0,5.0,-5.0); 
    137  
    138       vjMatrix initial_pos; 
    139       initial_pos.setTrans(0,0,0); 
    140       naver->getNavigator()->setCurPos(initial_pos); 
    141       naver->addChild(world_model); 
    142       //*/ 
    143  
     164      mNavigationDCS->addChild(world_model); 
     165       
    144166      // Load the TOWN 
    145        
    146167      //pfFilePath("/usr/share/Performer/data:/usr/share/Performer/data/town"); 
    147168      //pfNode* obj = pfdLoadFile("/usr/share/Performer/data/town/town_ogl_pfi.pfb"); 
    148169      //pfDCS* world_model = new pfDCS;    // The node with the world under it 
    149       //rootNode->addChild(naver); 
    150  
     170      //rootNode->addChild(mNavigationDCS); 
    151171      //world_model->addChild(obj); 
    152172      //world_model->setScale(3.0f); 
    153       //vjMatrix initial_pos; 
     173       
     174      // Configure the Navigator DCS node: 
     175      // Set it's initial position: 
     176      vjMatrix initial_pos; 
    154177      //initial_pos.setTrans(7500,50,-7500); 
    155       //naver->getNavigator()->setCurPos(initial_pos); 
    156       //naver->addChild(world_model); 
    157  
    158       //planeCollidor* collide = new planeCollidor; 
    159       pfVolumeCollidor* correction_collide = new pfVolumeCollidor(world_model); 
    160       pfRideCollidor*  ride_collide = new pfRideCollidor(world_model); 
    161  
    162       naver->getNavigator()->setGravityCollidor(ride_collide); 
    163       naver->getNavigator()->setCorrectingCollidor(correction_collide); 
    164        
    165  
    166       //pfuTravPrintNodes(rootNode, "nodes.out"); 
    167       //pfdStoreFile(rootNode, "nodes.pfb"); 
     178      initial_pos.setTrans(0, 6, 0); 
     179      mNavigator.getNavigator()->setCurPos(initial_pos); 
     180 
     181      // Set its terrain follower 
     182      //planeCollider* collide = new planeCollider; 
     183      pfPogoCollider*  ride_collide = new pfPogoCollider(world_model); 
     184      mNavigator.getNavigator()->addCollider(ride_collide); 
     185 
     186      // Set the navigator's collider. 
     187      pfBoxCollider* correction_collide = new pfBoxCollider( world_model ); 
     188      mNavigator.getNavigator()->addCollider( correction_collide ); 
     189       
     190 
     191      // load these files into perfly to see just what your scenegraph  
     192      // looked like. . . . .useful for debugging. 
     193      pfuTravPrintNodes( rootNode, "nodes.out" ); 
     194      pfdStoreFile( rootNode, "nodes.pfb" ); 
    168195   } 
    169196 
     
    179206   virtual void preDrawChan(pfChannel* chan, void* chandata) 
    180207   { 
    181       pfDisable(PFEN_TEXTURE); 
    182       pfOverride(PFSTATE_TEXTURE,PF_ON);     // Override texturing to turn it off; 
     208      this->textures( true );     // Override texturing to turn it on; 
    183209   } 
    184210 
     
    193219   virtual void preFrame() 
    194220   { 
    195       //vjDEBUG(vjDBG_ALL, 1) << "app::preFrame\n" << vjDEBUG_FLUSH; 
    196       static float x=10; 
    197       static float y=-5; 
    198       static float z=3; 
    199       static float amb=0.0f; 
    200  
    201       x+=0.05; 
    202       y+=0.04; 
    203       z+=0.02; 
    204       amb += 0.025f; 
    205  
    206       if(x>20.0f) 
    207          x = -20.0f; 
    208       if(y>20.0f) 
    209          y = -20.0f; 
    210       if(z>20.0f) 
    211          z = -20.0f; 
    212       if(amb>1.0f) 
    213          amb = 0.0f; 
    214  
    215       //sun1->setPos(x,y,z, 1.0f); 
    216       //cerr << "set ambient: " << amb << endl; 
    217       //sun1->setColor(PFLT_AMBIENT, amb, amb, amb); 
    218    } 
    219  
     221      // Keep time, for FPS measurments... 
     222      stopWatch.stop(); 
     223      stopWatch.start(); 
     224       
     225      ///////////////////////////////////////////////////////// 
     226      //: Handle navigation 
     227 
     228      if (mActionButton2->getData() == vjDigital::TOGGLE_ON) 
     229         cout<<"Brake\n"<<flush; 
     230      if (mActionButton->getData() == vjDigital::TOGGLE_ON) 
     231         cout<<"Accelerate\n"<<flush; 
     232 
     233      // let the navigator collect some instructions from input devices... 
     234      mNavigator.accelerate( mActionButton->getData() == vjDigital::ON || 
     235                             mActionButton->getData() == vjDigital::TOGGLE_ON ); 
     236      mNavigator.brake( mActionButton2->getData() == vjDigital::ON || 
     237                       mActionButton2->getData() == vjDigital::TOGGLE_ON ); 
     238      mNavigator.rotate( mActionButton2->getData() != vjDigital::ON &&  
     239                         mActionButton2->getData() != vjDigital::TOGGLE_ON ); 
     240      vjMatrix* wandMatrix = mWand->getData(); 
     241      vjMatrix rotMatrix = *wandMatrix; 
     242      rotMatrix( 0, 3 ) = 0.0f; 
     243      rotMatrix( 1, 3 ) = 0.0f; 
     244      rotMatrix( 2, 3 ) = 0.0f; 
     245      mNavigator.setMatrix( rotMatrix ); 
     246       
     247      // tell the navigator to update itself with any new instructions just given to it. 
     248      mNavigator.update(); 
     249       
     250      // notify the navigator DCS of the mNavigator's new matrix 
     251      pfMatrix mNavigator_pf = vjGetPfMatrix( mNavigator ); 
     252      mNavigationDCS->setMat( mNavigator_pf ); 
     253       
     254      // output the FPS so the team artist can get metrics on their model 
     255      ++mFpsEmitCount; 
     256      if (mFpsEmitCount >= 15) 
     257      { 
     258         cout<<"FPS: "<<stopWatch.fpsAverage<<"\n"<<flush; 
     259         mFpsEmitCount = 0; 
     260      } 
     261   } 
     262 
     263   int mFpsEmitCount; 
     264   StopWatch stopWatch; 
     265    
    220266   /// Function called after pfDraw 
    221267   virtual void intraFrame() 
     
    225271 
    226272public: 
     273   // the sun 
    227274   pfLightSource* sun1; 
    228275 
    229    pfNaver*    naver; 
    230    //pfDCS*      baseDCS; 
     276   // navigation objects. 
     277   CaveNavigator  mNavigator; 
     278   pfDCS*         mNavigationDCS; 
     279    
     280   // juggler device interface objects 
     281   vjPosInterface          mWand;      // the Wand 
     282   vjPosInterface          mHead;      // the Head 
     283   vjDigitalInterface      mActionButton; 
     284   vjDigitalInterface      mActionButton2; 
     285   vjDigitalInterface      mModeChangeButton; 
     286    
     287   // scene's root (as far as we're concerned here) 
    231288   pfGroup*   rootNode; 
    232289}; 
     
    239296{ 
    240297    vjKernel* kernel = vjKernel::instance(); // Declare a new Kernel 
    241     myApp* application = new myApp(kernel);  // Delcare an instance of my application 
     298    pfNavJugglerApplication* application = new pfNavJugglerApplication(kernel);  // Delcare an instance of my application 
    242299 
    243300    if (argc < 2)