A little bit of sight

Any tips on implementing something like radar?

It's a ray with an anchor point, a direction and a length. The result is from 0.0 to 1.0 along the length of the ray-segment.
What you describe is often called a ray cast. These are not implemented yet in Box2D. But to get you started, you can use b2World::Query to find all shapes that potentially intersect the bounding box of your ray. Then you can go through all those shapes and find the closest one.

To perform ray casts against a convex polygon you just need to clip the ray against all of the edges of the polygon. To speed this up, you should first test the ray against the AABB of the polygon using the separating axis test (SAT).

I'll add ray casts to the TODO list.

Original thread: https://box2d.org/forum/viewtopic.php?t=8