本文整理汇总了C++中MyApplication::go方法的典型用法代码示例。如果您正苦于以下问题:C++ MyApplication::go方法的具体用法?C++ MyApplication::go怎么用?C++ MyApplication::go使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyApplication
的用法示例。
在下文中一共展示了MyApplication::go方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
MyApplication app;
try{
app.go();
}
catch(Ogre::Exception& e)
{
}
return 0;
}
示例2: main
//.........这里部分代码省略.........
std::cout << SDL_JoystickNumButtons(gGamePad) << " buttons" << std::endl;
std::cout << "========================================" << std::endl;
}
else
{
std::cout << "========================================" << std::endl;
std::cout << "No game controller detected" << std::endl;
std::cout << "========================================" << std::endl;
}
//Ogre::Overlay* trialOverlay;
///// The current amount of elapsed time within a trial.
//Ogre::Real mCurrentTrialTime;
///// The length of each trial in seconds.
//Ogre::Real mTrialLength;
///// The rewards received during a single trial, in rewards per step.
//verve::real mAvgRewardPerStep;
if (!gEngine.init())
{
return 0;
}
/*
gEngine.setUpdateMode(SimulationEngine::SIMULATE_REAL_TIME_MULTIPLE, 1);
*/
//// Set to capture frames at 29.97 fps.
//engine.setUpdateMode(SIMULATE_CONSTANT_CHUNK, 0.0333667);
/*
// Use feet for this simulation.
gEngine.getSimulator()->setGravity(opal::Vec3r(0, -30, 0));
gEngine.getSimulator()->setStepSize(gPhysicsStepSize);
// Make sure we get notified at the end of each step.
gEngine.getSimulator()->addPostStepEventHandler(&gPostStepEventHandler);
*/
// Create the robot.
opal::Matrix44r robotTransform;
robotTransform.translate(0, 1, 0);
gRobot = new Robot(gEngine, 5);
gRobot->init("../data/blueprints/robot1.xml", "Plastic/LightBlue",
0.5, robotTransform, 2);
gRobot->resetBodyAndCreateNewAgent();
gRobot->resetBodyAndSTM();
gRobot->randomizeState();
gRobot->getFLMotor()->setMaxTorque((opal::real)2);
gRobot->getFRMotor()->setMaxTorque((opal::real)2);
gRobot->getFLMotor()->setMaxVelocity(1000);
gRobot->getFRMotor()->setMaxVelocity(1000);
// Create the car.
opal::Matrix44r carTransform;
carTransform.translate(-12, 2, 4);
gCar = new Car(gEngine);
gCar->init("../data/blueprints/car1.xml", "Plastic/Blue", 1,
carTransform, 1);
//DataFile dataFile(mNumTrialsPerRun);
//updateOverlayData(trial);
//mAvgRewardPerStep = 0;
//mCurrentTrialTime = 0;
gAgentDebugger = new AgentVisualDebugger(gEngine.getSceneManager());
gAgentDebugger->setAgent(gRobot->getAgent());
gAgentDebugger->setDisplayEnabled(false);
/*
Ogre::OverlayManager::getSingleton().getByName("Verve/Debug")->hide();
Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay")->hide();
// Setup camera.
gEngine.getCamera()->setPosition(opal::Point3r(0, 25, 25));
gEngine.getCamera()->lookAt(opal::Point3r(0, (opal::real)0.1, 0));
gEngine.setCameraMoveSpeed(15);
*/
//setupEnvironment();
gEngine.go();
//mainLoop();
delete gRobot;
delete gCar;
delete gAgentDebugger;
return 0;
}