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


C++ Paddle::set_origin方法代码示例

本文整理汇总了C++中Paddle::set_origin方法的典型用法代码示例。如果您正苦于以下问题:C++ Paddle::set_origin方法的具体用法?C++ Paddle::set_origin怎么用?C++ Paddle::set_origin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paddle的用法示例。


在下文中一共展示了Paddle::set_origin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createScene

//---------------------------------------------------------------------------
void TutorialApplication::createScene(void)
{

    //===============================================================================================================================================================

    rS = 1000;
    const_velocity = 100.0;
    simulator = new Simulator();

    SceneNode* translateNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("translate");
    translateNode->translate(10000,0,1000);
    //translateNode->attachObject(mCamera);

    SceneNode* translateNodeTwo = mSceneMgr->getRootSceneNode()->createChildSceneNode("translateTwo");
    translateNodeTwo->translate(10000,0,-1000);
    //translateNodeTwo->attachObject(mCamera);

    SceneNode* translateNodeThree = mSceneMgr->getRootSceneNode()->createChildSceneNode("translateThree");
    translateNodeThree->translate(10000,0,0);

    mSceneMgr->setAmbientLight(ColourValue(0.25,0.25,0.25));

    Plain plain1(mSceneMgr, Vector3::UNIT_Y, Vector3::UNIT_Z, rS*3, rS*6, -rS, "ground1", "node_ground1", "Examples/BumpyMetal");
    plain1.set_origin(btVector3(btScalar(0), btScalar(-rS), btScalar(0)));
    plain1.create_bounding_box(simulator, 1.0f);

    Plain plain2(mSceneMgr, Vector3::NEGATIVE_UNIT_Y, Vector3::UNIT_Z, rS*3, rS*6, -rS, "ground2", "node_ground2", "Examples/BumpyMetal");
    plain2.set_origin(btVector3(btScalar(0), btScalar(rS), btScalar(0)));
    plain2.create_bounding_box(simulator, 1.0f);

    Plain plain3(mSceneMgr, Vector3::UNIT_X, Vector3::UNIT_Y, rS*6, rS*2, -rS*1.5, "ground3", "node_ground3", "Examples/BumpyMetal");
    plain3.set_origin(btVector3(btScalar(-rS*1.5), btScalar(0), btScalar(0)));
    plain3.create_bounding_box(simulator, 1.0f);

    Plain plain4(mSceneMgr, Vector3::NEGATIVE_UNIT_X, Vector3::UNIT_Y, rS*6, rS*2, -rS*1.5, "ground4", "node_ground4", "Examples/BumpyMetal");
    plain4.set_origin(btVector3(btScalar(rS*1.5), btScalar(0), btScalar(0)));
    plain4.create_bounding_box(simulator, 1.0f);

    Plain plain5(mSceneMgr, Vector3::UNIT_Z, Vector3::UNIT_X, rS*2, rS*3, -rS*3, "ground5", "node_ground5", "Examples/BumpyMetal");
    plain5.set_origin(btVector3(btScalar(0), btScalar(0), btScalar(-rS*3)));
    plain5.create_bounding_box(simulator, 1.0f);

    Plain plain6(mSceneMgr, Vector3::NEGATIVE_UNIT_Z, Vector3::UNIT_X, rS*2, rS*3, -rS*3, "ground6", "node_ground6", "Examples/BumpyMetal");
    plain6.set_origin(btVector3(btScalar(0), btScalar(0), btScalar(rS*3)));
    plain6.create_bounding_box(simulator, 1.0f);


    // Plain* g = new Plain(mSceneMgr, Vector3::UNIT_Z, Vector3::UNIT_X, rS*4/5, rS*1.5, -1.5*rS, "goal", "node_goal", "Examples/Chrome", "translateThree");
    // g->set_origin(btVector3(btScalar(0), btScalar(0), btScalar(rS*20)));
    // g->create_bounding_box(simulator, 1.0f);
    // setGoal(g);

    Paddle* paddleNew = new Paddle(mSceneMgr, "paddle", "node_paddle", Vector3(3, 2, .5), "translate");
    paddleNew->set_origin(btVector3(0, 0, rS));
    paddleNew->create_bounding_box(simulator, 0.0f, 1.0f);
    setPaddleOne(paddleNew);


    Paddle* paddleNewTwo = new Paddle(mSceneMgr, "paddle2", "node_paddleTwo", Vector3(3, 2, .5), "translateTwo");
    paddleNewTwo->set_origin(btVector3(0, 0, rS*4));
    paddleNewTwo->create_bounding_box(simulator, 0.0f, 1.0f);
    setPaddleTwo(paddleNewTwo);

    powerSystem = new PowerupSystem(mSceneMgr);

    //AI for the second paddle for single player games
    paddleAI = new PaddleAI(paddleTwo,rS);

    Ball* b = new Ball(mSceneMgr, "node_ball");
    b->reset(mSceneMgr, b, simulator);
    setBall(b);


    Light* light1 = mSceneMgr->createLight("ThirdLight");
    light1->setDiffuseColour(1,1,1);
    light1->setPosition(0,50,50);
    setLight(light1);
}
开发者ID:StormyEmery,项目名称:OgreRaquetball,代码行数:79,代码来源:TutorialApplication.cpp


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