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

◆ ComputeHitDirectionAngleDeg()

float DayZCreatureAI::ComputeHitDirectionAngleDeg ( EntityAI source)
inlineprotected

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

832 {
833 vector targetDirection = GetDirection();
834 vector toSourceDirection = (source.GetPosition() - GetPosition());
835
836 targetDirection[1] = 0;
837 toSourceDirection[1] = 0;
838
839 targetDirection.Normalize();
840 toSourceDirection.Normalize();
841
842 float cosFi = vector.Dot(targetDirection, toSourceDirection);
843 vector cross = targetDirection * toSourceDirection;
844
845 float dirAngleDeg = Math.Acos(cosFi) * Math.RAD2DEG;
846 if ( cross[1] < 0 )
847 dirAngleDeg = -dirAngleDeg;
848
849 return dirAngleDeg;
850 }
proto float Normalize()
Normalizes vector. Returns length.
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

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

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