Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 1, 2005, 1:41:38 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: added testbullet class. some changes in the weapon class to make it look much better and also more performant

File:
1 edited

Legend:

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

    r3690 r3708  
    6262   tick function
    6363*/
    64 void Projectile::setFlightDirection(Quaternion* flightDirection)
     64void Projectile::setFlightDirection(Quaternion flightDirection)
    6565{
    6666  if( this->flightDirection == NULL)
    6767    this->flightDirection = new Vector();
    6868  Vector v(1, 0, 0);
    69   *this->flightDirection = flightDirection->apply(v);
     69  *this->flightDirection = flightDirection.apply(v);
    7070  this->flightDirection->normalize();
    7171}
     
    8989void Projectile::setSpeed(float speed)
    9090{
    91   this->speed = speed * 3;
     91  this->speed = speed * 3; /* fix speed settings */
    9292  PRINTF(4)("Projectile::setting speed to: %f\n", this->speed);
    9393}
     
    9999void Projectile::tick (float time)
    100100{
    101   //this->speed = this->weapon->getSpeed();
    102   Vector v;
    103   v = *this->flightDirection * ( this->speed * time * 1000 + 0.7);
     101  Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.7);
    104102  this->shiftCoor(v);
    105   //printf("PROJECTILE: current direction is:    (%f, %f, %f)\n",this->flightDirection->x, this->flightDirection->y, this->flightDirection->z );
    106   //printf("PROJECTILE: current shift vector is: (%f, %f, %f)\n", v.x, v.y, v.z);
    107   //printf("PROJECTILE: current speed is: %f\n", this->speed);
    108   //printf("PROJECTILE: current dt is:    %f\n", time);
    109   //this->debug();
    110103
    111104  this->currentLifeTime += time;
    112105  if( this->ttl < this->currentLifeTime)
    113106    {
    114       PRINTF(5)("FINALIZE=============================================================\n");
     107      PRINTF(5)("FINALIZE==========================\n");
    115108      PRINTF(5)("current life time is: %f/%f\n", this->currentLifeTime, this->ttl);
    116       PRINTF(5)("FINALIZE=============================================================\n");
     109      PRINTF(5)("FINALIZE===========================\n");
    117110      this->finalize();
    118111      this->currentLifeTime = 0.0f;
Note: See TracChangeset for help on using the changeset viewer.