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

◆ ComputeHitDirectionAngle()

float DayZInfected::ComputeHitDirectionAngle ( EntityAI pSource)
inlineprotected

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

930 {
931 vector targetDirection = GetDirection();
932 vector toSourceDirection = (pSource.GetPosition() - GetPosition());
933
934 targetDirection[1] = 0;
935 toSourceDirection[1] = 0;
936
937 targetDirection.Normalize();
938 toSourceDirection.Normalize();
939
940 float cosFi = vector.Dot(targetDirection, toSourceDirection);
941 vector cross = targetDirection * toSourceDirection;
942
943 float dirAngle = Math.Acos(cosFi) * Math.RAD2DEG;
944 if ( cross[1] < 0 )
945 dirAngle = -dirAngle;
946
947 return dirAngle;
948 }
proto float Normalize()
Normalizes vector. Returns length.
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

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

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