Provide feature parity for Quaternion
with Godot by fpdotmonkey · Pull Request #981 · godot-rust/gdext (original) (raw)
- when using into one can easily say into::
Actually not, the way it's defined doesn't allow you to use turbofish .into::<Quaternion>()
. It's another common pitfall -- because the into()
function isn't generic itself, only the Into trait is 🙂
to_quat is a specific function to know, it could be to_quaternion instead, it's not as intuitive imo.
Fair point 🤔 it was added in #124 alongside Basis::from_quat
for the other direction. In the context it's probably quite clear, there are also other abbreviations in conversions, such as from_cols
, into_dyn
etc. But I'm also OK with changing it.
Thank you for illustrating me on this and sorry for having said something that dumb.
It's not dumb at all! I appreciate any input as long as it's constructive, and the fact that this has been brought up a few time shows that it's a frequent question, too. So no worries at all 😊
- I think it would be a nice addition to the book? A conversions between types section, maybe.
This particular instance is probably best kept in the API docs (as this is the place for looking up API of a concrete type). But what can make sense is to elaborate some general "conventions" or API designs that godot-rust uses. I'll make some notes about this.