Fix integer vector mul/div operators and bindings.

* Vector2i and Vector3i mul/div by a float results in Vector2 and Vector3 respectively.
* Create specializations to allow proper bindings.

This fixes #44408 and supersedes #44441 and keeps the same rule of int <op> float returnig float, like with scalars.
This commit is contained in:
reduz 2022-02-03 22:16:58 +01:00 committed by Rémi Verschelde
parent fd0d2dcabf
commit 8c7268664d
No known key found for this signature in database
GPG key ID: C3336907360768E1
9 changed files with 188 additions and 46 deletions

View file

@ -343,6 +343,9 @@ Vector3 &Vector3::operator*=(const real_t p_scalar) {
return *this;
}
// Multiplication operators required to workaround issues with LLVM using implicit conversion
// to Vector2i instead for integers where it should not.
_FORCE_INLINE_ Vector3 operator*(const float p_scalar, const Vector3 &p_vec) {
return p_vec * p_scalar;
}