feat: Add leftTranslateByVector2 method to Matrix4
As a follow-up of https://github.com/google/vector_math.dart/pull/349, we might want to support leftTranslateByVector2, for the same reasons.
Note: there were no tests that I could find for the other broken down methods, so I added some assertions. Please let me know if they should be somewhere else or if we want more exhaustive tests.
Note: I am not implementing an equivalent for the scale method because the default implementation of falling back y and z to x felt less intuitive when using a Vector2. It would mean that scaling by a Vector2 v would be equivalent to scale by v.x, v.y, v.x, 1.0, which isn't quite as clear as the translation case. But I'd be happy to add the helper if desired.
@kevmoo updated this one with rebase + changelog entry 🙇
Would you include more details? I don't know what "left" means here.
coverage: 27.015% (+0.2%) from 26.849% when pulling 708eb84f5e258e1f673c87fd83c9790a643cce1d on luanpotter:luan.leftTranslateByVector2 into be9974e7c6590b44e01d6f7cf77267f06d1ac677 on google:master.
@kevmoo this is mostly for consistent with the existing leftTranslate series of methods, so they match the (right) translate.
The direction here is whether this matrix is multiplied from the left or from the right with the resulting translation matrix, which can have different results. I added a bit more detail to the changelog, please let me know if you want me to elaborate more (but this is in line with how all the existing methods are named and described in the docs).
This is also parallel to https://github.com/google/vector_math.dart/pull/354 btw