yoanlcq / vek

Generic 2D-3D math swiss army knife for game engines, with SIMD support and focus on convenience.
https://docs.rs/vek
Apache License 2.0
282 stars 32 forks source link

`micromath` feature to avoid libm on embedded platforms #68

Open zesterer opened 3 years ago

zesterer commented 3 years ago

libm is not supported on several embedded platforms. micromath might be a viable and more portable alternative. A feature flag to enable its usage would improve portability.

zesterer commented 3 years ago

On second thoughts, it looks like this still wouldn't work with num_traits. That's a shame. It means that it's up to libm to support more platforms.

yoanlcq commented 3 years ago

Yes, I believe micromath would need some changes in order to be usable here, or at least, in a way that doesn't require rewriting vek not to depend on num-traits. Its F32Ext trait is almost like num_traits::Float. For some reason it is not implemented for f64.

I'm all for more portability but I think there's some work to do in the micromath side for that, and even so I'm not sure if vek is really problem solved for embedded systems, since these may have exotic requirements I was not aware of.

If someone really needs that, a good approach IMO could be to fork vek, experiment and break stuff to see how it goes. If it ends up working well, then I would be fine merging that.