bitshifter / glam-rs

A simple and fast linear algebra library for games and graphics
Apache License 2.0
1.46k stars 145 forks source link

`Mat4::frustum_{lh,rh{,_gl}}` #529

Open valaphee opened 1 month ago

valaphee commented 1 month ago

Solves https://github.com/bitshifter/glam-rs/issues/441

valaphee commented 1 month ago

perspective could be built on top of frustum, but would incur some overhead, and the test currently works by comparing perspective, with frustum.

Could change the test to also check projections.

bitshifter commented 1 month ago

Thanks for taking this on!

It looks like clippy is failing because perspective is unused in the tests you've added, from your comment above it sounded like you were intending to use that value in the test though?

As for perspective being constructed from frustum, I don't have a strong opinion. Re-use is nice when it makes sense and a little perf hit isn't that big a deal IMO in these as I think they're not usually frequently called in hot code, but what might that look like?