Plasma Engine  2.0
Loading...
Searching...
No Matches
Interval.h
1#pragma once
2
3#include <Foundation/Math/Math.h>
4
6template <class Type>
8{
9public:
11 constexpr plInterval() = default;
12
14 constexpr plInterval(Type startAndEndValue);
15
19 constexpr plInterval(Type start, Type end);
20
22 void SetStartAdjustEnd(Type value);
23
25 void SetEndAdjustStart(Type value);
26
30 void ClampToIntervalAdjustEnd(Type minValue, Type maxValue, Type minimumSeparation = Type());
31
35 void ClampToIntervalAdjustStart(Type minValue, Type maxValue, Type minimumSeparation = Type());
36
38 Type GetSeparation() const;
39
40 bool operator==(const plInterval<Type>& rhs) const;
41 bool operator!=(const plInterval<Type>& rhs) const;
42
43 Type m_StartValue = Type();
44 Type m_EndValue = Type();
45};
46
49
50#include <Foundation/Types/Implementation/Interval_inl.h>
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