This is more of a (I assume) a docs issue than a coding issue, so I thought I’d post in Suggestions & Feedback.
If you look up mul in the API reference, you’ll see it has the same description as mul2.
I’m confused because I’d assume, following the example of add & add2, and sub & sub2, that one would do the operation in place while the other would just return the result. But it seems like they both set the result to the vector it’s called on? Does this seem confusing to anyone else?
This will multiply vec_1 with vec_2 and set the result in vec_1.
vec_1.mul2(vec_2, vec_3);
This will multiply vec_2 with vec_3 and set the result in vec_1.
Yes, this is correct as we avoid allocating as much as we can in the engine for performance reasons. All the add, add2, sub, sub2 also return the vector it was called on to allow for chaining so you can do: