Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 31, 2007, 2:27:59 AM (17 years ago)
Author:
patrick
Message:

rotor flimmer fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/environments/rotor.cc

    r10519 r10533  
    3434  //PRINTF(0)("loading Rotor");
    3535
     36  this->totalTime = 0.0;
     37
    3638  if (root != NULL)
    3739    this->loadParams(root);
     
    5557{
    5658     this->rotation = Vector(x,y,z);
     59/*     this->rotation = this->rotation.getNormalized();*/
    5760}
    5861
     
    6265void Rotor::tick(float dt)
    6366{
    64      this->shiftDir(Quaternion(rotation.x*dt, Vector(1,0,0)) * Quaternion(rotation.y*dt, Vector(0,1,0)) * Quaternion(rotation.z*dt, Vector(0,0,1)));
     67
     68  this->totalTime += dt;
     69
     70
     71
     72     this->setAbsDir(Quaternion(rotation.x*this->totalTime, Vector(1,0,0)) *
     73                    Quaternion(rotation.y*this->totalTime, Vector(0,1,0)) *
     74                    Quaternion(rotation.z*this->totalTime, Vector(0,0,1)));
    6575
    6676}
Note: See TracChangeset for help on using the changeset viewer.