Changeset 5893 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities
- Timestamp:
- Dec 3, 2005, 4:43:36 PM (19 years ago)
- Location:
- branches/spaceshipcontrol/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc
r5890 r5893 118 118 // button->setBindNode(this); 119 119 120 //add events to the eventlist 120 121 registerEvent(KeyMapper::PEV_UP); 121 122 registerEvent(KeyMapper::PEV_DOWN); … … 248 249 { 249 250 // spaceship controlled movement 250 this->move(time); 251 this->calculateVelocity(time); 252 253 Vector move = (velocity)*time; 254 255 this->shiftCoor (move); 251 256 252 257 this->getWeaponManager()->tick(time); … … 256 261 257 262 /** 258 * action if spaceship moves263 * calculate the velocity 259 264 * @param time the timeslice since the last frame 260 265 */ 261 void SpaceShip:: move(float time)266 void SpaceShip::calculateVelocity (float time) 262 267 { 263 268 Vector accel(0.0, 0.0, 0.0); … … 301 306 } 302 307 303 Vector move = accel * time *acceleration; 304 305 /* if (accel.z < 0) 306 this->setRelDirSoft(Quaternion(-.4, accel), 5); 307 else if (accel.z > 0) 308 this->setRelDirSoft(Quaternion(.4, accel), 5); 309 else*/ 308 velocity += accel*time; 310 309 rot.normalize(); 311 310 this->setRelDirSoft(Quaternion(rotVal, rot), 5); 312 this->shiftCoor (move);313 311 } 314 312 -
branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.h
r5880 r5893 42 42 private: 43 43 44 void move(float time);44 void calculateVelocity(float time); 45 45 void weaponAction(); 46 46
Note: See TracChangeset
for help on using the changeset viewer.