* Vector2 type */
| 16 | * Vector2 type |
| 17 | */ |
| 18 | class Vector2 : public ::Vector2 { |
| 19 | public: |
| 20 | constexpr Vector2(const ::Vector2& vec) : ::Vector2{vec.x, vec.y} {} |
| 21 | |
| 22 | constexpr Vector2(float x = 0, float y = 0) : ::Vector2{x, y} {} |
| 23 | |
| 24 | GETTERSETTER(float, X, x) |
| 25 | GETTERSETTER(float, Y, y) |
| 26 | |
| 27 | /** |
| 28 | * Set the Vector2 to the same as the given Vector2. |
| 29 | */ |
| 30 | Vector2& operator=(const ::Vector2& vector2) { |
| 31 | set(vector2); |
| 32 | return *this; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Determine whether or not the vectors are equal. |
| 37 | */ |
| 38 | constexpr bool operator==(const ::Vector2& other) const { return x == other.x && y == other.y; } |
| 39 | |
| 40 | /** |
| 41 | * Determines if the vectors are not equal. |
| 42 | */ |
| 43 | constexpr bool operator!=(const ::Vector2& other) const { return !(*this == other); } |
| 44 | |
| 45 | RLCPP_NODISCARD std::string ToString() const { return TextFormat("Vector2(%f, %f)", x, y); } |
| 46 | |
| 47 | operator std::string() const { return ToString(); } |
| 48 | |
| 49 | #ifndef RAYLIB_CPP_NO_MATH |
| 50 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected