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

◆ ComputeHitDirectionAngleDeg()

float DayZCreatureAI::ComputeHitDirectionAngleDeg ( EntityAI source)
inlineprotected

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

876 {
877 vector targetDirection = GetDirection();
878 vector toSourceDirection = (source.GetPosition() - GetPosition());
879
880 targetDirection[1] = 0;
881 toSourceDirection[1] = 0;
882
883 targetDirection.Normalize();
884 toSourceDirection.Normalize();
885
886 float cosFi = vector.Dot(targetDirection, toSourceDirection);
887 vector cross = targetDirection * toSourceDirection;
888
889 float dirAngleDeg = Math.Acos(cosFi) * Math.RAD2DEG;
890 if ( cross[1] < 0 )
891 dirAngleDeg = -dirAngleDeg;
892
893 return dirAngleDeg;
894 }
proto float Normalize()
Normalizes vector. Returns length.
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

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

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