本文整理汇总了C++中Ball::GetPt方法的典型用法代码示例。如果您正苦于以下问题:C++ Ball::GetPt方法的具体用法?C++ Ball::GetPt怎么用?C++ Ball::GetPt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ball
的用法示例。
在下文中一共展示了Ball::GetPt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Keyboard
void Keyboard(unsigned char key, int x, int y)
{
{
if (key == 'd' || key == 'D') {
Ball temp;
temp.SetPt(ball.GetPt());
temp.Move(-1, Rotate_Speed, { 1,0,0 });
temp.Update();
if(!temp.GetBB().CollisionCheck(crane.GetBB()))
ball.Move(-1, Rotate_Speed, { 1,0,0 });
}
if (key == 'a' || key == 'A') {
Ball temp;
temp.SetPt(ball.GetPt());
temp.Move(1, Rotate_Speed, { 1,0,0 });
temp.Update();
if (!temp.GetBB().CollisionCheck(crane.GetBB()))
ball.Move(1, Rotate_Speed, { 1,0,0 });
}
if (key == 'q' || key == 'Q') {
Ball temp;
temp.SetPt(ball.GetPt());
temp.Move(-1, Rotate_Speed, { 0,1,0 });
temp.Update();
if (!temp.GetBB().CollisionCheck(crane.GetBB()))
ball.Move(-1, Rotate_Speed, { 0,1,0 });
}
if (key == 'e' || key == 'E') {
Ball temp;
temp.SetPt(ball.GetPt());
temp.Move(1, Rotate_Speed, { 0,1,0 });
temp.Update();
if (!temp.GetBB().CollisionCheck(crane.GetBB()))
ball.Move(1, Rotate_Speed, { 0,1,0 });
}
if (key == 's' || key == 'S') {
Ball temp;
temp.SetPt(ball.GetPt());
temp.Move(-1, Rotate_Speed, { 0,0,1 });
temp.Update();
if (!temp.GetBB().CollisionCheck(crane.GetBB()))
ball.Move(-1, Rotate_Speed, { 0,0,1 });
}
if (key == 'w' || key == 'W') {
Ball temp;
temp.SetPt(ball.GetPt());
temp.Move(1, Rotate_Speed, { 0,0,1 });
temp.Update();
if (!temp.GetBB().CollisionCheck(crane.GetBB()))
ball.Move(1, Rotate_Speed, { 0,0,1 });
}
if (key == 'l' || key == 'L') {
camera.HandleAngle(Camera_Speed, { 1,0,0 });
}
if (key == 'j' || key == 'J') {
camera.HandleAngle(-Camera_Speed, { 1,0,0 });
}
if (key == 'i' || key == 'I') {
camera.HandleAngle(Camera_Speed, { 0,1,0 });
}
if (key == 'k' || key == 'K') {
camera.HandleAngle(-Camera_Speed, { 0,1,0 });
}
if (key == 'u' || key == 'U') {
camera.HandleAngle(Camera_Speed, { 0,0,1 });
}
if (key == 'o' || key == 'O') {
camera.HandleAngle(-Camera_Speed, { 0,0,1 });
}
if (key == '+') {
camera.HandleDistance(10);
}
if (key == '-') {
camera.HandleDistance(-10);
}
if (key == 'r' || key == 'R') {
camera.init();
ball.init();
}
}
if (key == 'p' || key == 'P') {
exit(0);
} // Á¾·á
}