Add methods to Vector2f

I’ve noticed there is no multLocal(float x, float y) method for the Vector2f class like there is for Vector3f or Vector4f. Only a multLocal(Vector2f vec2) method that requires creating a new Vector2f. The same is true for divideLocal. Could I sbumit a PR adding these methods?


I think it would be useful, at the same time it would be following the pattern of other related classes. I believe if you do it quickly (before January 23rd) it could still be in version 3.5.0.

1 Like

Actually, it couldn’t be in 3.5.0 because that release has been closed to new features since 15 December. But I see no harm adding methods to “master” branch for inclusion in v3.6.


Sound good I will create a PR for this very soon.

I am also thinking it could be a good idea to add the missing mult and divide method to the Vector3f class as well, specifically these 3 that appear to be missing:

mult(float xSclarar, float yScalar, float zScalar)
divide(float xDivisor, float yDivisor, float zDivisor)
divideLocal(float xDivisor, float yDivisor, float zDivisor)

And I could also add these 3 missing methods to the Vector4f class so all vector classes’ simple math methods would follow the same format for add/subtract/mult/divide methods. I know vec2 and vec4 aren’t used as commonly so that’s likely why they’re missing more than vec3, but I figure it wont take long if I’m already doing it for the one class since the methods are all identical, so may as well update the rest too while I’m at it.