---------------------------------------------------------------------------- Update engine sound This method is only invoked by clients. */
| 1269 | This method is only invoked by clients. |
| 1270 | */ |
| 1271 | void 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 | //---------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected