Changeset 6505 in orxonox.OLD for branches/spaceshipcontrol
- Timestamp:
- Jan 12, 2006, 9:04:23 AM (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/helicopter.cc
r6497 r6505 410 410 } 411 411 412 velocity += accel ;413 if((this->getAbsDirX()).y <= 0. 2 && (this->getAbsDirX()).y >= -0.2) this->shiftDir(Quaternion(rotValZ, Vector(0,0,1)));414 if((this->getAbsDirZ()).y <= 0. 2 && (this->getAbsDirZ()).y >= -0.2) this->shiftDir(Quaternion(rotValX, Vector(1,0,0)));412 velocity += accel*3; 413 if((this->getAbsDirX()).y <= 0.3 && (this->getAbsDirX()).y >= -0.3) this->shiftDir(Quaternion(rotValZ, Vector(0,0,1))); 414 if((this->getAbsDirZ()).y <= 0.3 && (this->getAbsDirZ()).y >= -0.3) this->shiftDir(Quaternion(rotValX, Vector(1,0,0))); 415 415 } 416 416 -
branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc
r6497 r6505 136 136 137 137 travelSpeed = 15.0; 138 this->velocity = Vector(0.0,0.0,0.0); 138 acceleration = 5.0; 139 this->velocity = this->getAbsDirX()*travelSpeed; 139 140 this->mouseDir = this->getAbsDir(); 140 141 … … 275 276 this->calculateVelocity(time); 276 277 277 Vector move = (velocity)*time;278 Vector move = velocity.getNormalized()*travelSpeed; 278 279 279 280 //orient the velocity in the direction of the spaceship. … … 296 297 297 298 //readjust 298 299 /*300 In the game "Yager" the spaceship gets readjusted when the player moves the mouse.301 I (bknecht) go and check it out how they do it, we could probably use this also in Orxonox.302 */303 //if (xMouse != 0 && yMouse != 0)304 305 299 //if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0))); 306 300 //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0))); … … 321 315 void SpaceShip::calculateVelocity (float time) 322 316 { 323 Vector accel(0.0, 0.0, 0.0);317 //Vector accel(0.0, 0.0, 0.0); 324 318 /* 325 319 Vector rot(0.0, 0.0, 0.0); // wird benötigt für Helicopter … … 334 328 { 335 329 //this->shiftCoor(this->getAbsDirX()); 336 accel += (this->getAbsDirX())*2; 330 //accel += (this->getAbsDirX())*2; 331 if(travelSpeed < 30) travelSpeed += acceleration*time; 337 332 338 333 /* Heli-Steuerung … … 345 340 { 346 341 //this->shiftCoor((this->getAbsDirX())*-1); 347 accel -= (this->getAbsDirX())*2; 342 //accel -= (this->getAbsDirX())*2; 343 if(travelSpeed >= 0) travelSpeed -= acceleration*time; 348 344 } 349 345 … … 403 399 } 404 400 405 velocity += accel;401 //velocity += accel; 406 402 //rot.normalize(); 407 403 //this->setRelDirSoft(Quaternion(rotVal, rot), 5);
Note: See TracChangeset
for help on using the changeset viewer.