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

◆ ComputeHitDirectionAngleEx()

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

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

951 {
952 vector targetDirection = GetDirection();
953 vector toSourceDirection = (pSource.GetPosition() - GetPosition());
954
955 targetDirection[1] = 0;
956 toSourceDirection[1] = 0;
957
958 targetDirection.Normalize();
959 toSourceDirection.Normalize();
960
961 float cosFi = vector.Dot(targetDirection, toSourceDirection);
962 vector cross = targetDirection * toSourceDirection;
963
964 float dirAngle = Math.Acos(cosFi) * Math.RAD2DEG;
965
966 // We will invert direction of the hit
967 if ( invertHitDir > 0 )
968 dirAngle -= 180;
969
970 if ( cross[1] < 0 )
971 dirAngle = -dirAngle;
972
973 return dirAngle;
974 }
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.

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