- Timestamp:
- Jun 4, 2007, 12:57:01 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/contentcreation/pps/FabianLandau/mover/environments/mover.cc
r4844 r4855 56 56 57 57 this->originCoor = Vector(0, 0, 0); 58 this->originDir = Quaternion(0, Vector(0, 0, 0));58 this->originDir = Vector(0, 0, 0); 59 59 60 60 this->soundSource_starting.setSourceNode(this); … … 69 69 70 70 this->originCoor = this->getAbsCoor(); 71 this->originDir = this->getAbsDir() ;71 this->originDir = this->getAbsDir().getRotation(); 72 72 73 73 PRINTF(0)("1_3\n"); … … 291 291 if (this->stations) 292 292 { 293 this->s hiftCoor(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)); 295 295 } 296 296 … … 304 304 this->time = this->stations->getMovingTime(this->station) - this->time; 305 305 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); 307 307 } 308 308 } 309 309 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)))) 311 311 // if (this->stations && (this->time >= this->stations->getMovingTime(this->station))) 312 312 { 313 313 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))); 315 315 316 316 if (this->stations->getEndingSound(this->station).loaded()) … … 319 319 320 320 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); 322 322 323 323 return STAY; … … 345 345 if (this->stations) 346 346 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()) 348 348 return true; 349 349
Note: See TracChangeset
for help on using the changeset viewer.