-static void
-pick_velocity (ModeInfo * mi)
-{
- planetstruct *gp = &planets[MI_SCREEN(mi)];
-
- gp->box_width = 15.0;
- gp->box_height = 15.0;
- gp->box_depth = 5.0;
-
- gp->tx = 0.0;
- gp->ty = 0.0;
- gp->tz = frand(360);
-
- gp->dtx = (frand(0.4) + frand(0.3)) * RANDSIGN();
- gp->dty = (frand(0.4) + frand(0.3)) * RANDSIGN();
- gp->dtz = (frand(5.0) + frand(5.0)); /* the sun sets in the west */
-
- gp->dx = (frand(0.2) + frand(0.2)) * RANDSIGN();
- gp->dy = (frand(0.2) + frand(0.2)) * RANDSIGN();
- gp->dz = (frand(0.2) + frand(0.2)) * RANDSIGN();
-}
-
-
-static void
-rotate_and_move (ModeInfo * mi)
-{
- planetstruct *gp = &planets[MI_SCREEN(mi)];
-
- if (do_roll)
- {
- gp->tx += gp->dtx;
- while (gp->tx < 0) gp->tx += 360;
- while (gp->tx > 360) gp->tx -= 360;
-
- gp->ty += gp->dty;
- while (gp->ty < 0) gp->ty += 360;
- while (gp->ty > 360) gp->ty -= 360;
- }
-
- if (do_rotate)
- {
- gp->tz += gp->dtz;
- while (gp->tz < 0) gp->tz += 360;
- while (gp->tz > 360) gp->tz -= 360;
- }
-
- if (do_wander)
- {
- static int frame = 0;
-# define SINOID(SCALE,SIZE) \
- ((((1 + sin((frame * (SCALE)) / 2 * M_PI)) / 2.0) * (SIZE)) - (SIZE)/2)
- gp->xpos = SINOID(0.031, gp->box_width);
- gp->ypos = SINOID(0.023, gp->box_height);
- gp->zpos = SINOID(0.017, gp->box_depth);
- frame++;
- }
-}
-
-