12 float xP = x * cosR - y * sinR;
13 float yP = x * sinR + y * cosR;
15 return fabs(xP) <=
size.
X / 2.0f && fabs(yP) <=
size.
Y / 2.0f;
Defines the Rectangle class for representing rectangular shapes in 2D space.
static const float MPID180
The value of , useful for converting degrees to radians.
Rectangle(Vector2D center, Vector2D size, float rotation)
Constructs a Rectangle object with specified center, size, and rotation.
bool IsInShape(Vector2D point) override
Checks if a given point lies within the rectangle's boundaries.
Abstract base class for 2D geometric shapes.
float rotation
The rotation of the shape in degrees.
Vector2D center
The center point of the shape.
Vector2D size
The size of the shape, large enough to fit within a bounding rectangle.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
float X
The X-component of the 2D vector.
float Y
The Y-component of the 2D vector.