4 : m_StartValue(startAndEndValue)
5 , m_EndValue(startAndEndValue)
12 , m_EndValue(
plMath::Max(start, end))
27 m_StartValue =
plMath::Min(m_StartValue, m_EndValue);
34 m_StartValue =
plMath::Clamp(m_StartValue, minValue, maxValue - minimumSeparation);
37 m_EndValue =
plMath::Clamp(m_EndValue, m_StartValue, maxValue);
44 m_EndValue =
plMath::Clamp(m_EndValue, minValue + minimumSeparation, maxValue);
47 m_StartValue =
plMath::Clamp(m_StartValue, minValue, m_EndValue);
53 return m_EndValue - m_StartValue;
59 return m_StartValue == rhs.m_StartValue && m_EndValue == rhs.m_EndValue;
65 return !operator==(rhs);
Represents an interval with a start and an end value.
Definition Interval.h:8
constexpr plInterval()=default
The default constructor initializes the two values to zero.
void ClampToIntervalAdjustEnd(Type minValue, Type maxValue, Type minimumSeparation=Type())
Adjusts the start and end value to be within the given range. Prefers to adjust the end value,...
Definition Interval_inl.h:31
void SetStartAdjustEnd(Type value)
Sets the start value. If necessary, the end value will adjusted to not be lower than the start value.
Definition Interval_inl.h:17
void ClampToIntervalAdjustStart(Type minValue, Type maxValue, Type minimumSeparation=Type())
Adjusts the start and end value to be within the given range. Prefers to adjust the start value,...
Definition Interval_inl.h:41
void SetEndAdjustStart(Type value)
Sets the end value. If necessary, the start value will adjusted to not be higher than the end value.
Definition Interval_inl.h:24
Type GetSeparation() const
Returns how much the start and and value are separated from each other.
Definition Interval_inl.h:51
This namespace provides common math-functionality as functions.
Definition Constants.h:6
constexpr PL_ALWAYS_INLINE T Min(T f1, T f2)
Returns the smaller value, f1 or f2.
Definition Math_inl.h:27
constexpr PL_ALWAYS_INLINE T Clamp(T value, T min_val, T max_val)
Clamps "value" to the range [min; max]. Returns "value", if it is inside the range already.
Definition Math_inl.h:51
constexpr PL_ALWAYS_INLINE T Max(T f1, T f2)
Returns the greater value, f1 or f2.
Definition Math_inl.h:39