コード例 #1
0
ファイル: md.c プロジェクト: apaznikov/qdmd
/* 
 * integrate: Implements Velocity-Verlet time integration algorithms. 
 */
static void integrate()
{
    compute_pos();
    
    tersoff2_forces();
    tersoff2_energy();
    
    compute_velocities();
}
コード例 #2
0
/* 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();
}