本文整理汇总了C++中MyApplication::getSceneManager方法的典型用法代码示例。如果您正苦于以下问题:C++ MyApplication::getSceneManager方法的具体用法?C++ MyApplication::getSceneManager怎么用?C++ MyApplication::getSceneManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyApplication
的用法示例。
在下文中一共展示了MyApplication::getSceneManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
srand((unsigned int)time(NULL));
SDL_Init(SDL_INIT_JOYSTICK);
if(SDL_NumJoysticks() > 0)
{
// Setup the joystick.
std::cout << "========================================" << std::endl;
std::cout << "Initializing game controller: " << SDL_JoystickName(0)
<< std::endl;
gGamePad = SDL_JoystickOpen(0);
std::cout << SDL_JoystickNumAxes(gGamePad) << " axes" << std::endl;
std::cout << SDL_JoystickNumBalls(gGamePad) << " trackballs" << std::endl;
std::cout << SDL_JoystickNumHats(gGamePad) << " hats" << std::endl;
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();
//.........这里部分代码省略.........