MCPcopy Create free account
hub / github.com/alecthomas/entityx / collide

Method collide

examples/example.cc:217–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215 }
216
217 void collide(ex::EventManager &events) {
218 for (const std::vector<Candidate> &candidates : grid) {
219 for (const Candidate &left : candidates) {
220 for (const Candidate &right : candidates) {
221 if (left.entity == right.entity) continue;
222 if (collided(left, right))
223 events.emit<CollisionEvent>(left.entity, right.entity);
224 }
225 }
226 }
227 }
228
229 float length(const sf::Vector2f &v) {
230 return std::sqrt(v.x * v.x + v.y * v.y);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected