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


C++ Physics::resetMaze方法代码示例

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


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

示例1: ballSetStart

void ballSetStart() 
{
    if(sphereMesh.whichHole.last) 
    {
         cout << "YOU WON!!!!!" << endl;
         NUMBER_OF_WINS ++;
         buildMaze( abs(boardMesh.initial_bound.second.z - boardMesh.initial_bound.first.z) - 1, 
                    abs(boardMesh.initial_bound.second.x - boardMesh.initial_bound.first.x) - 1);
    }
    else
    {
        cout << "AWWWWW!! TOO BAD!!!!!!" << endl;
    }
    cout << "NUMBER OF WINS: " << NUMBER_OF_WINS << endl;

    MOUSE_X = 0; MOUSE_Y = 0;
    DELTA_X_CHANGE = 0.0; DELTA_Y_CHANGE = 0.0; //for mouse movement stuff
    X_CHANGE = 0.05; Y_CHANGE = 0.05;

    boardMesh.initialize("board");
    boardMesh.initial_bound = meshManager.getBounds("board");
    boardMesh.current_position = boardMesh.initial_bound;

    sphereMesh.initialize("sphere");
    sphereMesh.initial_bound = meshManager.getBounds("sphere");
    sphereMesh.current_position = sphereMesh.initial_bound;

    //set the location of the ball on top of the start hole
    sphereMesh.offset.x = mazeHoles[0].offset.x;
    sphereMesh.offset.z = mazeHoles[0].offset.z;
    sphereMesh.offset.y = 3.0f;

    //translate to the start position and update the current positions
    sphereMesh.model=glm::translate(glm::mat4(1.0f), glm::vec3( sphereMesh.offset.x, sphereMesh.offset.y, sphereMesh.offset.z));
    sphereMesh.current_position.first = sphereMesh.initial_bound.first + sphereMesh.offset;
    sphereMesh.current_position.second = sphereMesh.initial_bound.second + sphereMesh.offset;

    //set up the board and ball in the simulated physics world
    if(initPhysics == true) 
    {
        myPhysics.makeBoard(boardMesh);
        myPhysics.makeBall(sphereMesh);
        myPhysics.makeWalls(myMaze);
        initPhysics = false;
    }
    else 
    {
        myPhysics.resetMaze(sphereMesh, myMaze);
    }
}
开发者ID:WendyHanzer,项目名称:4y,代码行数:50,代码来源:main.cpp


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