9 #include "3esvector3.h" 90 : _minimum( std::numeric_limits<T>::max())
91 , _maximum(-std::numeric_limits<T>::max())
103 template <
typename T>
104 template <
typename Q>
112 template <
typename T>
120 template <
typename T>
127 template <
typename T>
134 template <
typename T>
137 _minimum.x = (point.
x < _minimum.x) ? point.
x : _minimum.x;
138 _minimum.y = (point.y < _minimum.y) ? point.y : _minimum.y;
139 _minimum.z = (point.z < _minimum.z) ? point.z : _minimum.z;
140 _maximum.x = (point.
x > _maximum.x) ? point.
x : _maximum.x;
141 _maximum.y = (point.y > _maximum.y) ? point.y : _maximum.y;
142 _maximum.z = (point.z > _maximum.z) ? point.z : _maximum.z;
146 template <
typename T>
154 template <
typename T>
157 return _minimum.x <= _maximum.x && _minimum.y <= _maximum.y && _minimum.z <= _maximum.z;
161 template <
typename T>
164 return _minimum.x == other._minimum.x && _minimum.y == other._minimum.y && _minimum.z == other._minimum.z &&
165 _maximum.x == other._maximum.x && _maximum.y == other._maximum.y && _maximum.z == other._maximum.z;
169 template <
typename T>
176 template <
typename T>
179 _minimum = other._minimum;
180 _maximum = other._maximum;
186 #endif // _3ESBOUNDS_H Bounds< T > & operator=(const Bounds< T > &other)
Assignment operator.
Definition: 3esbounds.h:177
bool operator!=(const Bounds< T > &other) const
Precise inequality operator.
Definition: 3esbounds.h:170
void expand(const Vector3< T > &point)
Expand the bounding box to include point.
Definition: 3esbounds.h:135
const Vector3< T > & maximum() const
Access the maximum extents.
Definition: 3esbounds.h:128
Definition: 3esbounds.h:13
bool operator==(const Bounds< T > &other) const
Precise equality operator.
Definition: 3esbounds.h:162
Bounds()
Initialises bounds where max < min at using the limits of the type T.
Definition: 3esbounds.h:89
Represents a vector in R3.
Definition: 3esvector3.h:14
T x
Direct data member access.
Definition: 3esvector3.h:30
const Vector3< T > & minimum() const
Access the minimum extents.
Definition: 3esbounds.h:121
A simple bounding box structure.
Definition: 3esbounds.h:17
bool isValid() const
Returns true if the bounds are valid, with minimum extents less than or equal to the maximum...
Definition: 3esbounds.h:155