--------------------------------------------------------------------------
| 559 | |
| 560 | //-------------------------------------------------------------------------- |
| 561 | void HoverVehicle::advanceTime(F32 dt) |
| 562 | { |
| 563 | Parent::advanceTime(dt); |
| 564 | |
| 565 | // Update jetsound... |
| 566 | if ( mJetSound ) |
| 567 | { |
| 568 | if ( mJetting ) |
| 569 | { |
| 570 | if ( !mJetSound->isPlaying() ) |
| 571 | mJetSound->play(); |
| 572 | |
| 573 | mJetSound->setTransform( getTransform() ); |
| 574 | } |
| 575 | else |
| 576 | mJetSound->stop(); |
| 577 | } |
| 578 | |
| 579 | // Update engine sound... |
| 580 | if ( mEngineSound ) |
| 581 | { |
| 582 | if ( !mEngineSound->isPlaying() ) |
| 583 | mEngineSound->play(); |
| 584 | |
| 585 | mEngineSound->setTransform( getTransform() ); |
| 586 | |
| 587 | F32 denom = mDataBlock->mainThrustForce + mDataBlock->strafeThrustForce; |
| 588 | F32 factor = getMin(mThrustLevel, denom) / denom; |
| 589 | F32 vol = 0.25 + factor * 0.75; |
| 590 | mEngineSound->setVolume( vol ); |
| 591 | } |
| 592 | |
| 593 | // Are we floating? If so, start the floating sound... |
| 594 | if ( mFloatSound ) |
| 595 | { |
| 596 | if ( mFloating ) |
| 597 | { |
| 598 | if ( !mFloatSound->isPlaying() ) |
| 599 | mFloatSound->play(); |
| 600 | |
| 601 | mFloatSound->setTransform( getTransform() ); |
| 602 | } |
| 603 | else |
| 604 | mFloatSound->stop(); |
| 605 | } |
| 606 | |
| 607 | updateJet(dt); |
| 608 | updateDustTrail( dt ); |
| 609 | } |
| 610 | |
| 611 | |
| 612 | //-------------------------------------------------------------------------- |
no test coverage detected