SFML community forums
General => Feature requests => Topic started by: DragonRock on November 06, 2017, 02:49:24 pm
-
Hi !
This feature would not bring much but I feel like it would make sense to have the operators *= and /= between two vectors. Currently, we can do this:
sf::Vector2f v1(1.0, 2.0);
sf::Vector2f v2(1.0, 2.0);
v1 = v1 * v2;
but we can't do this
sf::Vector2f v1(1.0, 2.0);
sf::Vector2f v2(1.0, 2.0);
v1 *= v2;
Is there any reason for this ?
Thank you in advance.
-
Please use the search function, this has been discussed so many times already.
-
I tried to search the forum for "Multiplication", "Multiply" and "Multiply Assignement", and it didn't find anything (https://gist.github.com/tforgione/5d5588c34ff91cd672f49b7492c4969d/raw/5d816b1ef8ff3c042032ff2f4ff4c404ffa7ccf8/image.png). But apparently, if I click on search again, it finds result (which I didn't know before creating this feature request, sorry about that).
Anyway, after re-reading the docs, and reading the related posts, I understand why you don't want to make this function.
Sorry for the inconvenience.
-
The forum search is context-sensitive. That means when you search from the "Feature requests" board, the other boards are not searched.
-
Oh I see. Thanks for the information.
-
Just to clarify your original post a little:
sf::Vector2f v1(1.0, 2.0);
sf::Vector2f v2(1.0, 2.0);
v1 = v1 * v2;
is not possible.
-
Yes, this is why I edited the post to strike the "Currently we can do".
I thought we could multiply vectors using operator* between two vectors, but not using the *= operator, so I thought that it was weird.
I initially thought that because the rust-sfml binding allows multipliying two vectors together (and also has some other operators such as vector + number, etc...)