- if(cam_dist < 0) cam_dist = 0;
- }
- }
- }
- }
- prev_mx = mouse_x;
- prev_my = mouse_y;
- prev_bmask = mouse_bmask;
-
- {
- int i, j;
- float tsec = time_msec / 1000.0f;
- static float phase[] = {0.0, M_PI / 3.0, M_PI * 0.8};
- static float speed[] = {0.8, 1.4, 1.0};
- static float scale[][3] = {{1, 2, 0.8}, {0.5, 1.6, 0.6}, {1.5, 0.7, 0.5}};
- static float offset[][3] = {{0, 0, 0}, {0.25, 0, 0}, {-0.2, 0.15, 0.2}};
-
- for(i=0; i<NUM_MBALLS; i++) {
- float t = (tsec + phase[i]) * speed[i];
-
- for(j=0; j<3; j++) {
- float x = sin(t + j * M_PI / 2.0);
- mball[i].pos[j] = offset[i][j] + x * scale[i][j];
- }