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

Method updateEngineSound

Engine/source/T3D/vehicles/wheeledVehicle.cpp:1271–1289  ·  view source on GitHub ↗

---------------------------------------------------------------------------- Update engine sound This method is only invoked by clients. */

Source from the content-addressed store, hash-verified

1269 This method is only invoked by clients.
1270*/
1271void WheeledVehicle::updateEngineSound(F32 level)
1272{
1273 if ( !mEngineSound )
1274 return;
1275
1276 if ( !mEngineSound->isPlaying() )
1277 mEngineSound->play();
1278
1279 mEngineSound->setTransform( getTransform() );
1280 mEngineSound->setVelocity( getVelocity() );
1281 //mEngineSound->setVolume( level );
1282
1283 // Adjust pitch
1284 F32 pitch = ((level-sIdleEngineVolume) * 1.3f);
1285 if (pitch < 0.4f)
1286 pitch = 0.4f;
1287
1288 mEngineSound->setPitch( pitch );
1289}
1290
1291
1292//----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 6

getVelocityFunction · 0.85
isPlayingMethod · 0.45
playMethod · 0.45
setTransformMethod · 0.45
setVelocityMethod · 0.45
setPitchMethod · 0.45

Tested by

no test coverage detected