| 102 | } |
| 103 | |
| 104 | bool DamageSource::intersectsWithPoly(WorldGeometry const& geometry, PolyF const& targetPoly) const { |
| 105 | if (auto poly = damageArea.ptr<PolyF>()) |
| 106 | return geometry.polyIntersectsPoly(*poly, targetPoly); |
| 107 | else if (auto line = damageArea.ptr<Line2F>()) |
| 108 | return geometry.lineIntersectsPoly(*line, targetPoly); |
| 109 | else |
| 110 | return false; |
| 111 | } |
| 112 | |
| 113 | Vec2F DamageSource::knockbackMomentum(WorldGeometry const& worldGeometry, Vec2F const& targetCenter) const { |
| 114 | if (auto v = knockback.ptr<Vec2F>()) { |