DayZ 1.28
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 строка 1414

1415 {
1416 bool doPhxImpulse = GetGame().ConfigGetInt("cfgAmmo " + pAmmoType + " doPhxImpulse") > 0;
1417
1418 pAnimType = DayZPlayerConstants.DEATH_DEFAULT;
1419 if (doPhxImpulse)
1420 pAnimType = DayZPlayerConstants.DEATH_FAST;
1421
1423 vector targetDirection = GetDirection();
1424 vector toSourceDirection = (pSource.GetPosition() - GetPosition());
1425
1426 targetDirection[1] = 0;
1427 toSourceDirection[1] = 0;
1428
1429 targetDirection.Normalize();
1430 toSourceDirection.Normalize();
1431
1432 float cosFi = vector.Dot(targetDirection, toSourceDirection);
1433 vector cross = targetDirection * toSourceDirection;
1434
1435 pAnimHitDir = Math.Acos(cosFi) * Math.RAD2DEG;
1436 if (cross[1] < 0)
1437 pAnimHitDir = -pAnimHitDir;
1438
1439 return true;
1440 }
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().