NVIDIAGameWorks / PhysX

NVIDIA PhysX SDK
Other
3.19k stars 809 forks source link

Point in Polygon problem #661

Open ViaCognita opened 4 months ago

ViaCognita commented 4 months ago

Hi!

First of all, I don't know if this is the right place to ask this question because I have no idea about NVIDIA PhysX.

I'm developing a game with Unreal Engine 5.4.2. with C++ and I need to find if a point is inside a polygon. Searching on Internet I have found someone mentioning that it can be done with PhysX. On Wikipedia, I have found that the Ray Casting algorithm or the Winding number algorithm can do it.

If I have a set of 2D points, how can I know if another point is inside the polygon defined by that set of points using PhysX? If it is possible.

Thanks!

vreutskyy commented 4 months ago

Hi @ViaCognita No, this isn't the right place. PhysX is a physics simulation library, and what you need is some geometry query library or just a function. I think the easiest thing you can do is just ask ChatGPT to write the function for you. It should be pretty simple. Cheers

PierreTerdiman commented 4 months ago

https://erich.realtimerendering.com/ptinpoly/