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

Method findEntityLine

source/game/StarEntityMap.cpp:238–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238EntityPtr EntityMap::findEntityLine(Vec2F const& begin, Vec2F const& end, EntityFilter const& filter) const {
239 return findEntity(RectF::boundBoxOf(begin, end), [&](EntityPtr const& entity) {
240 if (m_geometry.lineIntersectsRect({begin, end}, entity->metaBoundBox().translated(entity->position()))) {
241 if (filter(entity))
242 return true;
243 }
244 return false;
245 });
246}
247
248EntityPtr EntityMap::findEntityAtTile(Vec2I const& pos, EntityFilterOf<TileEntity> const& filter) const {
249 RectF rect(Vec2F(pos[0], pos[1]), Vec2F(pos[0] + 1, pos[1] + 1));

Callers

nothing calls this directly

Calls 5

filterFunction · 0.85
lineIntersectsRectMethod · 0.80
translatedMethod · 0.45
metaBoundBoxMethod · 0.45
positionMethod · 0.45

Tested by

no test coverage detected