Changeset 6806 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 28, 2006, 12:40:08 PM (19 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/hover.cc
r6805 r6806 110 110 controlVelocityX = 100; 111 111 controlVelocityY = 100; 112 //rotorspeed = 1; 113 //tailrotorspeed = 0; 114 115 //cycle = 0.0; 116 117 // cameraissue 112 113 this->rotorSpeed = 1000.0f; 114 this->rotorCycle = 0.0f; 115 116 // camera - issue 118 117 this->cameraNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 118 this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 119 119 this->cameraNode.setParent(this); 120 this->cameraNode.setParentMode(PNODE_ALL);121 122 120 123 121 // rotors … … 142 140 this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3); 143 141 this->loadModel("models/ships/hoverglider_rotor.obj", 1.0f, 4); 142 this->loadModel("models/ships/rotor.obj", .45f, 5); 144 143 145 144 //add events to the eventlist … … 258 257 // spaceship controlled movement 259 258 this->movement(dt); 259 this->rotorCycle += this->rotorSpeed * dt; 260 260 261 261 Vector move = (velocity)*dt; … … 271 271 * @param time the timeslice since the last frame 272 272 */ 273 void Hover::movement (float time)273 void Hover::movement (float dt) 274 274 { 275 275 Vector accel(0.0, 0.0, 0.0); … … 330 330 glRotatef (this->rotorNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 331 331 this->getModel(4)->draw(); 332 glTranslatef(0,-1,0); 333 glRotatef(this->rotorCycle, 0,1,0); 334 this->getModel(5)->draw(); 332 335 glPopMatrix (); 333 336 … … 351 354 glScalef(1,1,-1); 352 355 this->getModel(4)->draw(); 356 glTranslatef(0,-1,0); 357 glRotatef(this->rotorCycle, 0,1,0); 358 this->getModel(5)->draw(); 353 359 glPopMatrix (); 354 360 } -
trunk/src/world_entities/space_ships/hover.h
r6805 r6806 28 28 29 29 virtual void collidesWith(WorldEntity* entity, const Vector& location); 30 virtual void tick(float time);30 virtual void tick(float dt); 31 31 virtual void draw() const; 32 32 … … 35 35 private: 36 36 void init(); 37 void movement(float time);37 void movement(float dt); 38 38 39 39 private: … … 64 64 float travelSpeed; //!< the current speed of the Hove (to make soft movement) 65 65 float acceleration; //!< the acceleration of the Hover. 66 //float rotorspeed; //!< the speed of the rotor. 67 //float tailrotorspeed; //!< the relativ speed ot the tail rotor 66 67 float rotorSpeed; //!< the speed of the rotor. 68 float rotorCycle; //!< The Cycle the rotor is in. 68 69 69 70 float airViscosity;
Note: See TracChangeset
for help on using the changeset viewer.