The open source OpenXR runtime
1// Copyright 2021, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Combination of multiple @ref xrt_device.
6 * @author Christoph Haag <christoph.haag@collabora.com>
7 * @ingroup drv_multi
8 */
9
10#pragma once
11
12#include "xrt/xrt_defines.h"
13#include "xrt/xrt_device.h"
14#include "xrt/xrt_settings.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20
21/*!
22 * @defgroup drv_multi Multi device wrapper driver
23 * @ingroup drv
24 *
25 * @brief Driver that can wrap multiple devices, for example to override tracking.
26 */
27
28/*!
29 * Create a device that takes ownership of the target device and mimics it.
30 *
31 * Does not take ownership of the tracker device, one can be assigned to multiple targets.
32 *
33 * The pose provided by get_tracked_pose will be provided by the tracker device.
34 *
35 * @param override_type The kind of override this wrapper device will provide.
36 * @param tracking_override_target An existing device that will be mimicked by the created device.
37 * @param tracking_override_tracker An existing device that will be used to provide tracking data.
38 * @param tracking_override_input_name The input name of the tracker device. XRT_INPUT_GENERIC_TRACKER_POSE for generic
39 * trackers.
40 * @param offset A static offset describing the real world transform from the "tracked point" of the target device to
41 * the "tracked point" of the tracker device. A tracking sensors attached .1m above the HMD "center" sets y = 0.1.
42 *
43 * @ingroup drv_multi
44 */
45struct xrt_device *
46multi_create_tracking_override(enum xrt_tracking_override_type override_type,
47 struct xrt_device *tracking_override_target,
48 struct xrt_device *tracking_override_tracker,
49 enum xrt_input_name tracking_override_input_name,
50 struct xrt_pose *offset);
51
52#ifdef __cplusplus
53}
54#endif