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

◆ OnContact()

override void OnContact ( string zoneName,
vector localPos,
IEntity other,
Contact data )
protected

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

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

1283 {
1284 if (GetGame().IsServer())
1285 {
1286 #ifdef DIAG_DEVELOPER
1287 m_ContactCalled = true;
1288 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.CONTACT)
1289 {
1290 string output = "Zone: " + zoneName + " | Impulse:" + data.Impulse;
1291 Debug.Log(output);
1292 }
1293 #endif
1294 if (m_ContactCache.Count() == 0)
1295 {
1297 m_ContactCache.Insert(zoneName, ccd);
1298 float momentumDelta = GetMomentum() - m_MomentumPrevTick;
1299 float dot = vector.Dot(m_VelocityPrevTick.Normalized(), GetVelocity(this).Normalized());
1300 if (dot < 0)
1301 {
1302 momentumDelta = m_MomentumPrevTick;
1303 }
1304
1305 ccd.Insert(new CarContactData(localPos, other, momentumDelta));
1306 }
1307 }
1308 }
vector m_VelocityPrevTick
Определения CarScript.c:143
float m_MomentumPrevTick
Определения CarScript.c:142
ref CarContactCache m_ContactCache
Определения CarScript.c:144
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Определения Debug.c:122
Определения Debug.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:271
Определения EnConvert.c:106
proto native CGame GetGame()
float Impulse
Определения EnPhysics.c:318
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.

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