Closed krooq closed 4 years ago
mint
support. For example, you can look at the code in three-rs examples https://github.com/three-rs/three/pull/24:dir_light.transform_mut().look_at([150.0, 350.0, 350.0].into(),
[0.0, 0.0, 0.0].into(),
None);
Does that help?
I understand the "to mint" direction well. But how do I go about translating back to do some math? I feel like it's gonna get real ugly real quick if I'm calling into() every time I want to add 2 vectors together? Maybe this is only the case for operators? Maybe I'm missing something obvious?
Well, the point is that the ugly is an implementation detail. The PR I linked contains both "to mint" and "from mint" parts. For example of the latter, see look_at implementation.
Yeah ok, doesn't seem too bad really. I think my initial usage attempt was just bit under engineered. I'm used to things "just working" with Rust but here there is a little bit of extra work to do, which honestly I should have expected. Rust has spoiled me with it's type inference!
Thanks for explaining kvark! I'm thoroughly enjoying your contributions to the Rust ecosystem 😄
Alright, do you think there needs to be done about this? I.e. are readme changes needed?
More examples are always welcoming for newbies :) But I think those that are intending on integrating mint probably immediately know the implications of mint. The concept is pretty straight forward, I think I'm just fairly new to Rust so these things aren't so obvious to me.
Yeah, I believe that's the case.
At risk of sounding like an idiot, how does one actually use mint in their code?
Can someone whip up like a tiny example for me, maybe whack it in the README?