Monado OpenXR Runtime
Loading...
Searching...
No Matches
r_internal.h
Go to the documentation of this file.
1// Copyright 2020-2022, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Internal stuff in remote driver.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @ingroup drv_remote
8 */
9
10#pragma once
11
12#include "r_interface.h"
13
14#include "xrt/xrt_device.h"
15#include "xrt/xrt_system.h"
16#include "xrt/xrt_tracking.h"
17
18#include "os/os_threading.h"
19
21
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*!
28 * Central object remote object.
29 *
30 * @ingroup drv_remote
31 */
32struct r_hub
33{
34 // System devices wrapper.
35 struct xrt_system_devices base;
36
37 //! Origin for all locations.
39
40 //! Connection to the controller.
42
43 //! The data that the is the reset position.
45
46 //! The latest data received.
48
49 //! Incoming connection socket.
51
52 uint16_t port;
53 uint32_t view_count;
54 uint32_t w_pixels;
55 uint32_t h_pixels;
56 float w_meters;
57 float h_meters;
58
59 struct os_thread_helper oth;
60
61 //! Index to the left controller.
62 int32_t left_index;
63
64 //! Index to the right controller.
65 int32_t right_index;
66
67 struct
68 {
69 bool hmd, left, right;
70 } gui;
71};
72
73/*!
74 * HMD
75 *
76 * @ingroup drv_remote
77 */
78struct r_hmd
79{
80 struct xrt_device base;
81
82 struct r_hub *r;
83};
84
85/*!
86 * Device
87 *
88 * @ingroup drv_remote
89 */
91{
92 struct xrt_device base;
93
94 struct r_hub *r;
95
96 struct u_hand_tracking hand_tracking;
97
98 bool is_left;
99};
100
101
102struct xrt_device *
103r_hmd_create(struct r_hub *r);
104
105struct xrt_device *
106r_device_create(struct r_hub *r, bool is_left);
107
108
109#ifdef __cplusplus
110}
111#endif
Wrapper around OS threading native functions.
Interface to remote driver.
int r_socket_t
The type for a socket descriptor.
Definition r_interface.h:62
All in one helper that handles locking, waiting for change and starting a thread.
Definition os_threading.h:500
Device.
Definition r_internal.h:91
HMD.
Definition r_internal.h:79
Central object remote object.
Definition r_internal.h:33
struct r_remote_data reset
The data that the is the reset position.
Definition r_internal.h:44
int32_t right_index
Index to the right controller.
Definition r_internal.h:65
r_socket_t accept_fd
Incoming connection socket.
Definition r_internal.h:50
int32_t left_index
Index to the left controller.
Definition r_internal.h:62
struct xrt_tracking_origin origin
Origin for all locations.
Definition r_internal.h:38
struct r_remote_connection rc
Connection to the controller.
Definition r_internal.h:41
struct r_remote_data latest
The latest data received.
Definition r_internal.h:47
Shared connection.
Definition r_interface.h:154
Remote data sent from the debugger to the hub.
Definition r_interface.h:140
Main struct drivers can use to implement hand and finger tracking.
Definition u_hand_tracking.h:93
A single HMD or input device.
Definition xrt_device.h:357
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition xrt_system.h:216
A tracking system or device origin.
Definition xrt_tracking.h:87
Hand Tracking API interface.
Header defining an xrt display or controller device.
Header for system objects.
Header defining the tracking system integration in Monado.