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

Method lineIntersectsRect

source/base/StarWorldGeometry.cpp:273–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273bool WorldGeometry::lineIntersectsRect(Line2F const& line, RectF const& rect) const {
274 for (auto l : splitLine(line)) {
275 for (auto box : splitRect(rect)) {
276 if (box.intersects(l)) {
277 return true;
278 }
279 }
280 }
281 return false;
282}
283
284bool WorldGeometry::lineIntersectsPoly(Line2F const& line, PolyF const& poly) const {
285 for (auto a : splitLine(line)) {

Callers 4

forEachEntityLineMethod · 0.80
findEntityLineMethod · 0.80
entityQueryImplFunction · 0.80
TESTFunction · 0.80

Calls 1

intersectsMethod · 0.45

Tested by 1

TESTFunction · 0.64