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

◆ OnContact()

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

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

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

1325 {
1326 if (GetGame().IsServer())
1327 {
1328 #ifdef DIAG_DEVELOPER
1329 m_ContactCalled = true;
1330 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.CONTACT)
1331 {
1332 string output = "Zone: " + zoneName + " | Impulse:" + data.Impulse;
1333 Debug.Log(output);
1334 }
1335 #endif
1336 if (m_ContactCache.Count() == 0)
1337 {
1338 array<ref CarContactData> ccd = new array<ref CarContactData>;
1339 m_ContactCache.Insert(zoneName, ccd);
1340 float momentumDelta = GetMomentum() - m_MomentumPrevTick;
1341 float dot = vector.Dot(m_VelocityPrevTick.Normalized(), GetVelocity(this).Normalized());
1342 if (dot < 0)
1343 {
1344 momentumDelta = m_MomentumPrevTick;
1345 }
1346
1347 ccd.Insert(new CarContactData(localPos, other, momentumDelta));
1348 }
1349 }
1350 }
void Debug()
Определения UniversalTemperatureSource.c:349
vector m_VelocityPrevTick
Определения CarScript.c:171
float m_MomentumPrevTick
Определения CarScript.c:170
ref CarContactCache m_ContactCache
Определения CarScript.c:172
proto native CGame GetGame()
float Impulse
Impulse applied to resolve the collision.
Определения EnPhysics.c:337
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.

Перекрестные ссылки vector::Dot(), GetGame(), GetVelocity(), Contact::Impulse, Debug::Log(), m_ContactCache, m_MomentumPrevTick и m_VelocityPrevTick.