public void Query(AABB aabb, List <Body> bodies) { if (!this.aABB.Contains(aabb)) { return; } bodies.AddRange(this.bodies.Where(body => body.shape.aABB.Contains(aabb))); if (subDivided) { northeast.Query(aabb, bodies); northwest.Query(aabb, bodies); southeast.Query(aabb, bodies); southwest.Query(aabb, bodies); } }
public override void Query(AABB aabb, List <Body> bodies) { rootNode.Query(aabb, bodies); potientialCollisionCount = potientialCollisionCount + bodies.Count; }