I'm searching for information about optimization for collision detection.
There is an object (circle) which is moving from point a to point b. This object has radius r, and there are many obstacles (circle) in field too.

I have an algorithm (function) that checks collision between a circle and a capsule, and I currently call this function for every obstacle:
for-each (o : obstacles)
if collide(o, Capsule(a,b,r))
return true;
return false;
Many obstacles are very far away from the moving object and they can be ignored from checking with the collision detection function.
My question is:
Is there a solution to ignore checking all obstacles with collision detection function? Something like Nearest neighbor search or KD trees?
EDIT : All obstacles have same radius.
