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

◆ EvaluateDeathAnimation()

bool DayZPlayer::EvaluateDeathAnimation ( int pDamageType,
EntityAI pSource,
string pAmmoType,
out int pAnimType,
out float pAnimHitDir )
inlineprotected

selects animation type and direction based on damage system data

direction

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

1352 {
1353 bool doPhxImpulse = GetGame().ConfigGetInt("cfgAmmo " + pAmmoType + " doPhxImpulse") > 0;
1354
1355 pAnimType = DayZPlayerConstants.DEATH_DEFAULT;
1356 if (doPhxImpulse)
1357 pAnimType = DayZPlayerConstants.DEATH_FAST;
1358
1360 vector targetDirection = GetDirection();
1361 vector toSourceDirection = (pSource.GetPosition() - GetPosition());
1362
1363 targetDirection[1] = 0;
1364 toSourceDirection[1] = 0;
1365
1366 targetDirection.Normalize();
1367 toSourceDirection.Normalize();
1368
1369 float cosFi = vector.Dot(targetDirection, toSourceDirection);
1370 vector cross = targetDirection * toSourceDirection;
1371
1372 pAnimHitDir = Math.Acos(cosFi) * Math.RAD2DEG;
1373 if (cross[1] < 0)
1374 pAnimHitDir = -pAnimHitDir;
1375
1376 return true;
1377 }
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto float Normalize()
Normalizes vector. Returns length.
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

Перекрестные ссылки Math::Acos(), CGame::ConfigGetInt(), vector::Dot(), GetGame(), GetPosition, vector::Normalize() и Math::RAD2DEG.

Используется в EEHitBy().