Sygaldry
Loading...
Searching...
No Matches
sygah-mimu.hpp
1#pragma once
2/*
3Copyright 2023 Travis J. West, https://traviswest.ca, Input Devices and Music
4Interaction Laboratory (IDMIL), Centre for Interdisciplinary Research in Music
5Media and Technology (CIRMMT), McGill University, Montréal, Canada, and Univ.
6Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France
7
8SPDX-License-Identifier: MIT
9*/
10
11#include "sygah-metadata.hpp"
12#include "sygah-endpoints.hpp"
13
14namespace sygaldry {
15
20
29template< string_literal name
30 , typename T = float
31 , num_literal<T> min = -1.0f
32 , num_literal<T> max = 1.0f
33 , string_literal unit = "normalized"
34 , string_literal desc = ""
35 , typename ... Tags
36 >
38: array_message<name, 3, desc, T, min, max, T{}, Tags...>
39, unit_<unit>
40{
42 using Parent = array_message<name, 3, desc, T, min, max, T{}, Tags...>;
43 using Parent::operator=;
45 constexpr auto& x() noexcept { return Parent::state[0]; }
47 constexpr auto& y() noexcept { return Parent::state[1]; }
49 constexpr auto& z() noexcept { return Parent::state[2]; }
51 constexpr const auto& x() const noexcept { return Parent::state[0]; }
53 constexpr const auto& y() const noexcept { return Parent::state[1]; }
55 constexpr const auto& z() const noexcept { return Parent::state[2]; }
56};
59}
static _consteval auto min()
Returns the minimum value of the range.
Definition sygah-endpoints.hpp:69
static _consteval auto max()
Returns the maximum value of the range.
Definition sygah-endpoints.hpp:71
T state
The wrapped state.
Definition sygah-endpoints.hpp:132
A multi-dimensional numeric endpoint with user customizeable range and occasional message semantics.
Definition sygah-endpoints.hpp:449
static _consteval auto name()
Definition sygah-metadata.hpp:33
Document a textual description of the unit of measurement used by an entity, especially an endpoint.
Definition sygah-metadata.hpp:37
A MIMU data vector.
Definition sygah-mimu.hpp:40
constexpr auto & x() noexcept
Mutable vector component access; remember to call set_updated() if you change the value of the vector...
Definition sygah-mimu.hpp:45
constexpr auto & z() noexcept
Mutable vector component access; remember to call set_updated() if you change the value of the vector...
Definition sygah-mimu.hpp:49
constexpr const auto & y() const noexcept
Immutable vector component access.
Definition sygah-mimu.hpp:53
constexpr const auto & z() const noexcept
Immutable vector component access.
Definition sygah-mimu.hpp:55
constexpr const auto & x() const noexcept
Immutable vector component access.
Definition sygah-mimu.hpp:51
constexpr auto & y() noexcept
Mutable vector component access; remember to call set_updated() if you change the value of the vector...
Definition sygah-mimu.hpp:47