227    {
  229        foreach (string zoneName: blacklistedDamageZones)
  230        {
  231            if (obj.GetDamageZoneNameByComponentIndex(cInfo.component) == zoneName)
  232            {
  233                return false;
  234            }
  235        }
  236 
  237        vector componentPos = cInfo.componentCenter;
 
  238        
  239        
  240        float componentMaxDist2 = 
Math.
SqrFloat(settings.MaxDist + cInfo.componentRadius * obj.GetScale());
 
  243        if (componentDistance2 > componentMaxDist2)
  244        {
  245            return false;
  246        }
  247        
  248        
  249        
  250        
  252        if (componentAngle > settings.ConeHalfAngle)
  253        {
  254            return false;
  255        }
  256            
  257        
  259        {
  260            return false;
  261        }
  262 
  263        
  264        result.ComponentPos = componentPos;
  265        result.ComponentAngle = componentAngle;
  266        result.ComponentDistance2 = componentDistance2;
  267        result.ComponentIdx = cInfo.component;
  268        
  269        return true;
  270    }
bool IsMeleeTargetObstructed(vector rayStart, vector rayEnd)
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static proto float AngleFromPosition(vector origin, vector originDir, vector target)
Angle that a target is from the direction of an origin.
static proto vector NearestPoint(vector beg, vector end, vector pos)
Point on line beg .. end nearest to pos.
static proto float SqrFloat(float f)
Returns squared value.
static const float RAD2DEG
static proto float AbsFloat(float f)
Returns absolute value.