- Timestamp:
- Jan 28, 2006, 5:06:25 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/hover.cc
r6813 r6814 265 265 float rotVal = .3; 266 266 267 if( this->bForward ) { 267 if( this->bForward ) 268 { 268 269 accel += Vector(rotVal, 0, 0); 269 270 } 270 271 271 if( this->bBackward ) { 272 if( this->bBackward ) 273 { 272 274 accel -= Vector(rotVal,0,0); 273 275 } 274 if( this->bLeft) { 276 if( this->bLeft) 277 { 275 278 accel -= Vector(0,0,rotVal); 276 279 } 277 280 278 if( this->bRight) { 281 if( this->bRight) 282 { 279 283 accel += Vector(0,0,rotVal); 280 284 } 281 285 282 if (this->bAscend ) { 286 if (this->bAscend ) 287 { 283 288 accel += Vector(0,rotVal,0); 284 289 } 285 if (this->bDescend ) { 286 accel -= Vector(0,rotVal,0); 287 } 288 289 velocity += accel * 30.0; 290 if (this->bDescend ) 291 { 292 accel -= Vector(0,rotVal,0); 293 } 294 295 Vector tmp = this->getAbsDir().apply(accel * 30.0); 296 tmp.y = accel.y; 297 velocity += tmp; 298 290 299 291 300 this->setRelDirSoft(this->direction * Quaternion(-accel.x, Vector(0,0,1)) * Quaternion(accel.z, Vector(1,0,0)), 5);
Note: See TracChangeset
for help on using the changeset viewer.