Debian Codegraph @

src/xrt/drivers/opengloves/encoding/encoding.h

raw
1 // Copyright 2019-2022, Collabora, Ltd.
2 // SPDX-License-Identifier: BSL-1.0
3 /*!
4 * @file
5 * @brief Defines for OpenGloves internal inputs
6 * @author Daniel Willmott <[email protected]>
7 * @ingroup drv_opengloves
8 */
9
10 #pragma once
11 #include <stdbool.h>
12
13 #define OPENGLOVES_ENCODING_MAX_ANALOG_VALUE 1023.0f
14 #define OPENGLOVES_ENCODING_MAX_PACKET_SIZE 150
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20
21 struct opengloves_input_button
22 {
23 float value;
24 bool pressed;
25 };
26
27 struct opengloves_input_joystick
28 {
29 float x;
30 float y;
31 bool pressed;
32 };
33
34 struct opengloves_input_gesture
35 {
36 bool activated;
37 };
38
39 struct opengloves_input_buttons
40 {
41 struct opengloves_input_button A;
42 struct opengloves_input_button B;
43 struct opengloves_input_button trigger;
44 struct opengloves_input_button menu;
45 };
46
47 struct opengloves_input_joysticks
48 {
49 struct opengloves_input_joystick main;
50 };
51
52 struct opengloves_input_gestures
53 {
54 struct opengloves_input_gesture grab;
55 struct opengloves_input_gesture pinch;
56 };
57
58
59 struct opengloves_input
60 {
61 float flexion[5][5];
62 float splay[5];
63
64 struct opengloves_input_joysticks joysticks;
65 struct opengloves_input_buttons buttons;
66 struct opengloves_input_gestures gestures;
67 };
68
69 struct opengloves_output_force_feedback
70 {
71 float thumb;
72 float index;
73 float middle;
74 float ring;
75 float little;
76 };
77
78 struct opengloves_output
79 {
80 struct opengloves_output_force_feedback force_feedback;
81 };
82
83 #ifdef __cplusplus
84 }
85 #endif