DayZ 1.29
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 строка 1440

1441 {
1442 bool doPhxImpulse = g_Game.ConfigGetInt("cfgAmmo " + pAmmoType + " doPhxImpulse") > 0;
1443
1444 pAnimType = DayZPlayerConstants.DEATH_DEFAULT;
1445 if (doPhxImpulse)
1446 pAnimType = DayZPlayerConstants.DEATH_FAST;
1447
1449 vector targetDirection = GetDirection();
1450 vector toSourceDirection = (pSource.GetPosition() - GetPosition());
1451
1452 targetDirection[1] = 0;
1453 toSourceDirection[1] = 0;
1454
1455 targetDirection.Normalize();
1456 toSourceDirection.Normalize();
1457
1458 float cosFi = vector.Dot(targetDirection, toSourceDirection);
1459 vector cross = targetDirection * toSourceDirection;
1460
1461 pAnimHitDir = Math.Acos(cosFi) * Math.RAD2DEG;
1462 if (cross[1] < 0)
1463 pAnimHitDir = -pAnimHitDir;
1464
1465 return true;
1466 }
DayZGame g_Game
Определения DayZGame.c:3942
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().