Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1957 in orxonox.OLD for orxonox/trunk/src/shoot_rocket.cc


Ignore:
Timestamp:
Jun 16, 2004, 9:43:10 AM (20 years ago)
Author:
bensch
Message:

orxonox/truk: now the rockets are frame-rate-driven

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/shoot_rocket.cc

    r1956 r1957  
    4949      glPushMatrix();
    5050      glTranslatef(tmpShoot->xCor, tmpShoot->yCor, tmpShoot->zCor);
     51      tmpShoot->age+=step;
    5152      switch (tmpShoot->type)
    5253        {
     
    8990      /* fix2: conditions, that a struct tree can be cut off */
    9091      /* fix3: more efficent and nicer please */
    91       if (tmpShoot->yCor - DataTank::yOffset > 20)
     92      if (tmpShoot->age > tmpShoot->lifetime)
    9293        {
    9394          /* normal case: delete one element, link the others */
     
    151152  sh->zVel = (1-(float)rand() / 1000000000/step)/5;
    152153  sh->xAcc = 0; sh->yAcc = .01/step; sh->zAcc = 0;
     154  sh->age=0;
     155  sh->lifetime=5;
    153156  sh->next = lastShoot;
    154157  lastShoot = sh;
     
    170173    }
    171174  sh->xAcc = .9; sh->yAcc = .02; sh->zAcc = 0;
     175  sh->age=0;
     176  sh->lifetime=10;
    172177  sh->next = lastShoot;
    173178  lastShoot = sh;
     
    183188  sh->type = ROTATER;
    184189  sh->xCor = x+radius*sin(rotateAngle); sh->yCor = y; sh->zCor = z+radius*cos(rotateAngle);
    185   sh->xVel = .1*cos(rotateAngle)/step;
    186   sh->yVel = 0.4/step;
    187   sh->zVel = .1*sin(rotateAngle)/step;
    188   sh->xAcc = 1.01; sh->yAcc = 1.01/step; sh->zAcc = 1.01;
     190  sh->xVel = 1*cos(rotateAngle)*step;
     191  sh->yVel = 4*step;
     192  sh->zVel = 1*sin(rotateAngle)*step;
     193  sh->xAcc = 1.01; sh->yAcc = 1- step; sh->zAcc = 1.01;
     194  sh->age=0;
     195  sh->lifetime=10;
    189196  sh->next = lastShoot;
    190197  lastShoot = sh;
Note: See TracChangeset for help on using the changeset viewer.