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

◆ OnContact()

override void BoatScript::OnContact ( string zoneName,
vector localPos,
IEntity other,
Contact data )
inlineprotected

WARNING: Can be called very frequently in one frame, use with caution.

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

427 {
428 if (g_Game.IsServer())
429 {
430 if (m_ContactData)
431 return;
432
433 float momentumDelta = GetMomentum() - m_MomentumPrevTick;
434 float dot = vector.Dot(m_VelocityPrevTick.Normalized(), GetVelocity(this).Normalized());
435 if (dot < 0)
436 momentumDelta = m_MomentumPrevTick;
437
438 m_ContactData = new VehicleContactData();
439 m_ContactData.SetData(localPos, other, momentumDelta); // change to local pos
440 }
441
442 if (!IsProxy())
443 {
445 EngineStop();
446 }
447 }
DayZGame g_Game
Определения DayZGame.c:4074
bool IsProxy()
Определения Hand_Events.c:65
proto native void EngineStop()
Stops the engine.
proto native bool EngineIsOn()
Returns true when engine is running, false otherwise.
bool CheckOperationalState()
Определения BoatScript.c:572
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.

Перекрестные ссылки CheckOperationalState(), vector::Dot(), EngineIsOn(), EngineStop(), g_Game, GetVelocity() и IsProxy().