Browse Source

Add cross product overload

pull/4537/head
joako1721 3 weeks ago
parent
commit
2f11227861
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      src/raymath.h

+ 10
- 0
src/raymath.h View File

@ -2694,6 +2694,11 @@ inline bool operator != (const Vector2& lhs, const Vector2& rhs)
return !FloatEquals(lhs.x, rhs.x) || !FloatEquals(lhs.y, rhs.y);
}
inline float operator ^ (const Vector2& lhs, const Vector2& rhs)
{
return Vector2CrossProduct(lhs, rhs);
}
// Vector3 operators
static constexpr Vector3 Vector3Zeros = { 0, 0, 0 };
static constexpr Vector3 Vector3Ones = { 1, 1, 1 };
@ -2788,6 +2793,11 @@ inline bool operator != (const Vector3& lhs, const Vector3& rhs)
return !FloatEquals(lhs.x, rhs.x) || !FloatEquals(lhs.y, rhs.y) || !FloatEquals(lhs.z, rhs.z);
}
inline Vector3 operator ^ (const Vector3& lhs, const Vector3& rhs)
{
return Vector3CrossProduct(lhs, rhs);
}
// Vector4 operators
static constexpr Vector4 Vector4Zeros = { 0, 0, 0, 0 };
static constexpr Vector4 Vector4Ones = { 1, 1, 1, 1 };

Loading…
Cancel
Save