Changeset 1561 for GTP/trunk/App/Demos/Geom/Demo_LodStrips
- Timestamp:
- 10/03/06 17:31:07 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Geom/Demo_LodStrips
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Geom/Demo_LodStrips/main.cpp
r1555 r1561 41 41 OverlayElement* mInfo; 42 42 OverlayElement* mInfo2; 43 OverlayElement* mHelp; 44 45 char 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 57 char NoHelpString[]="(F1) Help\n"; 58 43 59 44 60 class CustomIndexData : public Geometry::IndexData … … 161 177 mCamera->setDetailLevel(SDL_WIREFRAME);*/ 162 178 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 } 163 192 164 193 if(mInputDevice->isKeyDown(Ogre::KC_LEFT)) … … 204 233 return true; 205 234 } 235 206 236 }; 207 237 … … 251 281 groundEntity->setCastShadows(false); 252 282 253 254 /* pEnt = mSceneMgr->createEntity( "PoolFloor", "PoolFloor.mesh" );255 myRootNode->attachObject(pEnt);256 myRootNode->scale(6.0,6.0,6.0);*/257 258 283 std::string model_file=model_name; 259 284 model_file.append(".mesh"); … … 269 294 node = mSceneMgr->getRootSceneNode()->createChildSceneNode(); 270 295 node->attachObject( entity ); 296 node->setVisible(false); 271 297 272 298 std::string lod_file="../../media/GT/"; … … 306 332 mInfo = OverlayManager::getSingleton().getOverlayElement("Demo_LodStrips/Info_1"); 307 333 mInfo2 = OverlayManager::getSingleton().getOverlayElement("Demo_LodStrips/Info_2"); 334 mHelp = OverlayManager::getSingleton().getOverlayElement("Demo_LodStrips/Help"); 335 mHelp->setCaption(NoHelpString); 308 336 pOver->show(); 309 337
Note: See TracChangeset
for help on using the changeset viewer.