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

◆ HandleBoatSplashSound()

void BoatScript::HandleBoatSplashSound ( )
inlineprotected

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

663 {
664 float propPosRelative = GetGame().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 }
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 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().