Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1957 in orxonox.OLD for orxonox


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

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

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

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

    r1956 r1957  
    138138  io->setPlayerStep(19.2/fps); /* set player to propper speed */
    139139  localPlayer->shootLaser->setShootStep(20.0/fps); /* set shoot speed */
     140  localPlayer->shootRocket->setShootStep(20.0/fps); /* set shoot speed */
    140141  world->setWorldStep(7.0/fps); /* set the speed of the terrain moving away */
    141142  fps = 0;
  • orxonox/trunk/src/player.cc

    r1956 r1957  
    7575void Player::shoot(int n)
    7676{
    77   if (shootLaser->inhibitor++ <= 100)
     77  //  if (shootLaser->inhibitor++ <= 100)
    7878    shootLaser->addShoot(xCor, yCor, zCor);
    79   else if (shootLaser->inhibitor++ <= 200)
     79    // else if (shootLaser->inhibitor++ <= 200)
    8080    shootLaser->addShootExt(xCor, yCor, zCor, .1, .4, .0);
    81   else if (shootLaser->inhibitor++ <= 300)
     81    //  else if (shootLaser->inhibitor++ <= 300)
    8282    shootLaser->addShootExt(xCor, yCor, zCor, -0.1, .4, .0);
    83   else
     83    //  else
    8484    shootLaser->inhibitor =0;
    8585 
    86   if (shootRocket->inhibitor++ >=80)
     86    //  if (shootRocket->inhibitor++ >=80)
    8787    {
    8888      shootRocket->addBackParable(xCor, yCor, zCor);
     
    9090      shootRocket->addSideAcc(xCor, yCor, zCor, LEFT);
    9191      shootRocket->addRotater(xCor, yCor, zCor);
    92       if (shootRocket->inhibitor >=90)
    93         shootRocket->inhibitor =0;
     92      //  if (shootRocket->inhibitor >=90)
     93      //        shootRocket->inhibitor =0;
    9494    }
    9595  //cout << "Player::shoot" << endl;
  • 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;
  • orxonox/trunk/src/shoot_rocket.h

    r1956 r1957  
    3333    float zAcc;
    3434    float age;
     35    float lifetime;
    3536    float collisionRadius;
    3637  };
Note: See TracChangeset for help on using the changeset viewer.