Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 4, 2007, 12:57:01 AM (17 years ago)
Author:
landauf
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • data/contentcreation/pps/FabianLandau/mover/environments/mover.cc

    r4844 r4855  
    5656   
    5757    this->originCoor = Vector(0, 0, 0);
    58     this->originDir = Quaternion(0, Vector(0, 0, 0));
     58    this->originDir = Vector(0, 0, 0);
    5959
    6060    this->soundSource_starting.setSourceNode(this);
     
    6969       
    7070    this->originCoor = this->getAbsCoor();
    71     this->originDir = this->getAbsDir();
     71    this->originDir = this->getAbsDir().getRotation();
    7272
    7373    PRINTF(0)("1_3\n");
     
    291291    if (this->stations)
    292292    {
    293         this->shiftCoor(this->stations->getVelocity(this->station) * dt);
    294         this->setAbsDir(this->originDir * (this->stations->getRotation(this->station) * this->time));
     293        this->setAbsCoor(this->originCoor + this->stations->getVelocity(this->station) * this->time);
     294        this->setAbsDir(VtoQ(this->originDir + this->stations->getRotation(this->station) * this->time));
    295295    }
    296296   
     
    304304            this->time = this->stations->getMovingTime(this->station) - this->time;
    305305            this->originCoor = this->originCoor - this->stations->getRelTargetCoor(this->station);
    306             this->originDir = this->originDir / this->stations->getRelTargetDir(this->station);
     306            this->originDir = this->originDir - this->stations->getRelTargetDir(this->station);
    307307        }
    308308    }
    309309
    310     if (/*this->reachedStationsTarget(dt) || */(this->stations && (this->time >= 1.1 * this->stations->getMovingTime(this->station))))
     310    if (/*this->reachedStationsTarget(dt) || */(this->stations && (this->time >= 1.0 * this->stations->getMovingTime(this->station))))
    311311//    if (this->stations && (this->time >= this->stations->getMovingTime(this->station)))
    312312    {
    313313        this->setAbsCoor(this->originCoor + this->stations->getRelTargetCoor(this->station));
    314         this->setAbsDir(this->originDir * this->stations->getRelTargetDir(this->station));
     314        this->setAbsDir(VtoQ(this->originDir + this->stations->getRelTargetDir(this->station)));
    315315
    316316        if (this->stations->getEndingSound(this->station).loaded())
     
    319319
    320320        this->originCoor = this->originCoor + this->stations->getRelTargetCoor(this->station);
    321         this->originDir = this->originDir * this->stations->getRelTargetDir(this->station);
     321        this->originDir = this->originDir + this->stations->getRelTargetDir(this->station);
    322322       
    323323        return STAY;
     
    345345    if (this->stations)
    346346        if ((this->getAbsCoor() - (this->originCoor + this->stations->getRelTargetCoor(this->station))).len() <= 1.2 * (this->stations->getVelocity(this->station) * dt).len())
    347             if (fabs((this->getAbsDir() / (this->originDir * this->stations->getRelTargetDir(this->station))).w) <= 1.2 * fabs(this->stations->getRotation(this->station).w * dt))
     347            if ((this->getAbsDir().getRotation() - (this->originDir + this->stations->getRelTargetDir(this->station))).len() <= 1.2 * (this->stations->getRotation(this->station) * dt).len())
    348348                return true;
    349349
Note: See TracChangeset for help on using the changeset viewer.