Go to the source code of this file.
◆ CANGINE_VECTOR3_OP
| #define CANGINE_VECTOR3_OP |
( |
|
OP | ) |
|
Value:constexpr Vector3 operator OP(const Vector3& lhs, const Vector3& rhs) noexcept { return Vector3(lhs.x OP rhs.x, lhs.y OP rhs.y, lhs.z OP rhs.z); } \
constexpr Vector3 operator OP(const Vector3& lhs, float rhs) noexcept { return Vector3(lhs.x OP rhs, lhs.y OP rhs, lhs.z OP rhs); } \
constexpr Vector3 operator OP(float lhs, const Vector3& rhs) noexcept { return Vector3(lhs OP rhs.x, lhs OP rhs.y, lhs OP rhs.z); }
Defines the free binary operator OP for Vector3.
Expands to three overloads: vector-vector, vector-scalar and scalar-vector, each producing a new component-wise result.
- Parameters
-
| OP | The arithmetic operator token (+, -, * or /). |