AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI::AABB Class Reference

Axis-Aligned Bounding Box. More...

#include <aeongui/AABB.hpp>

Public Member Functions

 AABB ()
 Default constructor. Initializes center and radii to zero.
 AABB (const Vector2 &aCenter, const Vector2 &aRadii)
 Construct an AABB from a center point and radii.
const Vector2GetCenter () const
 Get the center of the bounding box.
const Vector2GetRadii () const
 Get the radii (half-extents) of the bounding box.
double GetX () const
 Get the X coordinate of the top-left corner.
double GetY () const
 Get the Y coordinate of the top-left corner.
double GetWidth () const
 Get the width of the bounding box.
double GetHeight () const
 Get the height of the bounding box.

Detailed Description

Axis-Aligned Bounding Box.

Represents a 2D axis-aligned bounding box defined by a center point and radii (half-extents).

Constructor & Destructor Documentation

◆ AABB()

AeonGUI::AABB::AABB ( const Vector2 & aCenter,
const Vector2 & aRadii )

Construct an AABB from a center point and radii.

Parameters
aCenterThe center of the bounding box.
aRadiiThe half-extents (radii) along each axis.

Member Function Documentation

◆ GetCenter()

const Vector2 & AeonGUI::AABB::GetCenter ( ) const

Get the center of the bounding box.

Returns
Reference to the center vector.

◆ GetHeight()

double AeonGUI::AABB::GetHeight ( ) const

Get the height of the bounding box.

Returns
Height (2 * radii.y).

◆ GetRadii()

const Vector2 & AeonGUI::AABB::GetRadii ( ) const

Get the radii (half-extents) of the bounding box.

Returns
Reference to the radii vector.

◆ GetWidth()

double AeonGUI::AABB::GetWidth ( ) const

Get the width of the bounding box.

Returns
Width (2 * radii.x).

◆ GetX()

double AeonGUI::AABB::GetX ( ) const

Get the X coordinate of the top-left corner.

Returns
X position (center.x - radii.x).

◆ GetY()

double AeonGUI::AABB::GetY ( ) const

Get the Y coordinate of the top-left corner.

Returns
Y position (center.y - radii.y).

The documentation for this class was generated from the following files:
  • include/aeongui/AABB.hpp
  • core/AABB.cpp