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

Method rectIntersectsRect

source/base/StarWorldGeometry.cpp:241–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241bool WorldGeometry::rectIntersectsRect(RectF const& rect1, RectF const& rect2) const {
242 for (auto const& r1 : splitRect(rect1)) {
243 for (auto const& r2 : splitRect(rect2)) {
244 if (r1.intersects(r2))
245 return true;
246 }
247 }
248 return false;
249}
250
251RectF WorldGeometry::rectOverlap(RectF const& rect1, RectF const& rect2) const {
252 return rect1.overlap(RectF::withSize(nearestTo(rect1.min(), rect2.min()), rect2.size()));

Callers 5

debugShowSpawnCellsMethod · 0.80
updateForceRegionsMethod · 0.80
isVisibleToPlayerMethod · 0.80
entityQueryImplFunction · 0.80
updateMethod · 0.80

Calls 1

intersectsMethod · 0.45

Tested by

no test coverage detected