How to give a circular FOV effect around the character with raycaster?

I want to use raycast like YouTube videos on this link to give a circular view around the character.
I’m developing using the phaser-raycaster library, and I need help in creating a function that limits the field of vision to a circle.

image

This ray reaches the end of the map without hitting the pink circle.
sample code [ link ]

what i want

my one

sorry for my bad english

Maybe you have to put the origin inside a polygon obstacle.

wow

Samme, thank you.
Thanks to your help, I was able to make it this far.
My last task is now to blur the edges of the polygon.
and i want make the objects in the small circle area visible from the code below.
If you look at my code, you know what I’m trying to do.

For the blur I think you can draw the intersections graphics onto a render texture and apply a postFX filter. I don’t have quite the right filter though.

Got help from Rich: