16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 22:39:18 +02:00

build 171227. cab shadows, wheel flat size as trigger for associated sound, ai diesel acceleration fix

This commit is contained in:
tmj-fstate
2017-12-27 21:10:52 +01:00
parent fcc490f1b8
commit e55f7ed02a
6 changed files with 329 additions and 132 deletions

View File

@@ -3733,10 +3733,10 @@ void TDynamicObject::RenderSounds() {
}
// flat spot sound
if( ( GetVelocity() > 1.0 )
&& ( true == TestFlag( MoverParameters->DamageFlag, dtrain_wheelwear ) ) ) {
&& ( MoverParameters->WheelFlat > 5.0 ) ) {
m_wheelflat
.pitch( m_wheelflat.m_frequencyoffset + std::abs( MoverParameters->nrot ) * m_wheelflat.m_frequencyfactor )
.gain( m_wheelflat.m_amplitudeoffset + 0.4 + 0.6 * ( MoverParameters->Vel * m_wheelflat.m_amplitudefactor ) )
.gain( m_wheelflat.m_amplitudeoffset + m_wheelflat.m_amplitudefactor * ( ( 1.0 + ( MoverParameters->Vel / MoverParameters->Vmax ) + clamp( MoverParameters->WheelFlat / 60.0, 0.0, 1.0 ) ) / 3.0 ) )
.play( sound_flags::exclusive | sound_flags::looping );
}
else {