/* * integrate: Implements Velocity-Verlet time integration algorithms. */ static void integrate() { compute_pos(); tersoff2_forces(); tersoff2_energy(); compute_velocities(); }
/* Idle function that takes care of movement, collisions, turn, and score * updating */ void MyIdleFunc() { if ( (ball_vel[0].mag() <= 0.005) && (ball_vel[1].mag() <= 0.005) && (ball_vel[2].mag() <= 0.005)) { no_motion = 1; } else{ no_motion = 0; } /* changes the turns if necessary */ determine_turn(); /* updates the velocities */ compute_velocities(); glutSetWindow(window_3dview); glutPostRedisplay(); glutSetWindow(window_main); glutPostRedisplay(); }