Pyrr icon indicating copy to clipboard operation
Pyrr copied to clipboard

intersection testing: sphere - line segment

Open AGuyCoding opened this issue 4 years ago • 1 comments

Is it possible to extend the code to implement "Geometric collision / intersection testing" to calculate the intersection of a "line segment" and "sphere"?

AGuyCoding avatar Dec 18 '20 09:12 AGuyCoding

The current geometric testing API is limited and needs to be changed to return a structure of points, segments, lines, etc Something like:

{'points': [], 'segments': [], 'lines': [], ....}

Things like plane vs sphere becomes complicated, now you're returning a shape (2d circle with rotation). Handling those kinds of things gets tricky.

I'm not in a position to dedicate any time to this myself, but PRs with unit tests are welcome. Even if it just gets us part way there.

Bonus points: We should probably also put things like AABB, geometric testing, etc into an unstable module since they're a bit unloved and incomplete.

adamlwgriffiths avatar Dec 18 '20 11:12 adamlwgriffiths