3 ms·
> Namely, how are you going to multiply a struct like d1 by an f32? https://en.wikipedia.org/wiki/Scalar_multiplication https://en.wikipedia.org/wiki/Scalar_mu
by hcs 7y ago
> Namely, how are you going to multiply a struct like d1 by an f32?
https://en.wikipedia.org/wiki/Scalar_multiplication https://en.wikipedia.org/wiki/Scalar_multiplication
Here's a Rust Playground with the vector math impls he's probably assuming (dummied):
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=066b625c9cdcb99091a1a8c608f20604 https://play.rust-lang.org/?version=stable&mode=debug&editio...
- leshow 7y agoOh yeah. It wasn't clear from the blog post that he had implemented some of the std::ops operators for his Vector3 struct. You can get rid of the superfluous & symbols by implementing for &Vector3 also, so again, the ergonomics section doesn't really resonate with me.