23#include <agx/agxPhysics_export.h>
40 Interval( Real newMinValue, Real newMaxValue );
43 Interval( Real valueA, Real valueB,
bool sorted );
49 void intersectWith(
const Interval& other );
52 void intersectWithRightUnbounded( Real leftBound );
55 void intersectWithLeftUnbounded( Real rightBound );
62 Interval computeOverlapWith(
const Interval& other)
const;
65 bool hasOverlapWith(
const Interval& other)
const;
68 bool containsValue(
const Real value)
const;
77 Real minValue()
const;
80 Real maxValue()
const;
86 bool hasElements()
const;
92 Real getLength()
const;
104 minValue() = -std::numeric_limits<Real>::infinity();
105 maxValue() = std::numeric_limits<Real>::infinity();
111 minValue() = std::max( minValue(), other.minValue() );
112 maxValue() = std::min( maxValue(), other.maxValue() );
118 minValue() = std::max( minValue(), leftBound );
124 maxValue() = std::min( maxValue(), rightBound );
154 return minValue() > maxValue();
160 return minValue() <= maxValue();
166 minValue() = newMinValue;
167 maxValue() = newMaxValue;
178 minValue() = std::min(valueA, valueB);
179 maxValue() = std::max(valueA, valueB);
183 AGX_FORCE_INLINE Interval Interval::computeOverlapWith(
const Interval& other)
const
185 return Interval(std::max( minValue(), other.minValue() ),
186 std::min( maxValue(), other.maxValue() ));
192 return !isEmpty() && !other.isEmpty() &&
193 (containsValue(other.minValue()) || containsValue(other.maxValue()) ||
194 other.containsValue(minValue()) || other.containsValue(maxValue()));
200 return (value >= minValue() && value <= maxValue());
206 return maxValue() - minValue();
#define AGXPHYSICS_EXPORT
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.