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

◆ IsEntityBehindEntityInAngle()

bool IsEntityBehindEntityInAngle ( EntityAI source,
EntityAI target,
float angle )
private

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

696 {
697 vector targetDirection = target.GetDirection();
698 ZombieBase targetZombie;
699 if (Class.CastTo(targetZombie, target))
700 {
701 targetDirection = Vector(targetZombie.GetOrientationSynced(),0,0);
702 targetDirection = targetDirection.AnglesToVector();
703 }
704 vector toSourceDirection = (source.GetPosition() - target.GetPosition());
705
706 targetDirection[1] = 0;
707 toSourceDirection[1] = 0;
708
709 targetDirection.Normalize();
710 toSourceDirection.Normalize();
711
712 float cosFi = vector.Dot(targetDirection, toSourceDirection);
713 vector cross = targetDirection * toSourceDirection;
714
715 int hitDir = Math.Acos(cosFi) * Math.RAD2DEG;
716
717 if (cross[1] < 0)
718 hitDir = -hitDir;
719
720 return hitDir <= (-180 + angle) || hitDir >= (180 - angle);
721 }
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения EnMath.c:7
Определения ZombieFemaleBase.c:2
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:305
proto float Normalize()
Normalizes vector. Returns length.
proto vector AnglesToVector()
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
Определения EnConvert.c:119
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Acos(float c)
Returns angle in radians from cosinus.
static const float RAD2DEG
Определения EnMath.c:16

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

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