63 template <
typename T2>
89 template <
typename T2>
96 template <
typename T2>
163 #define AGX_BOUND_VEC2_OVERRIDE(VecType) \
165 AGX_FORCE_INLINE bool BoundT<VecType>::contains(const VecType& value) const \
167 return value[0] >= m_min[0] && value[1] >= m_min[1] && \
168 value[0] <= m_max[0] && value[1] <= m_max[1]; \
171 AGX_FORCE_INLINE bool BoundT<VecType>::hasOverlap(const BoundT<VecType>& other) const \
173 const bool overlaps = \
174 (m_max[0] >= other.min()[0]) && (other.max()[0] >= m_min[0]) && \
175 (m_max[1] >= other.min()[1]) && (other.max()[1] >= m_min[1]); \
179 AGX_FORCE_INLINE bool BoundT<VecType>::isValid() const \
181 return (m_min[0] <= m_max[0] && m_min[1] <= m_max[1]); \
184 AGX_FORCE_INLINE BoundT<VecType> BoundT<VecType>::calculateOverlap(const BoundT<VecType>& other) const \
186 return BoundT<VecType>( \
187 VecType(std::max(m_min[0], other.min()[0]), std::max(m_min[1], other.min()[1])), \
188 VecType(std::min(m_max[0], other.max()[0]), std::min(m_max[1], other.max()[1]))); \
191 #define AGX_BOUND_VEC3_OVERRIDE(VecType) \
193 AGX_FORCE_INLINE bool BoundT<VecType>::contains(const VecType& value) const \
195 return value[0] >= m_min[0] && value[1] >= m_min[1] && value[2] >= m_min[2] && \
196 value[0] <= m_max[0] && value[1] <= m_max[1] && value[2] <= m_max[2]; \
199 AGX_FORCE_INLINE bool BoundT<VecType>::hasOverlap(const BoundT<VecType>& other) const \
201 const bool overlaps = \
202 (m_max[0] >= other.min()[0]) && (other.max()[0] >= m_min[0]) && \
203 (m_max[1] >= other.min()[1]) && (other.max()[1] >= m_min[1]) && \
204 (m_max[2] >= other.min()[2]) && (other.max()[2] >= m_min[2]); \
208 AGX_FORCE_INLINE bool BoundT<VecType>::isValid() const \
210 return (m_min[0] <= m_max[0] && m_min[1] <= m_max[1] && m_min[2] <= m_max[2]); \
213 AGX_FORCE_INLINE BoundT<VecType> BoundT<VecType>::calculateOverlap(const BoundT<VecType>& other) const \
215 return BoundT<VecType>( \
216 VecType(std::max(m_min[0], other.m_min[0]), std::max(m_min[1], other.m_min[1]), std::max(m_min[2], other.m_min[2])), \
217 VecType(std::min(m_max[0], other.m_max[0]), std::max(m_min[1], other.m_min[1]), std::max(m_min[2], other.m_min[2]))); \
239 template <
typename T>
template <
typename T2>
242 template <
typename T>
245 template <
typename T>
248 template <
typename T>
251 template <
typename T>
254 template <
typename T>
257 template <
typename T>
260 template <
typename T>
263 template <
typename T>
266 template <
typename T>
269 template <
typename T>
272 template <
typename T>
276 template <
typename T>
template <
typename T2>
280 T halfSize = this->size() * scale * 0.5;
281 m_min = mid - halfSize;
282 m_max = mid + halfSize;
286 template <
typename T>
template <
typename T2>
289 BoundT bound(m_min, m_max);
294 template <
typename T>
297 template <
typename T>
303 template <
typename T>
306 agxAbort1(
"Type specific implementation missing");
310 template <
typename T>
313 return BoundT(m_min + offset, m_max + offset);
316 template <
typename T>
319 return m_min == other.
m_min && m_max == other.
m_max;
323 template <
typename T>
332 template <
typename T>
335 return m_min != other.
m_min || m_max != other.
m_max;
341 output << bound.
min() <<
" : " << bound.
max();
#define AGX_BOUND_VEC3_OVERRIDE(VecType)
#define AGX_BOUND_VEC2_OVERRIDE(VecType)
#define AGX_TYPE_BINDING(_Type, _Name)
A BoundT represents a range defined by a minimum and a maximum value.
BoundT calculateOverlap(const BoundT &other) const
bool contains(const T &value) const
BoundT & operator*=(T2 scale)
Scale the bound so that is size is changed according to the given scale, but the midpoint remains unc...
BoundT & operator=(const BoundT &other)
bool hasOverlap(const BoundT &other) const
BoundT()
Create a bound initialized to the empty range located at the type's default value.
bool operator==(const BoundT &other) const
BoundT translate(const T &offset) const
Move the bound's midpoint without altering its size.
BoundT(const BoundT &other)
void set(const T &min, const T &max)
Relocate the bound to the new location.
BoundT operator*(T2 scale)
Create a new bound that has the same midpoint as the current bound, but with a size that is scaled ac...
BoundT(const T &min, const T &max)
bool operator!=(const BoundT &other) const
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
BoundT< Vec3i64 > Bound3i64
BoundT< Vec2i32 > Bound2i32
Vec3T< T > min(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
BoundT< Vec2u64 > Bound2u64
BoundT< Int32 > Bound1i32
BoundT< Vec3u64 > Bound3u64
BoundT< Vec2i64 > Bound2i64
BoundT< Vec3i32 > Bound3i32
BoundT< Vec2u32 > Bound2u32
BoundT< Int64 > Bound1i64
BoundT< UInt32 > Bound1u32
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
std::ostream & operator<<(std::ostream &stream, const AtomicValueT< T > &value)
BoundT< Vec3u32 > Bound3u32
BoundT< UInt64 > Bound1u64