[Opal-commits] opal/samples/simple_objects main.cpp,1.18,1.19
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-02-22 19:47:03
|
Update of /cvsroot/opal/opal/samples/simple_objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30562/samples/simple_objects Modified Files: main.cpp Log Message: made Data object types a private member; updated samples with new changes Index: main.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/simple_objects/main.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** main.cpp 12 Feb 2005 22:31:43 -0000 1.18 --- main.cpp 22 Feb 2005 19:46:19 -0000 1.19 *************** *** 77,83 **** gTimer.Reset(); gGround = gSimulator->createSolid(); gGround->setStatic(true); ! gGround->addPlane(gGroundParams, gGroundMaterial); std::cout << "==============================================" << std::endl; --- 77,92 ---- gTimer.Reset(); + // Create and setup a Solid for the ground. gGround = gSimulator->createSolid(); gGround->setStatic(true); ! ! // Add a plane Shape to the Solid. ! opal::PlaneShapeData planeData; ! planeData.material = gGroundMaterial; ! planeData.abcd[0] = gGroundParams[0]; ! planeData.abcd[1] = gGroundParams[1]; ! planeData.abcd[2] = gGroundParams[2]; ! planeData.abcd[3] = gGroundParams[3]; ! gGround->addShape(planeData); std::cout << "==============================================" << std::endl; *************** *** 85,90 **** std::cout << "==============================================" << std::endl; std::cout << "Press 1-9 to create various objects" << std::endl; ! std::cout << "Press 'm' to cycle through object materials" << std::endl; ! std::cout << "Press 'g' to cycle through ground materials" << std::endl; std::cout << "Press 'p' to pause" << std::endl; std::cout << "Press 'q' to quit" << std::endl; --- 94,99 ---- std::cout << "==============================================" << std::endl; std::cout << "Press 1-9 to create various objects" << std::endl; ! //std::cout << "Press 'm' to cycle through object materials" << std::endl; ! //std::cout << "Press 'g' to cycle through ground materials" << std::endl; std::cout << "Press 'p' to pause" << std::endl; std::cout << "Press 'q' to quit" << std::endl; *************** *** 92,97 **** std::cout << std::endl; ! std::cout << "Current object material is wood" << std::endl; ! std::cout << "Current ground material is wood" << std::endl; InitSDL(); --- 101,106 ---- std::cout << std::endl; ! //std::cout << "Current object material is wood" << std::endl; ! //std::cout << "Current ground material is wood" << std::endl; InitSDL(); *************** *** 317,388 **** gPaused = !gPaused; break; ! case SDLK_m: ! if (METAL == gObjectMaterialType) ! { ! std::cout << "New object material is wood" << std::endl; ! gObjectMaterialType = WOOD; ! gObjectMaterial = opal::globals::woodMaterial; ! } ! else if (WOOD == gObjectMaterialType) ! { ! std::cout << "New object material is rubber" << std::endl; ! gObjectMaterialType = RUBBER; ! gObjectMaterial = opal::globals::rubberMaterial; ! } ! else if (RUBBER == gObjectMaterialType) ! { ! std::cout << "New object material is ice" << std::endl; ! gObjectMaterialType = ICE; ! gObjectMaterial = opal::globals::iceMaterial; ! } ! else if (ICE == gObjectMaterialType) ! { ! std::cout << "New object material is metal" << std::endl; ! gObjectMaterialType = METAL; ! gObjectMaterial = opal::globals::metalMaterial; ! } ! break; ! case SDLK_g: ! if (METAL == gGroundMaterialType) ! { ! std::cout << "New ground material is wood" << std::endl; ! gGroundMaterialType = WOOD; ! gGroundMaterial = opal::globals::woodMaterial; ! gSimulator->destroySolid(gGround); ! gGround = gSimulator->createSolid(); ! gGround->setStatic(true); ! gGround->addPlane(gGroundParams, gGroundMaterial); ! } ! else if (WOOD == gGroundMaterialType) ! { ! std::cout << "New ground material is rubber" << std::endl; ! gGroundMaterialType = RUBBER; ! gGroundMaterial = opal::globals::rubberMaterial; ! gSimulator->destroySolid(gGround); ! gGround = gSimulator->createSolid(); ! gGround->setStatic(true); ! gGround->addPlane(gGroundParams, gGroundMaterial); ! } ! else if (RUBBER == gGroundMaterialType) ! { ! std::cout << "New ground material is ice" << std::endl; ! gGroundMaterialType = ICE; ! gGroundMaterial = opal::globals::iceMaterial; ! gSimulator->destroySolid(gGround); ! gGround = gSimulator->createSolid(); ! gGround->setStatic(true); ! gGround->addPlane(gGroundParams, gGroundMaterial); ! } ! else if (ICE == gGroundMaterialType) ! { ! std::cout << "New ground material is metal" << std::endl; ! gGroundMaterialType = METAL; ! gGroundMaterial = opal::globals::metalMaterial; ! gSimulator->destroySolid(gGround); ! gGround = gSimulator->createSolid(); ! gGround->setStatic(true); ! gGround->addPlane(gGroundParams, gGroundMaterial); ! } ! break; case SDLK_1: { --- 326,397 ---- gPaused = !gPaused; break; ! //case SDLK_m: ! // if (METAL == gObjectMaterialType) ! // { ! // std::cout << "New object material is wood" << std::endl; ! // gObjectMaterialType = WOOD; ! // gObjectMaterial = opal::globals::woodMaterial; ! // } ! // else if (WOOD == gObjectMaterialType) ! // { ! // std::cout << "New object material is rubber" << std::endl; ! // gObjectMaterialType = RUBBER; ! // gObjectMaterial = opal::globals::rubberMaterial; ! // } ! // else if (RUBBER == gObjectMaterialType) ! // { ! // std::cout << "New object material is ice" << std::endl; ! // gObjectMaterialType = ICE; ! // gObjectMaterial = opal::globals::iceMaterial; ! // } ! // else if (ICE == gObjectMaterialType) ! // { ! // std::cout << "New object material is metal" << std::endl; ! // gObjectMaterialType = METAL; ! // gObjectMaterial = opal::globals::metalMaterial; ! // } ! // break; ! //case SDLK_g: ! // if (METAL == gGroundMaterialType) ! // { ! // std::cout << "New ground material is wood" << std::endl; ! // gGroundMaterialType = WOOD; ! // gGroundMaterial = opal::globals::woodMaterial; ! // gSimulator->destroySolid(gGround); ! // gGround = gSimulator->createSolid(); ! // gGround->setStatic(true); ! // gGround->addPlane(gGroundParams, gGroundMaterial); ! // } ! // else if (WOOD == gGroundMaterialType) ! // { ! // std::cout << "New ground material is rubber" << std::endl; ! // gGroundMaterialType = RUBBER; ! // gGroundMaterial = opal::globals::rubberMaterial; ! // gSimulator->destroySolid(gGround); ! // gGround = gSimulator->createSolid(); ! // gGround->setStatic(true); ! // gGround->addPlane(gGroundParams, gGroundMaterial); ! // } ! // else if (RUBBER == gGroundMaterialType) ! // { ! // std::cout << "New ground material is ice" << std::endl; ! // gGroundMaterialType = ICE; ! // gGroundMaterial = opal::globals::iceMaterial; ! // gSimulator->destroySolid(gGround); ! // gGround = gSimulator->createSolid(); ! // gGround->setStatic(true); ! // gGround->addPlane(gGroundParams, gGroundMaterial); ! // } ! // else if (ICE == gGroundMaterialType) ! // { ! // std::cout << "New ground material is metal" << std::endl; ! // gGroundMaterialType = METAL; ! // gGroundMaterial = opal::globals::metalMaterial; ! // gSimulator->destroySolid(gGround); ! // gGround = gSimulator->createSolid(); ! // gGround->setStatic(true); ! // gGround->addPlane(gGroundParams, gGroundMaterial); ! // } ! // break; case SDLK_1: { |