Enemy vision

hiya guys. I have a rather hard request (well so i think). I wondering if its possible to have an enemy field of vision that is obstructed by objects. like the picture below

I suspect that the api tool is involved but i realy am not sure how i would pull this off.

thanks alot guys.