![]() |
Plasma Engine
2.0
|
Represents an interval with a start and an end value. More...
#include <Interval.h>
Public Member Functions | |
constexpr | plInterval ()=default |
The default constructor initializes the two values to zero. | |
constexpr | plInterval (Type startAndEndValue) |
Initializes both start and end to the same value. | |
constexpr | plInterval (Type start, Type end) |
Initializes start and end to the given values. | |
void | SetStartAdjustEnd (Type value) |
Sets the start value. If necessary, the end value will adjusted to not be lower than the start value. | |
void | SetEndAdjustStart (Type value) |
Sets the end value. If necessary, the start value will adjusted to not be higher than the end value. | |
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, over the start value. | |
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, over the end value. | |
Type | GetSeparation () const |
Returns how much the start and and value are separated from each other. | |
bool | operator== (const plInterval< Type > &rhs) const |
bool | operator!= (const plInterval< Type > &rhs) const |
Public Attributes | |
Type | m_StartValue = Type() |
Type | m_EndValue = Type() |
Represents an interval with a start and an end value.
|
constexpr |
Initializes start and end to the given values.
Clamps the end value to not be lower than the start value.
void plInterval< Type >::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, over the start value.
Enforces that the start and end value are not closer than the given minimum separation.
void plInterval< Type >::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, over the end value.
Enforces that the start and end value are not closer than the given minimum separation.