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

◆ ComputeHitDirectionAngleEx()

float DayZInfected::ComputeHitDirectionAngleEx ( EntityAI pSource,
int invertHitDir = 0 )
inlineprotected

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

939 {
940 vector targetDirection = GetDirection();
941 vector toSourceDirection = (pSource.GetPosition() - GetPosition());
942
943 targetDirection[1] = 0;
944 toSourceDirection[1] = 0;
945
946 targetDirection.Normalize();
947 toSourceDirection.Normalize();
948
949 float cosFi = vector.Dot(targetDirection, toSourceDirection);
950 vector cross = targetDirection * toSourceDirection;
951
952 float dirAngle = Math.Acos(cosFi) * Math.RAD2DEG;
953
954 // We will invert direction of the hit
955 if ( invertHitDir > 0 )
956 dirAngle -= 180;
957
958 if ( cross[1] < 0 )
959 dirAngle = -dirAngle;
960
961 return dirAngle;
962 }
proto float Normalize()
Normalizes vector. Returns length.
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

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

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