Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 2, 2005, 1:18:44 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: reimplemented the shoot speed function

File:
1 edited

Legend:

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

    r4322 r4464  
    9393}
    9494
     95
     96/**
     97   \brief sets the velocity vector to a spec speed
     98   \param velocity: vector of the velocity
     99*/
     100void Projectile::setVelocity(const Vector &velocity)
     101{
     102  this->offsetVel = this->velocity = velocity;
     103  this->offsetVel.normalize();
     104  this->velocity += (this->offsetVel * 50.0);
     105}
     106
     107
    95108/**
    96109   \brief signal tick, time dependent things will be handled here
     
    99112void Projectile::tick (float time)
    100113{
    101   Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.7);
     114  Vector v = this->velocity * (time);
    102115  this->shiftCoor(v);
    103116
Note: See TracChangeset for help on using the changeset viewer.