Changeset 10533 in orxonox.OLD for trunk/src/world_entities/environments
- Timestamp:
- Jan 31, 2007, 2:27:59 AM (18 years ago)
- Location:
- trunk/src/world_entities/environments
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/environments/rotor.cc
r10519 r10533 34 34 //PRINTF(0)("loading Rotor"); 35 35 36 this->totalTime = 0.0; 37 36 38 if (root != NULL) 37 39 this->loadParams(root); … … 55 57 { 56 58 this->rotation = Vector(x,y,z); 59 /* this->rotation = this->rotation.getNormalized();*/ 57 60 } 58 61 … … 62 65 void Rotor::tick(float dt) 63 66 { 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))); 65 75 66 76 } -
trunk/src/world_entities/environments/rotor.h
r10276 r10533 20 20 21 21 virtual ~Rotor(); 22 22 23 23 virtual void loadParams(const TiXmlElement* root); 24 24 25 25 void initRotation(float x, float y, float z); 26 26 27 27 virtual void tick(float time); 28 28 29 29 private: 30 30 Vector rotation; //!< the rotation axis 31 31 double totalTime; //!< total time 32 32 }; 33 33
Note: See TracChangeset
for help on using the changeset viewer.