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

Method spaceIsOccupied

source/game/StarEntityMap.cpp:343–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343bool EntityMap::spaceIsOccupied(RectF const& rect, bool includesEphemeral) const {
344 for (auto const& entity : entityQuery(rect)) {
345 if (!includesEphemeral && entity->ephemeral())
346 continue;
347
348 for (RectF const& c : m_geometry.splitRect(entity->collisionArea(), entity->position())) {
349 if (!c.isNull() && rect.intersects(c))
350 return true;
351 }
352 }
353 return false;
354}
355
356}

Callers 2

canPlaceMaterialFunction · 0.80
perhapsCanPlaceMaterialFunction · 0.80

Calls 7

entityQueryFunction · 0.85
ephemeralMethod · 0.45
splitRectMethod · 0.45
collisionAreaMethod · 0.45
positionMethod · 0.45
isNullMethod · 0.45
intersectsMethod · 0.45

Tested by

no test coverage detected