rustgd / cgmath

A linear algebra and mathematics library for computer graphics.
https://docs.rs/cgmath
Apache License 2.0
1.12k stars 155 forks source link

No Basis3 or Matrix3 identity? #518

Open thorlucas opened 3 years ago

thorlucas commented 3 years ago

Why is there no way to just do Basis3::<f32>::identity()?

kvark commented 3 years ago

You can do Basis3::one() or Basis3::from_quaternion(Quaternion::one())

thorlucas commented 3 years ago

Thanks! I find that to be a bit of an unintuitive way to name it, no?

kvark commented 3 years ago

Yes, well, it's just that cgmath has a One trait that it tries to use everywhere.. It could have an alias method named identity in the basis3