Toast Engine
Loading...
Searching...
No Matches
input::Value Struct Reference

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

Detailed Description

A tagged value that may represent a bool, a float or a glm::vec2.

Member Function Documentation

◆ as()

template<typename T>
auto input::Value::as ( ) const -> T
nodiscardnoexcept
Template Parameters
TGet value as bool, float or glm::vec2

◆ magnitude()

auto input::Value::magnitude ( ) const -> float
inlinenodiscardnoexcept
Returns
Absolute magnitude used to compare binds under Highest accumulation
Here is the caller graph for this function:

The documentation for this struct was generated from the following file: