[Opal-commits] opal/samples/car car.vcproj,1.10,1.11 main.cpp,1.17,1.18
Status: Inactive
Brought to you by:
tylerstreeter
From: tylerstreeter <tyl...@us...> - 2005-02-09 07:13:27
|
Update of /cvsroot/opal/opal/samples/car In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14586/samples/car Modified Files: car.vcproj main.cpp Log Message: removed destroy functions and made destructors public again Index: main.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/car/main.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** main.cpp 26 Jan 2005 23:10:42 -0000 1.17 --- main.cpp 9 Feb 2005 07:12:45 -0000 1.18 *************** *** 42,46 **** void InitializeVariables(); void MainLoop(); ! void BuildWall( const opal::Matrix44r& transform, const opal::Vec3r& blockSize, int length, int height ); /* Inline Random Functions */ --- 42,46 ---- void InitializeVariables(); void MainLoop(); ! void BuildWall(const opal::Matrix44r& transform, const opal::Vec3r& blockSize, int length, int height); /* Inline Random Functions */ *************** *** 64,83 **** gCameraZoom = -100.0; gCameraYPos = 10.0; ! gSimulator = opal::createSimulator( opal::Vec3r( (opal::real)0.0, (opal::real)-9.81, ! (opal::real)0.0 ) ); ! //gSimulator->setAccuracy( opal::ACCURACY_VERY_LOW ); ! //gSimulator->setDefaultLinearDamping( 0.3 ); ! //gSimulator->setDefaultAngularDamping( 80.0 ); ! gGround = gSimulator->createSolid( true ); ! gGround->addPlane( gGroundParams ); //create ramp opal::Matrix44r rampTransform; ! rampTransform.translate( 0.0, 0.0, -60.0 ); ! rampTransform.rotate( -78.0, 1.0, 0.0, 0.0 ); ! BoxObject* box = new BoxObject( gSimulator, true, opal::Vec3r( 6.0, 65.0, 1.0 ), ! opal::defaults::material, rampTransform ); ! gObjects.push_back( box ); //create 4-sided building --- 64,83 ---- gCameraZoom = -100.0; gCameraYPos = 10.0; ! gSimulator = opal::createSimulator(); ! //gSimulator->setAccuracy(opal::ACCURACY_VERY_LOW); ! //gSimulator->setDefaultLinearDamping(0.3); ! //gSimulator->setDefaultAngularDamping(80.0); ! gGround = gSimulator->createSolid(); ! gGround->setStatic(true); ! gGround->addPlane(gGroundParams); //create ramp opal::Matrix44r rampTransform; ! rampTransform.translate(0.0, 0.0, -60.0); ! rampTransform.rotate(-78.0, 1.0, 0.0, 0.0); ! BoxObject* box = new BoxObject(gSimulator, true, opal::Vec3r(6.0, 65.0, 1.0), ! opal::defaults::material, rampTransform); ! gObjects.push_back(box); //create 4-sided building *************** *** 86,122 **** int h = 25; opal::real blockLength = 2.0; ! opal::Vec3r blockSize( 1.0*blockLength, 0.5*blockLength, 0.5*blockLength ); opal::Matrix44r wallTransform; ! wallTransform.translate( 0.0, 0.0, -50.0 ); ////front wall ! BuildWall( wallTransform, blockSize, w, h ); ////rear wall ! //wallTransform.translate( blockSize[0]*0.5, 0.0, -l*blockSize[0] ); ! //wallTransform.rotate( 180.0, 0.0, 1.0, 0.0 ); ! //BuildWall( wallTransform, blockSize, w, h ); ! //wallTransform.rotate( -180.0, 0.0, 1.0, 0.0 ); ////right wall ! //wallTransform.translate( -blockSize[0]*0.5, 0.0, l*0.5*blockSize[0] ); ! //wallTransform.rotate( 90.0, 0.0, 1.0, 0.0 ); ! //wallTransform.translate( -0.25*blockSize[0], 0.0, w*0.5*blockSize[0] + 0.5*blockSize[2] ); ! //BuildWall( wallTransform, blockSize, l, h ); ////left wall ! //wallTransform.translate( blockSize[0]*0.5, 0.0, -l*0.5*blockSize[0] ); ! //wallTransform.rotate( 180.0, 0.0, 1.0, 0.0 ); ! //wallTransform.translate( 0.0, 0.0, w*0.5*blockSize[0] );//+ 0.5*blockSize[2] ); ! //BuildWall( wallTransform, blockSize, l, h ); ! //wallTransform.translate( 0.0, 0.0, -102.0 ); ! //wallTransform.rotate( 90.0, 0.0, 1.0, 0.0 ); ! //BuildWall( wallTransform, opal::Vec3r(2.0,1.0,5.0), 10, 7 ); opal::Matrix44r carTransform; ! carTransform.makeTranslation( 0.0, 3.8, 50.0 ); ! gCar = new CarObject( gSimulator, 1.0, carTransform ); ! gObjects.push_back( gCar ); std::cout << "==============================================" << std::endl; --- 86,122 ---- int h = 25; opal::real blockLength = 2.0; ! opal::Vec3r blockSize(1.0*blockLength, 0.5*blockLength, 0.5*blockLength); opal::Matrix44r wallTransform; ! wallTransform.translate(0.0, 0.0, -50.0); ////front wall ! BuildWall(wallTransform, blockSize, w, h); ////rear wall ! //wallTransform.translate(blockSize[0]*0.5, 0.0, -l*blockSize[0]); ! //wallTransform.rotate(180.0, 0.0, 1.0, 0.0); ! //BuildWall(wallTransform, blockSize, w, h); ! //wallTransform.rotate(-180.0, 0.0, 1.0, 0.0); ////right wall ! //wallTransform.translate(-blockSize[0]*0.5, 0.0, l*0.5*blockSize[0]); ! //wallTransform.rotate(90.0, 0.0, 1.0, 0.0); ! //wallTransform.translate(-0.25*blockSize[0], 0.0, w*0.5*blockSize[0] + 0.5*blockSize[2]); ! //BuildWall(wallTransform, blockSize, l, h); ////left wall ! //wallTransform.translate(blockSize[0]*0.5, 0.0, -l*0.5*blockSize[0]); ! //wallTransform.rotate(180.0, 0.0, 1.0, 0.0); ! //wallTransform.translate(0.0, 0.0, w*0.5*blockSize[0]);//+ 0.5*blockSize[2]); ! //BuildWall(wallTransform, blockSize, l, h); ! //wallTransform.translate(0.0, 0.0, -102.0); ! //wallTransform.rotate(90.0, 0.0, 1.0, 0.0); ! //BuildWall(wallTransform, opal::Vec3r(2.0,1.0,5.0), 10, 7); opal::Matrix44r carTransform; ! carTransform.makeTranslation(0.0, 3.8, 50.0); ! gCar = new CarObject(gSimulator, 1.0, carTransform); ! gObjects.push_back(gCar); std::cout << "==============================================" << std::endl; *************** *** 137,141 **** ShutdownSDL(); ! glDeleteLists( gGroundDispList, 1 ); while (!gObjects.empty()) --- 137,141 ---- ShutdownSDL(); ! glDeleteLists(gGroundDispList, 1); while (!gObjects.empty()) *************** *** 150,154 **** } ! void BuildWall( const opal::Matrix44r& transform, const opal::Vec3r& blockSize, int length, int height ) { opal::Matrix44r M; --- 150,154 ---- } ! void BuildWall(const opal::Matrix44r& transform, const opal::Vec3r& blockSize, int length, int height) { opal::Matrix44r M; *************** *** 165,172 **** } ! //M.makeTranslation( pos[0], pos[1], pos[2] ); //base wall transform M = transform; ! M.translate( l*blockSize[0] + 0.5*blockSize[0] - 0.5*length*blockSize[0] + offset, ! h*blockSize[1] + 0.5*blockSize[1], 0.0 ); //if (randbit()) --- 165,172 ---- } ! //M.makeTranslation(pos[0], pos[1], pos[2]); //base wall transform M = transform; ! M.translate(l*blockSize[0] + 0.5*blockSize[0] - 0.5*length*blockSize[0] + offset, ! h*blockSize[1] + 0.5*blockSize[1], 0.0); //if (randbit()) *************** *** 174,181 **** { //normal size ! BoxObject* newBox = new BoxObject( gSimulator, false, blockSize, ! opal::globals::metalMaterial, M, NULL ); ! newBox->setSleeping( true ); ! gObjects.push_back( newBox ); } else --- 174,181 ---- { //normal size ! BoxObject* newBox = new BoxObject(gSimulator, false, blockSize, ! opal::globals::metalMaterial, M); ! newBox->setSleeping(true); ! gObjects.push_back(newBox); } else *************** *** 187,216 **** //block 1 - lower left ! M.translate( -0.25*blockSize[0], -0.25*blockSize[1], 0.0 ); ! BoxObject* newBox = new BoxObject( gSimulator, false, newSize, ! opal::globals::metalMaterial, M, NULL ); ! newBox->setSleeping( true ); ! gObjects.push_back( newBox ); //block 2 - lower right ! M.translate( 0.5*blockSize[0], 0.0, 0.0 ); ! newBox = new BoxObject( gSimulator, false, newSize, ! opal::globals::metalMaterial, M, NULL ); ! newBox->setSleeping( true ); ! gObjects.push_back( newBox ); //block 3 - upper right ! M.translate( 0.0, 0.5*blockSize[1], 0.0 ); ! newBox = new BoxObject( gSimulator, false, newSize, ! opal::globals::metalMaterial, M, NULL ); ! newBox->setSleeping( true ); ! gObjects.push_back( newBox ); //block 4 - upper left ! M.translate( -0.5*blockSize[0], 0.0, 0.0 ); ! newBox = new BoxObject( gSimulator, false, newSize, ! opal::globals::metalMaterial, M, NULL ); ! newBox->setSleeping( true ); ! gObjects.push_back( newBox ); } } --- 187,216 ---- //block 1 - lower left ! M.translate(-0.25*blockSize[0], -0.25*blockSize[1], 0.0); ! BoxObject* newBox = new BoxObject(gSimulator, false, newSize, ! opal::globals::metalMaterial, M); ! newBox->setSleeping(true); ! gObjects.push_back(newBox); //block 2 - lower right ! M.translate(0.5*blockSize[0], 0.0, 0.0); ! newBox = new BoxObject(gSimulator, false, newSize, ! opal::globals::metalMaterial, M); ! newBox->setSleeping(true); ! gObjects.push_back(newBox); //block 3 - upper right ! M.translate(0.0, 0.5*blockSize[1], 0.0); ! newBox = new BoxObject(gSimulator, false, newSize, ! opal::globals::metalMaterial, M); ! newBox->setSleeping(true); ! gObjects.push_back(newBox); //block 4 - upper left ! M.translate(-0.5*blockSize[0], 0.0, 0.0); ! newBox = new BoxObject(gSimulator, false, newSize, ! opal::globals::metalMaterial, M); ! newBox->setSleeping(true); ! gObjects.push_back(newBox); } } *************** *** 326,330 **** //create ground display list gGroundDispList = glGenLists(1); ! glNewList( gGroundDispList, GL_COMPILE ); glBegin(GL_QUADS); glVertex3f(-2000.0, gGroundParams[3], -2000.0); --- 326,330 ---- //create ground display list gGroundDispList = glGenLists(1); ! glNewList(gGroundDispList, GL_COMPILE); glBegin(GL_QUADS); glVertex3f(-2000.0, gGroundParams[3], -2000.0); *************** *** 480,489 **** { opal::Matrix44r M = gCar->getTransform(); ! M.translate( 0.0, 1.0, -3.0 ); ! SphereObject* projectile = new SphereObject( gSimulator, false, ! 0.6, opal::defaults::material, M ); ! projectile->getSolid()->addLocalForce( ! opal::Vec3r(0.0,3000.0,-12000.0), 0.01 ); ! gObjects.push_back( projectile ); break; } --- 480,492 ---- { opal::Matrix44r M = gCar->getTransform(); ! M.translate(0.0, 1.0, -3.0); ! SphereObject* projectile = new SphereObject(gSimulator, false, ! 0.6, opal::defaults::material, M); ! opal::Force f; ! f.vec = opal::Vec3r(0, 3000, -12000); ! f.type = opal::LOCAL_FORCE; ! f.timeLeft = (opal::real)0.01; ! projectile->getSolid()->addForce(f); ! gObjects.push_back(projectile); break; } *************** *** 504,511 **** break; case SDLK_LEFT: ! gCar->setSteering( 0.0 ); break; case SDLK_RIGHT: ! gCar->setSteering( 0.0 ); break; default: --- 507,514 ---- break; case SDLK_LEFT: ! gCar->setSteering(0.0); break; case SDLK_RIGHT: ! gCar->setSteering(0.0); break; default: *************** *** 545,549 **** if (!gPaused) { ! gSimulator->simulate( dt ); } --- 548,552 ---- if (!gPaused) { ! gSimulator->simulate(dt); } *************** *** 561,575 **** opal::Matrix44r carTransform = gCar->getTransform(); opal::Matrix44r cameraOffset = carTransform; ! cameraOffset.translate( 0.0, 1.5, 25.0 ); opal::Point3r carPos = carTransform.getPosition(); opal::Point3r cameraPos = cameraOffset.getPosition(); ! if (cameraPos[1] < 1.0 ) { cameraPos[1] = 1.0; } ! gluLookAt( cameraPos[0], cameraPos[1], cameraPos[2], carPos[0], carPos[1]+3.0, carPos[2], ! 0.0, 1.0, 0.0 ); } else --- 564,578 ---- opal::Matrix44r carTransform = gCar->getTransform(); opal::Matrix44r cameraOffset = carTransform; ! cameraOffset.translate(0.0, 1.5, 25.0); opal::Point3r carPos = carTransform.getPosition(); opal::Point3r cameraPos = cameraOffset.getPosition(); ! if (cameraPos[1] < 1.0) { cameraPos[1] = 1.0; } ! gluLookAt(cameraPos[0], cameraPos[1], cameraPos[2], carPos[0], carPos[1]+3.0, carPos[2], ! 0.0, 1.0, 0.0); } else *************** *** 580,584 **** } ! glCallList( gGroundDispList ); std::vector<Base3DObject*>::iterator iter; --- 583,587 ---- } ! glCallList(gGroundDispList); std::vector<Base3DObject*>::iterator iter; Index: car.vcproj =================================================================== RCS file: /cvsroot/opal/opal/samples/car/car.vcproj,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** car.vcproj 3 Feb 2005 19:44:11 -0000 1.10 --- car.vcproj 9 Feb 2005 07:12:45 -0000 1.11 *************** *** 38,42 **** OutputFile="$(OutDir)/car.exe" LinkIncremental="2" ! AdditionalLibraryDirectories="..\..\external\lib\win32" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/car.pdb" --- 38,42 ---- OutputFile="$(OutDir)/car.exe" LinkIncremental="2" ! AdditionalLibraryDirectories="" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/car.pdb" *************** *** 87,92 **** OutputFile="$(OutDir)/car.exe" LinkIncremental="1" ! AdditionalLibraryDirectories="..\..\external\lib\win32" ! GenerateDebugInformation="TRUE" SubSystem="1" OptimizeReferences="2" --- 87,92 ---- OutputFile="$(OutDir)/car.exe" LinkIncremental="1" ! AdditionalLibraryDirectories="" ! GenerateDebugInformation="FALSE" SubSystem="1" OptimizeReferences="2" |