MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / polyOverlapArea

Method polyOverlapArea

source/base/StarWorldGeometry.cpp:264–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264float WorldGeometry::polyOverlapArea(PolyF const& poly1, PolyF const& poly2) const {
265 float area = 0.0f;
266 for (auto const& p1 : splitPoly(poly1)) {
267 for (auto const& p2 : splitPoly(poly2))
268 area += PolyF::clip(p1, p2).convexArea();
269 }
270 return area;
271}
272
273bool WorldGeometry::lineIntersectsRect(Line2F const& line, RectF const& rect) const {
274 for (auto l : splitLine(line)) {

Callers 2

updateForceRegionsMethod · 0.80
TESTFunction · 0.80

Calls 1

convexAreaMethod · 0.80

Tested by 1

TESTFunction · 0.64