schteppe / p2.js

JavaScript 2D physics library
Other
2.64k stars 330 forks source link

* fix PIP function #222

Closed sonzqn closed 2 years ago

sonzqn commented 8 years ago

Hello I made some change in 'pointInConvex' functions:

Please review :) Thank you!

schteppe commented 8 years ago

Hello, thanks for the PR, but I think you've added a point-in-polygon check instead of a point-in-convex. If the shape is convex, one can bail out early instead of checking all edges. If the polygon is an arbitrary polygon, then all edges need to be checked.