DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ HandleBoatSplashSound()

void BoatScript::HandleBoatSplashSound ( )
inlineprotected

См. определение в файле BoatScript.c строка 606

607 {
608 float propPosRelative = GetGame().SurfaceGetSeaLevel() - CoordToParent(PropellerGetPosition())[1];
609 if (propPosRelative < SPLASH_THRESHOLD_CONDITION)
610 m_SplashIncoming = true;
611
612 if (m_SplashIncoming && propPosRelative > SPLASH_THRESHOLD)
613 {
614 m_SoundWaterSplashEffect = SEffectManager.CreateSound(m_SoundWaterSplash, GetPosition());
615 m_SoundWaterSplashEffect.SetAttachmentParent(this);
616 m_SoundWaterSplashEffect.SetLocalPosition(PropellerGetPosition());
617 m_SoundWaterSplashEffect.SetAutodestroy(true);
618
619 vector velocity = dBodyGetVelocityAt(this, CoordToParent(PropellerGetPosition()));
620 float speed = velocity.Normalize() * 3.6; // to km/h
621 float lerp = Math.InverseLerp(0, 30, speed);
622 m_SoundWaterSplashEffect.SetSoundVolume(lerp);
623
625
626 m_SplashIncoming = false;
627 }
628 }
string m_SoundWaterSplash
Определения BoatScript.c:67
ref EffectSound m_SoundWaterSplashEffect
Определения BoatScript.c:75
bool m_SplashIncoming
Определения BoatScript.c:56
const float SPLASH_THRESHOLD_CONDITION
Определения BoatScript.c:39
const float SPLASH_THRESHOLD
Определения BoatScript.c:40
proto native float SurfaceGetSeaLevel()
proto float Normalize()
Normalizes vector. Returns length.
proto native CGame GetGame()
proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos)
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

Перекрестные ссылки SEffectManager::CreateSound(), dBodyGetVelocityAt(), GetGame(), GetPosition, Math::InverseLerp(), m_SoundWaterSplash, m_SoundWaterSplashEffect, m_SplashIncoming, vector::Normalize(), SPLASH_THRESHOLD, SPLASH_THRESHOLD_CONDITION и CGame::SurfaceGetSeaLevel().

Используется в EOnPostSimulate().