bonsairobo / building-blocks

A voxel library for real-time applications.
MIT License
369 stars 30 forks source link

Generic cgmath conversions #46

Closed eadf closed 3 years ago

eadf commented 3 years ago

Made the cgmath type conversions more generic. Tested on stable and nightly.

I suspected that the specific conversions i32->f32 would 'collide' with the generic ones. But Rust handles that just fine.

Since cgmath_conversions.rs is just a copy of nalgebra_conversions.rs I figure I could backport the changes to nalgebra (if you like.).

bonsairobo commented 3 years ago

Since cgmath_conversions.rs is just a copy of nalgebra_conversions.rs I figure I could backport the changes to nalgebra (if you like.).

@eadf Sure if you want to give it a try. I think nalgebra requires several trait bounds on the scalar type as well.

eadf commented 3 years ago

Since cgmath_conversions.rs is just a copy of nalgebra_conversions.rs I figure I could backport the changes to nalgebra (if you like.).

@eadf Sure if you want to give it a try. I think nalgebra requires several trait bounds on the scalar type as well.

Seems to be enough with nalgebra::base::Scalar