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