当前位置: 首页>>代码示例>>C++>>正文


C++ MyApplication::getSceneManager方法代码示例

本文整理汇总了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();

//.........这里部分代码省略.........
开发者ID:sub77,项目名称:hobbycode,代码行数:101,代码来源:main.cpp


注:本文中的MyApplication::getSceneManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。