Ignore:
Timestamp:
10/03/06 17:31:07 (18 years ago)
Author:
gumbau
Message:

Added F1 key functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Geom/Demo_LodStrips/main.cpp

    r1555 r1561  
    4141OverlayElement* mInfo; 
    4242OverlayElement* mInfo2; 
     43OverlayElement* mHelp; 
     44 
     45char HelpString[]="(F1) Help\n" 
     46                        "This demo shows an example of the LODStrips model in action. The models in the scene\n" 
     47                        "are associated to a LodStrips object that manage their level of detail.\n" 
     48                        "The level of detail of the objects depend on the distance to the camera. When the\n" 
     49                        "camera goes away from them, the level of detail decreases, and when the camera gets\n" 
     50                        "closer to them the level of detail increases to restore the original geometry of the\n" 
     51                        "model.\n" 
     52                        "The current level of detail can be seen in real-time in the top-left corner of the screen.\n" 
     53                        "The level of detail begins to decrease at a certain distance of the crowd, and stops\n" 
     54                        "decreasing when the objects reach the their minimum LOD. This 'lodding' distance is\n" 
     55                        "customizable from the source code of the demo."; 
     56 
     57char NoHelpString[]="(F1) Help\n"; 
     58 
    4359 
    4460class CustomIndexData : public Geometry::IndexData 
     
    161177                        mCamera->setDetailLevel(SDL_WIREFRAME);*/ 
    162178 
     179                static bool newpush = true; 
     180                if (!mInputDevice->isKeyDown(Ogre::KC_F1)) 
     181                        newpush = true; 
     182 
     183                static bool showing_help = false; 
     184                if (mInputDevice->isKeyDown(Ogre::KC_F1) && newpush) 
     185                { 
     186                        newpush = false; 
     187                        if (showing_help = !showing_help) 
     188                mHelp->setCaption(HelpString); 
     189                        else 
     190                mHelp->setCaption(NoHelpString); 
     191                } 
    163192 
    164193                if(mInputDevice->isKeyDown(Ogre::KC_LEFT)) 
     
    204233                return true; 
    205234    } 
     235 
    206236}; 
    207237 
     
    251281                groundEntity->setCastShadows(false);        
    252282 
    253  
    254 /*        pEnt = mSceneMgr->createEntity( "PoolFloor", "PoolFloor.mesh" ); 
    255         myRootNode->attachObject(pEnt); 
    256                 myRootNode->scale(6.0,6.0,6.0);*/ 
    257  
    258283                std::string model_file=model_name; 
    259284                model_file.append(".mesh"); 
     
    269294        node = mSceneMgr->getRootSceneNode()->createChildSceneNode(); 
    270295        node->attachObject( entity ); 
     296                node->setVisible(false); 
    271297 
    272298                std::string lod_file="../../media/GT/"; 
     
    306332        mInfo = OverlayManager::getSingleton().getOverlayElement("Demo_LodStrips/Info_1"); 
    307333                mInfo2 = OverlayManager::getSingleton().getOverlayElement("Demo_LodStrips/Info_2"); 
     334                mHelp = OverlayManager::getSingleton().getOverlayElement("Demo_LodStrips/Help"); 
     335                mHelp->setCaption(NoHelpString); 
    308336            pOver->show(); 
    309337 
Note: See TracChangeset for help on using the changeset viewer.