Changeset 6027 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities/space_ships
- Timestamp:
- Dec 10, 2005, 10:16:37 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc
r5981 r6027 118 118 xMouse = yMouse = 0; 119 119 mouseSensitivity = 0.001; 120 120 121 121 cycle = 0.0; 122 122 123 123 124 124 travelSpeed = 15.0; … … 264 264 void SpaceShip::tick (float time) 265 265 { 266 cycle += time; 266 267 267 // spaceship controlled movement 268 268 this->calculateVelocity(time); … … 271 271 272 272 //orient the spaceship model in the direction of movement. 273 273 travelSpeed = velocity.len(); 274 velocity += this->getAbsDirX(); 275 velocity = (velocity.getNormalized())*travelSpeed; 276 274 277 // this is the air friction (necessary for a smooth control) 275 278 if(velocity.len() != 0) velocity -= velocity*0.01; 276 279 280 //hoover effect 281 cycle += time; 277 282 this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02); 278 279 if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0))); 280 else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0))); 281 283 284 //readjust 285 // if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0))); 286 //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0))); 287 282 288 //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2); 283 289 … … 313 319 } 314 320 315 if( this->bLeft 321 if( this->bLeft/* > -this->getRelCoor().z*2*/) 316 322 { 317 323 this->shiftDir(Quaternion(time, Vector(0,1,0))); … … 330 336 //rotVal += .4; 331 337 } 332 338 339 333 340 if( this->bRollL /* > -this->getRelCoor().z*2*/) 334 341 { … … 388 395 void SpaceShip::process(const Event &event) 389 396 { 390 391 397 398 392 399 if( event.type == SDLK_a) 393 400 this->bRollL = event.bPressed;
Note: See TracChangeset
for help on using the changeset viewer.