Changeset 6052 in orxonox.OLD for branches/spaceshipcontrol/src
- Timestamp:
- Dec 11, 2005, 6:00:58 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/space_ships/helicopter.cc
r6051 r6052 246 246 247 247 //orient the velocity in the direction of the spaceship. 248 travelSpeed = velocity.len();249 velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;250 velocity = (velocity.getNormalized())*travelSpeed;248 //travelSpeed = velocity.len(); 249 //velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity; 250 //velocity = (velocity.getNormalized())*travelSpeed; 251 251 252 252 // this is the air friction (necessary for a smooth control) 253 253 if(velocity.len() != 0) velocity -= velocity*0.01; 254 255 if(this->getAbsDirX().y < -0.2) this->shiftDir(Quaternion(time, Vector(0,0,1))); 256 else if(this->getAbsDirX().y > 0.2) this->shiftDir(Quaternion(-time, Vector(0,0,1))); 254 257 255 258 //hoover effect … … 285 288 { 286 289 //this->shiftCoor(this->getAbsDirX()); 287 accel += (this->getAbsDirX())*2;288 289 rotVal -= .4;290 accel += Vector(this->getAbsDirX().x,0,this->getAbsDirX().z).getNormalized()*2; 291 rot += Vector (0,0,1); 292 rotVal -= .004; 290 293 } 291 294 … … 293 296 { 294 297 //this->shiftCoor((this->getAbsDirX())*-1); 295 accel -= (this->getAbsDirX())*2;298 accel -= Vector(this->getAbsDirX().x,0,this->getAbsDirX().z).getNormalized()*2; 296 299 rot += Vector (0,0,1); 297 rotVal += . 4;300 rotVal += .004; 298 301 } 299 302 … … 304 307 //velocityDir.normalize(); 305 308 rot +=Vector(1,0,0); 306 rotVal -= . 2;309 rotVal -= .002; 307 310 } 308 311 if( this->bRight /* > this->getRelCoor().z*2*/) … … 313 316 //velocityDir.normalize(); 314 317 rot += Vector(1,0,0); 315 rotVal += . 2;318 rotVal += .002; 316 319 } 317 320 … … 354 357 velocity += accel; 355 358 rot.normalize(); 356 this->s etRelDirSoft(Quaternion(rotVal, rot), 5);359 this->shiftDir(Quaternion(rotVal, rot)); 357 360 } 358 361 … … 406 409 this->xMouse = event.xRel; 407 410 this->yMouse = event.yRel; 408 this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1)));411 //this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1))); 409 412 } 410 413 }
Note: See TracChangeset
for help on using the changeset viewer.