Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | List of all members
box2d::AABB Class Reference

Axis Aligned Bounding Box. More...

#include <AABB.hpp>

Public Member Functions

 AABB ()=default
 Default constructor. More...
 
constexpr AABB (const Length2D p) noexcept
 Initializing constructor for a single point. More...
 
constexpr AABB (const Length2D a, const Length2D b) noexcept
 Initializing constructor for two points. More...
 
constexpr Length2D GetLowerBound () const noexcept
 
constexpr Length2D GetUpperBound () const noexcept
 
constexpr bool Contains (const AABB aabb) const noexcept
 Does this AABB fully contain the given AABB. More...
 
constexpr AABBInclude (const AABB aabb) noexcept
 Combine an AABB into this one. More...
 
constexpr AABBInclude (const Length2D value) noexcept
 
constexpr AABBMove (const Length2D value) noexcept
 
constexpr AABBDisplace (const Length2D value) noexcept
 
constexpr AABBFatten (const Length value) noexcept
 Fattens an AABB by the given amount. More...
 

Detailed Description

Axis Aligned Bounding Box.

Note
This data structure is 16-bytes large (on at least one 64-bit platform).
Invariant
The lower bound always has lower x and y values than the upper bound's x and y values for any non-empty valid AABB.

Constructor & Destructor Documentation

◆ AABB() [1/3]

box2d::AABB::AABB ( )
default

Default constructor.

Constructs an empty AABB. If an empty AABB is added to another AABB, the result will always be the other AABB.

◆ AABB() [2/3]

constexpr box2d::AABB::AABB ( const Length2D  p)
inlinenoexcept

Initializing constructor for a single point.

◆ AABB() [3/3]

constexpr box2d::AABB::AABB ( const Length2D  a,
const Length2D  b 
)
inlinenoexcept

Initializing constructor for two points.

Member Function Documentation

◆ Contains()

constexpr bool box2d::AABB::Contains ( const AABB  aabb) const
inlinenoexcept

Does this AABB fully contain the given AABB.

◆ Displace()

constexpr AABB& box2d::AABB::Displace ( const Length2D  value)
inlinenoexcept

◆ Fatten()

constexpr AABB& box2d::AABB::Fatten ( const Length  value)
inlinenoexcept

Fattens an AABB by the given amount.

Warning
Behavior is undefined if given a negative value.

◆ GetLowerBound()

constexpr Length2D box2d::AABB::GetLowerBound ( ) const
inlinenoexcept

◆ GetUpperBound()

constexpr Length2D box2d::AABB::GetUpperBound ( ) const
inlinenoexcept

◆ Include() [1/2]

constexpr AABB& box2d::AABB::Include ( const AABB  aabb)
inlinenoexcept

Combine an AABB into this one.

◆ Include() [2/2]

constexpr AABB& box2d::AABB::Include ( const Length2D  value)
inlinenoexcept

◆ Move()

constexpr AABB& box2d::AABB::Move ( const Length2D  value)
inlinenoexcept

The documentation for this class was generated from the following file: