local SectorMissileShape = {} local _posTemp = FP.newV2(0, 0) local _dirTemp = FP.newV2(0, 0) local _rightTemp = FP.newV2(0, 0) local _toHitTemp = FP.newV2(0, 0) local _radiusTemp = FP.newV1(0) local _innerRadiusTemp = FP.newV1(0) local FP = FP function SectorMissileShape.SetMissileTrigger(data,pos,dir) _posTemp:Reset(pos) _dirTemp:Reset(dir) _rightTemp.x:Reset(dir.z) _rightTemp.z:Reset(dir.x):Negative() local dirClone = _dirTemp:cloneV2() local rightClone = _rightTemp:cloneV2() _posTemp:Add(dirClone:Mul(data.OffsetZ)) _posTemp:Add(rightClone:Mul(data.OffsetX)) FP.releaseV2(dirClone) FP.releaseV2(rightClone) end function SectorMissileShape.CanEnterTrigger(missile, hitEntityPos,hitEntityRadius) _radiusTemp:Reset(missile:GetShapeParam1()) if hitEntityRadius and hitEntityRadius > 0 then _radiusTemp:Add(hitEntityRadius) end _radiusTemp:Mul(_radiusTemp) local innerRadius = missile:GetShapeParam3() if innerRadius and innerRadius ~= FP.Const.Zero then _innerRadiusTemp:Reset(innerRadius):Mul(innerRadius) if not FP.V2.IsDistanceSqrGreater(_posTemp, hitEntityPos, _radiusTemp) and FP.V2.IsDistanceSqrGreater(_posTemp, hitEntityPos, _innerRadiusTemp) then _toHitTemp:Reset(hitEntityPos):Sub(_posTemp) _toHitTemp:Normalize() return FP.V2.Angle(_toHitTemp, _dirTemp) < missile:GetShapeParam2() end else if not FP.V2.IsDistanceSqrGreater(_posTemp, hitEntityPos, _radiusTemp) then _toHitTemp:Reset(hitEntityPos):Sub(_posTemp) _toHitTemp:Normalize() return FP.V2.Angle(_toHitTemp, _dirTemp) < missile:GetShapeParam2() end end return false end return SectorMissileShape