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

◆ ComputeHitDirectionAngleDeg()

float DayZCreatureAI::ComputeHitDirectionAngleDeg ( EntityAI source)
inlineprotected

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

878 {
879 vector targetDirection = GetDirection();
880 vector toSourceDirection = (source.GetPosition() - GetPosition());
881
882 targetDirection[1] = 0;
883 toSourceDirection[1] = 0;
884
885 targetDirection.Normalize();
886 toSourceDirection.Normalize();
887
888 float cosFi = vector.Dot(targetDirection, toSourceDirection);
889 vector cross = targetDirection * toSourceDirection;
890
891 float dirAngleDeg = Math.Acos(cosFi) * Math.RAD2DEG;
892 if ( cross[1] < 0 )
893 dirAngleDeg = -dirAngleDeg;
894
895 return dirAngleDeg;
896 }
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.

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