00001 #include "Misc.h" 00002 00003 float RGB(int x) 00004 { 00005 float y = 0.0; 00006 if(x != 0) 00007 y = (float)x/255.0; 00008 return y; 00009 } 00010 00011 float degToRad(float degrees) 00012 { 00013 return(degrees * 3.1415926535/180); //www.teacherschoice.com.au/Maths_Library/Angles/Angles.htm 00014 } 00015 00016 void pauseGame() 00017 { 00018 glClearColor(RGB(0xFF), RGB(0xFF), RGB(0xFF), 0); 00019 gameIsPaused = 1; 00020 00021 glutReshapeWindow(glutGet(GLUT_INIT_WINDOW_WIDTH)+1, glutGet(GLUT_INIT_WINDOW_HEIGHT)); 00022 } 00023 00024 void ballBounce() 00025 { 00026 ball.location[0] = 6.5; 00027 ball.location[1] = 20; 00028 ball.location[2] = 5; 00029 00030 ball.velocity[0] = 0; 00031 ball.velocity[1] = 1; 00032 ball.velocity[2] = 0; 00033 00034 } 00035 00036 void resetBall() 00037 { 00038 ball.location[0] = 12.5; 00039 ball.location[1] = 7; 00040 ball.location[2] = 1; 00041 00042 ball.velocity[0] = 0; 00043 ball.velocity[1] = 10; 00044 ball.velocity[2] = 35; 00045 }