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

Method forEachEntityLine

source/game/StarEntityMap.cpp:190–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void EntityMap::forEachEntityLine(Vec2F const& begin, Vec2F const& end, EntityCallback const& callback) const {
191 return m_spatialMap.forEach(m_geometry.splitRect(RectF::boundBoxOf(begin, end)), [&](EntityPtr const& entity) {
192 if (m_geometry.lineIntersectsRect({begin, end}, entity->metaBoundBox().translated(entity->position())))
193 callback(entity);
194 });
195}
196
197void EntityMap::forEachEntityAtTile(Vec2I const& pos, EntityCallbackOf<TileEntity> const& callback) const {
198 RectF rect(Vec2F(pos[0], pos[1]), Vec2F(pos[0] + 1, pos[1] + 1));

Callers 1

queryHitMethod · 0.45

Calls 6

lineIntersectsRectMethod · 0.80
forEachMethod · 0.45
splitRectMethod · 0.45
translatedMethod · 0.45
metaBoundBoxMethod · 0.45
positionMethod · 0.45

Tested by

no test coverage detected