MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / advanceTime

Method advanceTime

Engine/source/T3D/vehicles/hoverVehicle.cpp:561–609  ·  view source on GitHub ↗

--------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

559
560//--------------------------------------------------------------------------
561void 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//--------------------------------------------------------------------------

Callers 1

updateJetMethod · 0.45

Calls 6

advanceTimeFunction · 0.85
isPlayingMethod · 0.45
playMethod · 0.45
setTransformMethod · 0.45
stopMethod · 0.45
setVolumeMethod · 0.45

Tested by

no test coverage detected