42 return xOverlap && yOverlap;
46 bool xOverlap = minI.
X <
max.
X && maxI.
X >
min.
X;
47 bool yOverlap = minI.
Y <
max.
Y && maxI.
Y >
min.
Y;
49 return xOverlap && yOverlap;
Defines the BoundingBox2D class for managing 2D bounding boxes.
Represents a 2D axis-aligned bounding box.
Vector2D GetCenter()
Gets the center point of the bounding box.
bool Overlaps(BoundingBox2D *bb)
Checks if this bounding box overlaps with another BoundingBox2D.
BoundingBox2D()
Default constructor initializing the bounding box to zero dimensions.
Vector2D min
Minimum corner of the bounding box.
Vector2D GetMinimum()
Gets the minimum corner of the bounding box.
Vector2D GetMaximum()
Gets the maximum corner of the bounding box.
bool Contains(const Vector2D &v)
Checks if this bounding box contains a specified point.
Vector2D max
Maximum corner of the bounding box.
Vector2D mid
Center point of the bounding box.
void UpdateBounds(const Vector2D ¤t)
Updates the bounds of the bounding box to include the specified point.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Vector2D Maximum(const Vector2D &v) const
Computes the maximum components between this vector and another Vector2D.
Vector2D Minimum(const Vector2D &v) const
Computes the minimum components between this vector and another Vector2D.
float X
The X-component of the 2D vector.
float Y
The Y-component of the 2D vector.