9 #ifndef GlobeEngine_AxisAlignedBoundingBox_h
10 #define GlobeEngine_AxisAlignedBoundingBox_h
12 #include <vmmlib/vmmlib.hpp>
16 template<
int DIM,
class TYPE>
struct Bound
18 vmml::vector< DIM, TYPE>
min;
19 vmml::vector< DIM, TYPE>
max;
27 this->
set(_min, _side);
33 this->points.min = vmml::vector< DIM, TYPE>::ZERO;
34 this->points.max = vmml::vector< DIM, TYPE>::ZERO;
35 this->side = vmml::vector< DIM, TYPE>::ZERO;
38 void set(
const vmml::vector< DIM, TYPE>& _min,
const vmml::vector< DIM, TYPE>& _side) {
39 this->points.min = _min;
41 this->points.max = this->points.min + this->side;
44 void setMinMax(
const vmml::vector< DIM, TYPE>& _min,
const vmml::vector< DIM, TYPE>& _max) {
45 this->points.min = _min;
46 this->points.max = _max;
51 this->points.min = _points.
min;
52 this->points.max = _points.
max;
56 void resetMin(
const vmml::vector< DIM, TYPE>& _in) {
57 this->points.min = _in;
61 void resetMax(
const vmml::vector< DIM, TYPE>& _in) {
62 this->points.max = _in;
66 vmml::vector< DIM, TYPE>
getMin()
const {
return this->points.min; }
67 vmml::vector< DIM, TYPE>
getMax()
const {
return this->points.max; }
68 vmml::vector< DIM, TYPE>
getSides()
const {
return this->side; }
72 this->side = this->points.max - this->points.min;
76 Bound< DIM, TYPE> points;
78 vmml::vector< DIM, TYPE> side;
AxisAlignedBoundingBox< 3, double > AxisAlignedBoundingBox3d
Definition: AxisAlignedBoundingBox.h:84
vmml::vector< DIM, TYPE > max
Definition: AxisAlignedBoundingBox.h:19
AxisAlignedBoundingBox(const vmml::vector< DIM, TYPE > &_min, const vmml::vector< DIM, TYPE > &_side)
Definition: AxisAlignedBoundingBox.h:26
AxisAlignedBoundingBox< 2, double > AxisAlignedBoundingBox2d
Definition: AxisAlignedBoundingBox.h:82
AxisAlignedBoundingBox< 3, float > AxisAlignedBoundingBox3f
Definition: AxisAlignedBoundingBox.h:83
void clear()
Definition: AxisAlignedBoundingBox.h:32
void resetMax(const vmml::vector< DIM, TYPE > &_in)
Definition: AxisAlignedBoundingBox.h:61
vmml::vector< DIM, TYPE > getMax() const
Definition: AxisAlignedBoundingBox.h:67
~AxisAlignedBoundingBox()
Definition: AxisAlignedBoundingBox.h:30
AxisAlignedBoundingBox< 3, double > AABB3d
Definition: AxisAlignedBoundingBox.h:89
AxisAlignedBoundingBox< 2, double > AABB2d
Definition: AxisAlignedBoundingBox.h:87
void set(const Bound< DIM, TYPE > &_points)
Definition: AxisAlignedBoundingBox.h:50
void set(const vmml::vector< DIM, TYPE > &_min, const vmml::vector< DIM, TYPE > &_side)
Definition: AxisAlignedBoundingBox.h:38
void setMinMax(const vmml::vector< DIM, TYPE > &_min, const vmml::vector< DIM, TYPE > &_max)
Definition: AxisAlignedBoundingBox.h:44
vmml::vector< DIM, TYPE > getMin() const
Definition: AxisAlignedBoundingBox.h:66
Definition: AxisAlignedBoundingBox.h:22
vmml::vector< DIM, TYPE > getSides() const
Definition: AxisAlignedBoundingBox.h:68
AxisAlignedBoundingBox< 2, float > AxisAlignedBoundingBox2f
Definition: AxisAlignedBoundingBox.h:81
Definition: AvalancheTrainingSimulationEngine.h:28
vmml::vector< DIM, TYPE > min
Definition: AxisAlignedBoundingBox.h:18
void resetMin(const vmml::vector< DIM, TYPE > &_in)
Definition: AxisAlignedBoundingBox.h:56
AxisAlignedBoundingBox()
Definition: AxisAlignedBoundingBox.h:25
AxisAlignedBoundingBox< 3, float > AABB3f
Definition: AxisAlignedBoundingBox.h:88
AxisAlignedBoundingBox< 2, float > AABB2f
Definition: AxisAlignedBoundingBox.h:86
Definition: AxisAlignedBoundingBox.h:16