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

Method lineIntersectsCircle

source/base/StarWorldGeometry.cpp:317–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317bool WorldGeometry::lineIntersectsCircle(Line2F const& line, Vec2F const& center, float radius) const {
318 for (auto const& sline : splitLine(line)) {
319 if (sline.distanceTo(nearestTo(sline.center(), center)) <= radius)
320 return true;
321 }
322 return false;
323}
324
325Maybe<Vec2F> WorldGeometry::lineIntersectsPolyAt(Line2F const& line, PolyF const& poly) const {
326 for (auto a : splitLine(line, true)) {

Callers

nothing calls this directly

Calls 2

distanceToMethod · 0.80
centerMethod · 0.45

Tested by

no test coverage detected