Gamedev Framework (gf)  0.11.0
A C++14 framework for 2D games
Public Member Functions | Public Attributes | List of all members
gf::Box< T, N > Struct Template Reference

A multi-dimensional box. More...

#include <gf/Box.h>

Public Member Functions

constexpr Box () noexcept
 
constexpr Box (Vector< T, N > p0, Vector< T, N > p1) noexcept
 
constexpr Box (const T(&p0)[N], const T(&p1)[N]) noexcept
 
constexpr Box (Vector< T, N > p) noexcept
 
constexpr Vector< T, NgetSize () const noexcept
 
constexpr bool isEmpty () const noexcept
 
constexpr Vector< T, NgetCenter () const noexcept
 
constexpr bool contains (Vector< T, N > point) const noexcept
 
constexpr bool contains (const Box< T, N > &other) const noexcept
 
constexpr bool intersects (const Box< T, N > &other) const noexcept
 
Box< T, NgetIntersection (const Box< T, N > &other) const noexcept
 
T getIntersectionVolume (const Box< T, N > &other) const noexcept
 
T getIntersectionExtentDistance (const Box< T, N > &other) const noexcept
 
constexpr void extend (const T(&point)[N]) noexcept
 
constexpr void extend (Vector< T, N > point) noexcept
 
constexpr void extend (const Box< T, N > &other) noexcept
 
constexpr Box< T, NgetExtended (const Box< T, N > &other) const noexcept
 
constexpr T getVolume () const noexcept
 
constexpr T getExtentDistance () const noexcept
 
constexpr T getMinimumEdge () const noexcept
 
constexpr void normalize () noexcept
 Ensures that min coordinates are less than max coordinates. More...
 

Public Attributes

Vector< T, Nmin
 
Vector< T, Nmax
 

Detailed Description

template<typename T, std::size_t N>
struct gf::Box< T, N >

A multi-dimensional box.

See also
gf::Rect

Constructor & Destructor Documentation

◆ Box() [1/4]

template<typename T, std::size_t N>
constexpr gf::Box< T, N >::Box ( )
inlinenoexcept

◆ Box() [2/4]

template<typename T, std::size_t N>
constexpr gf::Box< T, N >::Box ( Vector< T, N p0,
Vector< T, N p1 
)
inlinenoexcept

◆ Box() [3/4]

template<typename T, std::size_t N>
constexpr gf::Box< T, N >::Box ( const T(&)  p0[N],
const T(&)  p1[N] 
)
inlinenoexcept

◆ Box() [4/4]

template<typename T, std::size_t N>
constexpr gf::Box< T, N >::Box ( Vector< T, N p)
inlineexplicitnoexcept

Member Function Documentation

◆ contains() [1/2]

template<typename T, std::size_t N>
constexpr bool gf::Box< T, N >::contains ( Vector< T, N point) const
inlinenoexcept

◆ contains() [2/2]

template<typename T, std::size_t N>
constexpr bool gf::Box< T, N >::contains ( const Box< T, N > &  other) const
inlinenoexcept

◆ extend() [1/3]

template<typename T, std::size_t N>
constexpr void gf::Box< T, N >::extend ( const T(&)  point[N])
inlinenoexcept

◆ extend() [2/3]

template<typename T, std::size_t N>
constexpr void gf::Box< T, N >::extend ( Vector< T, N point)
inlinenoexcept

◆ extend() [3/3]

template<typename T, std::size_t N>
constexpr void gf::Box< T, N >::extend ( const Box< T, N > &  other)
inlinenoexcept

◆ getCenter()

template<typename T, std::size_t N>
constexpr Vector<T, N> gf::Box< T, N >::getCenter ( ) const
inlinenoexcept

◆ getExtended()

template<typename T, std::size_t N>
constexpr Box<T, N> gf::Box< T, N >::getExtended ( const Box< T, N > &  other) const
inlinenoexcept

◆ getExtentDistance()

template<typename T, std::size_t N>
constexpr T gf::Box< T, N >::getExtentDistance ( ) const
inlinenoexcept

◆ getIntersection()

template<typename T, std::size_t N>
Box<T, N> gf::Box< T, N >::getIntersection ( const Box< T, N > &  other) const
inlinenoexcept

◆ getIntersectionExtentDistance()

template<typename T, std::size_t N>
T gf::Box< T, N >::getIntersectionExtentDistance ( const Box< T, N > &  other) const
inlinenoexcept

◆ getIntersectionVolume()

template<typename T, std::size_t N>
T gf::Box< T, N >::getIntersectionVolume ( const Box< T, N > &  other) const
inlinenoexcept

◆ getMinimumEdge()

template<typename T, std::size_t N>
constexpr T gf::Box< T, N >::getMinimumEdge ( ) const
inlinenoexcept

◆ getSize()

template<typename T, std::size_t N>
constexpr Vector<T, N> gf::Box< T, N >::getSize ( ) const
inlinenoexcept

◆ getVolume()

template<typename T, std::size_t N>
constexpr T gf::Box< T, N >::getVolume ( ) const
inlinenoexcept

◆ intersects()

template<typename T, std::size_t N>
constexpr bool gf::Box< T, N >::intersects ( const Box< T, N > &  other) const
inlinenoexcept

◆ isEmpty()

template<typename T, std::size_t N>
constexpr bool gf::Box< T, N >::isEmpty ( ) const
inlinenoexcept

◆ normalize()

template<typename T, std::size_t N>
constexpr void gf::Box< T, N >::normalize ( )
inlinenoexcept

Ensures that min coordinates are less than max coordinates.

Member Data Documentation

◆ max

template<typename T, std::size_t N>
Vector<T, N> gf::Box< T, N >::max

◆ min

template<typename T, std::size_t N>
Vector<T, N> gf::Box< T, N >::min