[Opal-commits] opal/samples/playpen main.cpp,1.6,1.7 playpen.vcproj,1.3,1.4
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-04-06 04:49:22
|
Update of /cvsroot/opal/opal/samples/playpen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1764/samples/playpen Modified Files: main.cpp playpen.vcproj Log Message: minor changes; added stuff to sample app Index: main.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/playpen/main.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main.cpp 5 Apr 2005 05:18:52 -0000 1.6 --- main.cpp 6 Apr 2005 04:48:43 -0000 1.7 *************** *** 58,79 **** PlaypenApp::~PlaypenApp() { ! // Destroy the grasping line and its SceneNode. ! Ogre::SceneNode* sn = mGraspingSpringLine->getParentSceneNode(); ! ! // Detach and destroy all objects from the SceneNode. The ! // scene node should only have the OgreLine attached which ! // we must delete explicitly. ! while(sn->numAttachedObjects() > 0) { ! MovableObject* thisObject = ! sn->detachObject(static_cast<unsigned short>(0)); ! delete thisObject; ! } ! // Destroy the SceneNodes all of its children. ! sn->removeAndDestroyAllChildren(); ! mSceneMgr->getRootSceneNode()->removeAndDestroyChild( ! sn->getName()); ! sn = NULL; } --- 58,81 ---- PlaypenApp::~PlaypenApp() { ! if (mGraspingSpringLine) { ! // Destroy the grasping line and its SceneNode. ! Ogre::SceneNode* sn = mGraspingSpringLine->getParentSceneNode(); ! // Detach and destroy all objects from the SceneNode. The ! // scene node should only have the OgreLine attached which ! // we must delete explicitly. ! while(sn->numAttachedObjects() > 0) ! { ! MovableObject* thisObject = ! sn->detachObject(static_cast<unsigned short>(0)); ! delete thisObject; ! } ! ! // Destroy the SceneNodes all of its children. ! sn->removeAndDestroyAllChildren(); ! mSceneMgr->getRootSceneNode()->removeAndDestroyChild( ! sn->getName()); ! } } *************** *** 91,94 **** --- 93,97 ---- //mSceneMgr->showBoundingBoxes(true); + //mSimulator->setStepSize(0.001); // Set the ambient light level. *************** *** 123,127 **** // Make a crosshairs for picking. ! // Load models, create physical objects, etc. here. --- 126,133 ---- // Make a crosshairs for picking. ! Ogre::Overlay* overlay = ! OverlayManager::getSingleton().getByName("General/Crosshair"); ! overlay->show(); ! // Load models, create physical objects, etc. here. *************** *** 131,135 **** bool PlaypenApp::appFrameStarted(opal::real dt) { ! // Do per-frame application specific things here. // Update the grasping spring line. --- 137,141 ---- bool PlaypenApp::appFrameStarted(opal::real dt) { ! // Do per-frame application-specific things here. // Update the grasping spring line. *************** *** 230,234 **** if(mInputDevice->isKeyDown(KC_3) && mTimeUntilNextToggle <= 0) { ! Ogre::Vector3 boxDim(4, 4, 4); opal::Solid* s = mSimulator->createSolid(); s->setPosition(mCreationPoint); --- 236,240 ---- if(mInputDevice->isKeyDown(KC_3) && mTimeUntilNextToggle <= 0) { ! Ogre::Vector3 boxDim(2, 2, 8); opal::Solid* s = mSimulator->createSolid(); s->setPosition(mCreationPoint); *************** *** 306,311 **** } //// testing ! //if(mInputDevice->isKeyDown(KC_9) && mTimeUntilNextToggle <= 0) //{ // opal::Blueprint ragdollBP; --- 312,335 ---- } + // Create a medium capsule. + if(mInputDevice->isKeyDown(KC_9) && mTimeUntilNextToggle <= 0) + { + Ogre::Real radius = 0.6; + Ogre::Real length = 4; + opal::Solid* s = mSimulator->createSolid(); + s->setPosition(mCreationPoint); + opal::CapsuleShapeData data; + data.radius = radius; + data.length = length; + s->addShape(data); + createPhysicalEntityCapsule("", "Plastic/Blue", radius, length, + s); + + // Reset the timer for toggle keys. + mTimeUntilNextToggle = 0.3; + } + //// testing ! //if(mInputDevice->isKeyDown(KC_0) && mTimeUntilNextToggle <= 0) //{ // opal::Blueprint ragdollBP; *************** *** 521,525 **** opal::BoxShapeData boxData; boxData.dimensions = boxDim; ! boxData.material.friction = 0.001; // testing s->addShape(boxData); Ogre::Vector3 boxDimensions(boxDim[0], boxDim[1], boxDim[2]); --- 545,549 ---- opal::BoxShapeData boxData; boxData.dimensions = boxDim; ! boxData.material.density = 500; s->addShape(boxData); Ogre::Vector3 boxDimensions(boxDim[0], boxDim[1], boxDim[2]); Index: playpen.vcproj =================================================================== RCS file: /cvsroot/opal/opal/samples/playpen/playpen.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** playpen.vcproj 3 Apr 2005 00:11:41 -0000 1.3 --- playpen.vcproj 6 Apr 2005 04:48:43 -0000 1.4 *************** *** 33,37 **** <Tool Name="VCLinkerTool" - AdditionalOptions="/STACK:20000000" AdditionalDependencies="ogremain_d.lib opal-ode_d.lib" OutputFile="../win32bin/debug/playpen.exe" --- 33,36 ---- *************** *** 41,44 **** --- 40,44 ---- ProgramDatabaseFile="$(OutDir)/playpen.pdb" SubSystem="1" + StackReserveSize="10000000" TargetMachine="1"/> <Tool *************** *** 85,89 **** <Tool Name="VCLinkerTool" - AdditionalOptions="/STACK:10000000" AdditionalDependencies="ogremain.lib opal-ode.lib" OutputFile="../win32bin/release/playpen.exe" --- 85,88 ---- *************** *** 92,95 **** --- 91,95 ---- GenerateDebugInformation="TRUE" SubSystem="1" + StackReserveSize="10000000" OptimizeReferences="2" EnableCOMDATFolding="2" |