aabbQuery method
Returns all the bodies within an AABB. @param result An array to store resulting bodies in.
Implementation
@override
List<Body> aabbQuery(World world, AABB aabb, [List<Body>? result]){
result ??= [];
if (dirty) {
sortList();
dirty = false;
}
final axisList = this.axisList;
for (int i = 0; i < axisList.length; i++) {
final b = axisList[i];
if (b.aabbNeedsUpdate) {
b.updateAABB();
}
if (b.aabb.overlaps(aabb)) {
result.add(b);
}
}
return result;
}