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

◆ HandleBoatSplashSound()

void BoatScript::HandleBoatSplashSound ( )
inlineprotected

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

673 {
674 float propPosRelative = g_Game.SurfaceGetSeaLevel() - CoordToParent(PropellerGetPosition())[1];
675 if (propPosRelative < SPLASH_THRESHOLD_CONDITION)
676 m_SplashIncoming = true;
677
678 if (m_SplashIncoming && propPosRelative > SPLASH_THRESHOLD)
679 {
680 m_SoundWaterSplashEffect = SEffectManager.CreateSound(m_SoundWaterSplash, GetPosition());
681 m_SoundWaterSplashEffect.SetAttachmentParent(this);
682 m_SoundWaterSplashEffect.SetLocalPosition(PropellerGetPosition());
683 m_SoundWaterSplashEffect.SetAutodestroy(true);
684
685 vector velocity = dBodyGetVelocityAt(this, CoordToParent(PropellerGetPosition()));
686 float speed = velocity.Normalize() * 3.6; // to km/h
687 float lerp = Math.InverseLerp(0, 30, speed);
688 m_SoundWaterSplashEffect.SetSoundVolume(lerp);
689
691
692 m_SplashIncoming = false;
693 }
694 }
DayZGame g_Game
Определения DayZGame.c:4074
string m_SoundWaterSplash
Определения BoatScript.c:75
ref EffectSound m_SoundWaterSplashEffect
Определения BoatScript.c:83
bool m_SplashIncoming
Определения BoatScript.c:64
const float SPLASH_THRESHOLD_CONDITION
Определения BoatScript.c:50
const float SPLASH_THRESHOLD
Определения BoatScript.c:51
proto float Normalize()
Normalizes vector. Returns length.
proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos)
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

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

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