alternative Standard Libary  0.29.8
std::math::boundingbox< T > Template-Klassenreferenz

a clasd for a BoundingBox Mehr ...

#include <boundingbox.hpp>

Öffentliche Typen

using self_type = boundingbox< T >
 
using value_type = T
 
using pointer = T *
 

Öffentliche Methoden

 boundingbox (vector3< T > min, vector3< T > max)
 create the BoundingBox from max and min type Mehr ...
 
contains_t contains (const boundingbox< T > &box)
 contain the other box this box Mehr ...
 
contains_t contains (vector3< T > point)
 cheak of the point contains this class Mehr ...
 
void getcorners (vector3< T > corners[CornerCount])
 get the corners of this box Mehr ...
 
bool Intersects (const boundingbox< T > &box)
 cheak of intersect the other box this box Mehr ...
 
self_typeoperator= (const self_type &v)
 
vector3< T > getmin ()
 
vector3< T > getmax ()
 
virtual std::string to_string ()
 

Öffentliche Attribute

const int CornerCount = 8
 

Ausführliche Beschreibung

template<typename T>
class std::math::boundingbox< T >

a clasd for a BoundingBox

Dokumentation der benutzerdefinierten Datentypen

◆ pointer

template<typename T >
using std::math::boundingbox< T >::pointer = T*

◆ self_type

template<typename T >
using std::math::boundingbox< T >::self_type = boundingbox<T>

◆ value_type

template<typename T >
using std::math::boundingbox< T >::value_type = T

Beschreibung der Konstruktoren und Destruktoren

◆ boundingbox()

template<typename T >
std::math::boundingbox< T >::boundingbox ( vector3< T >  min,
vector3< T >  max 
)
inline

create the BoundingBox from max and min type

69  {
70  m_vMin = min;
71  m_vMax = max;
72  }

Dokumentation der Elementfunktionen

◆ contains() [1/2]

template<typename T >
contains_t std::math::boundingbox< T >::contains ( const boundingbox< T > &  box)
inline

contain the other box this box

Parameter
boxThe other box
Rückgabe
Siehe auch
boundingcontains
76  {
77  if ((m_vMax.x < box.m_vMin.x || m_vMin.x > box.m_vMax.x) ||
78  (m_vMax.y < box.m_vMin.y || m_vMin.y > box.m_vMax.y) ||
79  (m_vMax.z < box.m_vMin.z || m_vMin.z > box.m_vMax.z)) {
80  return contains_t::Disjoint;
81  }
82  if ((m_vMin.x <= box.m_vMin.x && m_vMax.x >= box.m_vMax.x) &&
83  (m_vMin.y <= box.m_vMin.y && m_vMax.y >= box.m_vMax.y) &&
84  (m_vMin.z <= box.m_vMin.z && m_vMax.z >= box.m_vMax.z)) {
85  return contains_t::Contains;
86  }
88  }
Definition: boundingbox.hpp:46
Definition: boundingbox.hpp:45
Definition: boundingbox.hpp:44

◆ contains() [2/2]

template<typename T >
contains_t std::math::boundingbox< T >::contains ( vector3< T >  point)
inline

cheak of the point contains this class

Parameter
pointThe to cheaked point
Rückgabe
Siehe auch
boundingcontains
93  {
94  if ((m_vMin.x <= point.x && m_vMax.x >= point.x) &&
95  (m_vMin.y <= point.y && m_vMax.y >= point.y) &&
96  (m_vMin.z <= point.z && m_vMax.z >= point.z)) {
97  return contains_t::Contains;
98  }
99  return contains_t::Disjoint;
100  }
Definition: boundingbox.hpp:45
Definition: boundingbox.hpp:44

◆ getcorners()

template<typename T >
void std::math::boundingbox< T >::getcorners ( vector3< T >  corners[CornerCount])
inline

get the corners of this box

Parameter
cornersthe out array
104  {
105  corners[0] = vector3<T> (m_vMin.x, m_vMax.y, m_vMax.z);
106  corners[1] = vector3<T> (m_vMax.x, m_vMax.y, m_vMax.z);
107  corners[2] = vector3<T> (m_vMax.x, m_vMin.y, m_vMax.z);
108  corners[3] = vector3<T> (m_vMin.x, m_vMin.y, m_vMax.z);
109  corners[4] = vector3<T> (m_vMin.x, m_vMax.y, m_vMin.z);
110  corners[5] = vector3<T> (m_vMax.x, m_vMax.y, m_vMin.z);
111  corners[6] = vector3<T> (m_vMax.x, m_vMin.y, m_vMin.z);
112  corners[7] = vector3<T> (m_vMin.x, m_vMin.y, m_vMin.z);
113  }

◆ getmax()

template<typename T >
vector3<T> std::math::boundingbox< T >::getmax ( )
inline
126 { return m_vMax; }

◆ getmin()

template<typename T >
vector3<T> std::math::boundingbox< T >::getmin ( )
inline
125 { return m_vMin; }

◆ Intersects()

template<typename T >
bool std::math::boundingbox< T >::Intersects ( const boundingbox< T > &  box)
inline

cheak of intersect the other box this box

Parameter
boxThe other box
Rückgabe
true when this box contains the other box
118  {
119  return contains (box) == contains_t::Intersects;
120  }
Definition: boundingbox.hpp:46
contains_t contains(const boundingbox< T > &box)
contain the other box this box
Definition: boundingbox.hpp:76

◆ operator=()

template<typename T >
self_type& std::math::boundingbox< T >::operator= ( const self_type v)
inline
122  {
123  m_vMin = m_vMin; m_vMax = v.m_vMax; return *this; }

◆ to_string()

template<typename T >
virtual std::string std::math::boundingbox< T >::to_string ( )
inlinevirtual
128  {
129  std::frmstring("[bbox] Min: %s Max: %s", std::to_string(m_vMin),
130  std::to_string(m_vMax) );
131  }
std::basic_string< E, TAllocator, TStorage > to_string(const int32_t v, flags_t f=flags_t::dec)
Definition: string.hpp:139
size_t frmstring(basic_string< E, TAllocator, TStorage > &dest, const char *format, va_list arg)
Definition: string.hpp:99

Dokumentation der Datenelemente

◆ CornerCount

template<typename T >
const int std::math::boundingbox< T >::CornerCount = 8

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: