Open bitshifter opened 2 years ago
Just poking through the open issues and seeing if there is anything I can help with.
Looks like length is already done: https://docs.rs/glam/0.21.3/glam/?search=length Direction would probably just be normalize which is already done too: https://docs.rs/glam/0.21.3/glam/?search=normalize Unless you meant something else.
Anything else needed/missing here?
We could probably add a doc alias for normalize or something if we wanted to make normalize show up when you search for "direction"
Late to the party, but I found this issue while looking whether there was something convenient to get both the direction and length of a vector, since normalizing it indirectly involves calculating the length. Something like the following:
let (norm, len) = some_vec.normalize_and_length();
yes, that's what I was meaning. I think I managed to completely miss paul-hansen's comment from 2 years ago, whoops!
It's not uncommon to find the direction and length of a vector, but it is a hassle to do it manually. It would be good to have a method for this.