AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
Bound.h File Reference
#include <agx/Real.h>
#include <agx/Vec2.h>
#include <agx/Vec3.h>
#include <agx/Vec4.h>
#include <agx/Integer.h>
#include <agxData/Type.h>

Go to the source code of this file.

Classes

class  agx::BoundT< T >
 A BoundT represents a range defined by a minimum and a maximum value. More...
 

Namespaces

namespace  agx
 The agx namespace contains the dynamics/math part of the AGX Dynamics API.
 

Macros

#define AGX_BOUND_VEC2_OVERRIDE(VecType)
 
#define AGX_BOUND_VEC3_OVERRIDE(VecType)
 

Typedefs

typedef BoundT< Real > agx::Bound1
 
typedef BoundT< Real64 > agx::Bound1d
 
typedef BoundT< Real32 > agx::Bound1f
 
typedef BoundT< Int > agx::Bound1i
 
typedef BoundT< Int32 > agx::Bound1i32
 
typedef BoundT< Int64 > agx::Bound1i64
 
typedef BoundT< UInt > agx::Bound1u
 
typedef BoundT< UInt32 > agx::Bound1u32
 
typedef BoundT< UInt64 > agx::Bound1u64
 
typedef BoundT< Vec2 > agx::Bound2
 
typedef BoundT< Vec2d > agx::Bound2d
 
typedef BoundT< Vec2f > agx::Bound2f
 
typedef BoundT< Vec2i > agx::Bound2i
 
typedef BoundT< Vec2i32 > agx::Bound2i32
 
typedef BoundT< Vec2i64 > agx::Bound2i64
 
typedef BoundT< Vec2u > agx::Bound2u
 
typedef BoundT< Vec2u32 > agx::Bound2u32
 
typedef BoundT< Vec2u64 > agx::Bound2u64
 
typedef BoundT< Vec3 > agx::Bound3
 
typedef BoundT< Vec3d > agx::Bound3d
 
typedef BoundT< Vec3f > agx::Bound3f
 
typedef BoundT< Vec3i > agx::Bound3i
 
typedef BoundT< Vec3i32 > agx::Bound3i32
 
typedef BoundT< Vec3i64 > agx::Bound3i64
 
typedef BoundT< Vec3u > agx::Bound3u
 
typedef BoundT< Vec3u32 > agx::Bound3u32
 
typedef BoundT< Vec3u64 > agx::Bound3u64
 

Functions

template<typename T >
std::ostream & agx::operator<< (std::ostream &output, const BoundT< T > &bound)
 

Macro Definition Documentation

◆ AGX_BOUND_VEC2_OVERRIDE

#define AGX_BOUND_VEC2_OVERRIDE (   VecType)
Value:
template <> \
AGX_FORCE_INLINE bool BoundT<VecType>::contains(const VecType& value) const \
{ \
return value[0] >= m_min[0] && value[1] >= m_min[1] && \
value[0] <= m_max[0] && value[1] <= m_max[1]; \
} \
template <> \
AGX_FORCE_INLINE bool BoundT<VecType>::hasOverlap(const BoundT<VecType>& other) const \
{ \
const bool overlaps = \
(m_max[0] >= other.min()[0]) && (other.max()[0] >= m_min[0]) && \
(m_max[1] >= other.min()[1]) && (other.max()[1] >= m_min[1]); \
return overlaps; \
} \
template <> \
AGX_FORCE_INLINE bool BoundT<VecType>::isValid() const \
{ \
return (m_min[0] <= m_max[0] && m_min[1] <= m_max[1]); \
} \
template <> \
AGX_FORCE_INLINE BoundT<VecType> BoundT<VecType>::calculateOverlap(const BoundT<VecType>& other) const \
{ \
return BoundT<VecType>( \
VecType(std::max(m_min[0], other.min()[0]), std::max(m_min[1], other.min()[1])), \
VecType(std::min(m_max[0], other.max()[0]), std::min(m_max[1], other.max()[1]))); \
}
#define AGX_FORCE_INLINE
Definition: macros.h:58

Definition at line 163 of file Bound.h.

◆ AGX_BOUND_VEC3_OVERRIDE

#define AGX_BOUND_VEC3_OVERRIDE (   VecType)
Value:
template <> \
AGX_FORCE_INLINE bool BoundT<VecType>::contains(const VecType& value) const \
{ \
return value[0] >= m_min[0] && value[1] >= m_min[1] && value[2] >= m_min[2] && \
value[0] <= m_max[0] && value[1] <= m_max[1] && value[2] <= m_max[2]; \
} \
template <> \
AGX_FORCE_INLINE bool BoundT<VecType>::hasOverlap(const BoundT<VecType>& other) const \
{ \
const bool overlaps = \
(m_max[0] >= other.min()[0]) && (other.max()[0] >= m_min[0]) && \
(m_max[1] >= other.min()[1]) && (other.max()[1] >= m_min[1]) && \
(m_max[2] >= other.min()[2]) && (other.max()[2] >= m_min[2]); \
return overlaps; \
} \
template <> \
AGX_FORCE_INLINE bool BoundT<VecType>::isValid() const \
{ \
return (m_min[0] <= m_max[0] && m_min[1] <= m_max[1] && m_min[2] <= m_max[2]); \
} \
template <> \
AGX_FORCE_INLINE BoundT<VecType> BoundT<VecType>::calculateOverlap(const BoundT<VecType>& other) const \
{ \
return BoundT<VecType>( \
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])), \
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]))); \
}

Definition at line 191 of file Bound.h.