beardgame / utilities

General C# (game) utilities library, containing a variety of useful types and algorithms
MIT License
28 stars 14 forks source link

Implement 2D Ray type #230

Open tomrijnbeek opened 3 years ago

tomrijnbeek commented 3 years ago

🆙 Improvement proposal

Implement a type to represent a ray. We should have both 2D and 3D rays. This issue specifically proposes to implement a 2D ray.

Context

Ray-ray intersections, and other geometric constructions or intersections, are a common staple in games. Having a single implementation, which is correct (enforced by tests) and performant (ideally enforced by benchmarks) would be hugely beneficial. Having a ray representation would be the first requirement in implementing geometric constructions around rays.

tomrijnbeek commented 2 years ago

Inspiration: https://github.com/beardgame/td/tree/develop/src/Bearded.TD/Utilities/Geometry