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

◆ HandleBoatSplashSound()

void BoatScript::HandleBoatSplashSound ( )
inlineprotected

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

663 {
664 float propPosRelative = g_Game.SurfaceGetSeaLevel() - CoordToParent(PropellerGetPosition())[1];
665 if (propPosRelative < SPLASH_THRESHOLD_CONDITION)
666 m_SplashIncoming = true;
667
668 if (m_SplashIncoming && propPosRelative > SPLASH_THRESHOLD)
669 {
670 m_SoundWaterSplashEffect = SEffectManager.CreateSound(m_SoundWaterSplash, GetPosition());
671 m_SoundWaterSplashEffect.SetAttachmentParent(this);
672 m_SoundWaterSplashEffect.SetLocalPosition(PropellerGetPosition());
673 m_SoundWaterSplashEffect.SetAutodestroy(true);
674
675 vector velocity = dBodyGetVelocityAt(this, CoordToParent(PropellerGetPosition()));
676 float speed = velocity.Normalize() * 3.6; // to km/h
677 float lerp = Math.InverseLerp(0, 30, speed);
678 m_SoundWaterSplashEffect.SetSoundVolume(lerp);
679
681
682 m_SplashIncoming = false;
683 }
684 }
DayZGame g_Game
Определения DayZGame.c:3942
string m_SoundWaterSplash
Определения BoatScript.c:78
ref EffectSound m_SoundWaterSplashEffect
Определения BoatScript.c:86
bool m_SplashIncoming
Определения BoatScript.c:67
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().