DayZ 1.30
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 строка 1456

1457 {
1458 bool doPhxImpulse = g_Game.ConfigGetInt("cfgAmmo " + pAmmoType + " doPhxImpulse") > 0;
1459
1460 pAnimType = DayZPlayerConstants.DEATH_DEFAULT;
1461 if (doPhxImpulse)
1462 pAnimType = DayZPlayerConstants.DEATH_FAST;
1463
1465 vector targetDirection = GetDirection();
1466 vector toSourceDirection = (pSource.GetPosition() - GetPosition());
1467
1468 targetDirection[1] = 0;
1469 toSourceDirection[1] = 0;
1470
1471 targetDirection.Normalize();
1472 toSourceDirection.Normalize();
1473
1474 float cosFi = vector.Dot(targetDirection, toSourceDirection);
1475 vector cross = targetDirection * toSourceDirection;
1476
1477 pAnimHitDir = Math.Acos(cosFi) * Math.RAD2DEG;
1478 if (cross[1] < 0)
1479 pAnimHitDir = -pAnimHitDir;
1480
1481 return true;
1482 }
DayZGame g_Game
Определения DayZGame.c:4074
proto float Normalize()
Normalizes vector. Returns length.
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

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

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