Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10618 in orxonox.OLD for trunk/src/world_entities/projectiles


Ignore:
Timestamp:
Apr 4, 2007, 12:13:53 PM (18 years ago)
Author:
bknecht
Message:

merged cleanup into trunk (only improvements)

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1616OrxonoxPlayability.kdevses
        1717OrxonoxPlayability.kdevelop.pcs
         18orxonox.backtrace
         19orxonox.kdevses
         20orxonox.kdevelop.pcs
  • trunk/src/world_entities/projectiles/hbolt.cc

    r10545 r10618  
    4949
    5050  this->angle = 0;
    51   this->rotationSpeed = 600;
     51//   this->rotationSpeed = 600;
    5252
    5353  this->emitter = new DotEmitter(100, 5, M_2_PI);
     
    146146    this->deactivate();
    147147
    148   this->angle += this->rotationSpeed * dt;
     148  this->angle += HBolt::rotationSpeed * dt;
    149149
    150150  for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
     
    177177  glPushAttrib(GL_ENABLE_BIT);
    178178  glDisable(GL_LIGHTING);
    179   glDisable(GL_FOG);
     179//   glDisable(GL_FOG);
    180180
    181181  glMatrixMode(GL_MODELVIEW);
    182182  glPushMatrix();
    183183
    184 
    185   glTranslatef (this->getAbsCoor ().x,
    186                   this->getAbsCoor ().y,
    187                   this->getAbsCoor ().z);
    188 
    189   this->halo->draw();
    190 
    191   Vector tmpRot = this->getAbsDir().getSpacialAxis();
    192   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    193   glRotatef(this->angle, 0.0, 0.0, 1.0);
    194 
    195   this->getModel()->draw();
     184//     float matrix[4][4];
     185    glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     186    Vector tmpRot = this->getAbsDir().getSpacialAxis();
     187    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     188    glRotatef(this->angle, 0.0, 0.0, 1.0);
     189//     glMultMatrixf((float*)matrix);
     190    this->getModel()->draw();
     191    this->halo->draw();
    196192
    197193  glPopMatrix();
  • trunk/src/world_entities/projectiles/hbolt.h

    r10368 r10618  
    4242
    4343    float                             angle;
    44     float                             rotationSpeed;
     44    static const float                rotationSpeed = 600;
    4545
    4646    Billboard*                        halo;
  • trunk/src/world_entities/projectiles/lbolt.cc

    r10545 r10618  
    5959
    6060  this->angle = 0;
    61   this->rotationSpeed = 130;
    6261
    6362  this->halo = new Billboard();
     
    148147    this->deactivate();
    149148
    150   angle += rotationSpeed * dt;
     149  angle += LBolt::rotationSpeed * dt;
    151150
    152151  for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
     
    182181  glPushMatrix();
    183182
    184   float matrix[4][4];
    185   glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     183    float matrix[4][4];
     184    glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     185    Vector tmpRot = this->getAbsDir().getSpacialAxis();
     186    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     187    glRotatef(this->angle, 1.0, 0.0, 0.0);
     188    this->getAbsDir().matrix (matrix);
     189    glMultMatrixf((float*)matrix);
     190    this->getModel()->draw();
    186191
    187   glRotatef(angle, 1.0, 0.0, 0.0);
    188   this->getAbsDir().matrix (matrix);
    189   glMultMatrixf((float*)matrix);
    190   this->getModel()->draw();
    191 
    192   this->halo->draw();
     192    this->halo->draw();
    193193
    194194  glPopMatrix();
    195 
    196195  glPopAttrib();
    197196}
  • trunk/src/world_entities/projectiles/lbolt.h

    r10368 r10618  
    4343
    4444    float                             angle;
    45     float                             rotationSpeed;
     45    static const float                rotationSpeed = 1080;
    4646
    4747    Billboard*                        halo;
  • trunk/src/world_entities/projectiles/mbolt.cc

    r10545 r10618  
    8282  //this->trail->setParent( this);
    8383  this->trail->setTexture( "textures/laser.png");
    84   this->trail->setAbsCoor(this->getAbsCoor() - Vector(.7,0,0));
     84//   this->trail->setAbsCoor(this->getAbsCoor() - Vector(.7,0,0));
     85  this->trail->setAbsCoor(this->getAbsCoor() - this->getVelocity().getNormalized() * .7);
    8586
    8687}
  • trunk/src/world_entities/projectiles/projectile_weapon.h

    r10368 r10618  
    11/*!
    22 * @file projectile_weapon.h
    3  * a projectile_weapon, that is been shooted by a weapon
     3 * a projectile_weapon is a projetile fireing projectile.
    44 *
    5  * You can use this class to make some ProjectileWeapons/Bullets/Lasers/Rockets/etc.
     5 * You can use this class to make some Multi-Stage Projectiles.
     6 * See Spike_Ball for an implemeted example.
    67 *
    78 */
  • trunk/src/world_entities/projectiles/swarm_projectile.cc

    r10547 r10618  
    3939SwarmProjectile::SwarmProjectile () : Projectile()
    4040{
    41 
    42 /*  this->loadModel("models/projectiles/orx-rocket.obj", 0.5);*/
    43   this->loadModel("models/projectiles/swarm_projectile.obj", .25); // no double rescale (see draw())
     41  this->loadModel("models/projectiles/swarm_projectile.obj", .333); // no double rescale (see draw())
    4442  this->loadExplosionSound("sounds/explosions/explosion_4.wav");
    4543
     
    5957  this->elecDamage = 0;
    6058
    61   this->trail = new Trail(2.5,4,.2, this);
    62   //this->trail->setParent( this);
     59  this->trail = new Trail(2.5, 4, .2, this);
    6360  this->trail->setTexture( "textures/laser.png");
     61
     62//   this->maxVelocity = 300;
     63
     64  this->smoke = new Trail(20, 10, .3, this);
     65  this->smoke->setTexture ("textures/engine.png");
     66
     67  this->angle = 0;
     68
    6469
    6570
     
    8388  // delete this->emitter;
    8489  delete this->trail;
     90  delete this->smoke;
    8591}
    8692
     
    113119  this->setHealth(10.0* (float)rand()/(float)RAND_MAX);
    114120
    115   this->maxVelocity = 300;
    116 
    117   this->rotationSpeed = 360;
     121//   this->maxVelocity = 300;
     122
     123//   this->rotationSpeed = 360;
    118124  this->angle = 0;
    119125
     
    216222
    217223  this->trail->tick(time);
     224  this->smoke->tick(time);
    218225
    219226  this->angle += this->rotationSpeed * time;
     227
    220228  while (this->angle > 360)
     229  {
    221230    this->angle -= 360;
     231  }
    222232
    223233  this->lastDir = this->curDir;
     
    272282  glTranslatef(-.9,0,0);
    273283  this->trail->draw();
     284  glTranslatef( -1.1, 0, 0);
     285  this->smoke->draw();
    274286  glPopMatrix();
    275287}
  • trunk/src/world_entities/projectiles/swarm_projectile.h

    r10368 r10618  
    11/*!
    22 * @file swarm_projectile.h
    3  * @brief a SwarmProjectile Projectile
     3 * @brief a Swarm_Missile Projectile
    44*/
    55
     
    4040
    4141    Trail*                            trail;
     42    Trail*                            smoke;
    4243
    4344    ParticleEmitter*                  emitter;
    4445    float                             agility;
    45     float                             maxVelocity;
     46    const static float                maxVelocity = 100;
    4647    float                             speed;
    4748    Vector                            diffVector ;
     
    5758
    5859    // spinning missle
    59     float                             rotationSpeed;
     60    const static float                rotationSpeed = 360;
    6061    float                             angle;
    6162};
Note: See TracChangeset for help on using the changeset viewer.