|
Toast Engine
|
A tagged value that may represent a bool, a float or a glm::vec2. More...
#include <value.hpp>
Public Member Functions | |
| Value (bool v, ValueType t=ValueType::axis_0d) | |
| Value (float v, ValueType t=ValueType::axis_1d) | |
| Value (glm::vec2 v, ValueType t=ValueType::axis_2d) | |
| template<typename T> | |
| auto | as () const noexcept -> T |
| auto | magnitude () const noexcept -> float |
| template<> | |
| auto | as () const noexcept -> bool |
| template<> | |
| auto | as () const noexcept -> float |
| template<> | |
| auto | as () const noexcept -> glm::vec2 |
Public Attributes | |
| glm::vec2 | data {0.0f, 0.0f} |
| ValueType | type = ValueType::axis_0d |
A tagged value that may represent a bool, a float or a glm::vec2.
|
nodiscardnoexcept |
| T | Get value as bool, float or glm::vec2 |
|
inlinenodiscardnoexcept |
