Monado OpenXR Runtime
Loading...
Searching...
No Matches
u_tracking_origin.h
Go to the documentation of this file.
1// Copyright 2026, NVIDIA CORPORATION.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Helpers for @ref xrt_tracking_origin.
6 * @author Jakob Bornecrantz <tbornecrantz@nvidia.com>
7 * @ingroup aux_util
8 */
9
10#pragma once
11
12#include "xrt/xrt_compiler.h"
13#include "xrt/xrt_tracking.h"
14
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20struct xrt_device;
21
22
23/*!
24 * Initialize a tracking origin, to be called by whatever allocates the
25 * tracking origin, IPC clients instead get the ID from the service. Clears
26 * the tracking origin, assigns a newly generated @ref xrt_tracking_origin::id,
27 * sets the type, resets the initial offset to identity and formats the name,
28 * truncating it to fit in @ref XRT_TRACKING_NAME_LEN bytes.
29 *
30 * @ingroup aux_util
31 */
32void
33u_tracking_origin_init(struct xrt_tracking_origin *xto, enum xrt_tracking_type type, const char *fmt, ...)
34 XRT_PRINTF_FORMAT(3, 4);
35
36/*!
37 * Check that the tracking origin of the given device has an ID, logs an error
38 * and asserts if it doesn't. A NULL device or one without a tracking origin
39 * passes the check.
40 *
41 * @ingroup aux_util
42 */
43void
45
46/*!
47 * Check that the tracking origins of all of the given devices have an ID,
48 * logs a list of all of the devices that don't and then asserts. NULL devices
49 * and devices without a tracking origin pass the check. @p xdevs may only be
50 * NULL if @p xdev_count is zero.
51 *
52 * @ingroup aux_util
53 */
54void
55u_tracking_origin_check_xdevs(struct xrt_device *const *xdevs, size_t xdev_count);
56
57
58#ifdef __cplusplus
59}
60#endif
void u_tracking_origin_check_xdevs(struct xrt_device *const *xdevs, size_t xdev_count)
Check that the tracking origins of all of the given devices have an ID, logs a list of all of the dev...
Definition u_tracking_origin.c:65
void u_tracking_origin_init(struct xrt_tracking_origin *xto, enum xrt_tracking_type type, const char *fmt,...) XRT_PRINTF_FORMAT(3
Initialize a tracking origin, to be called by whatever allocates the tracking origin,...
void void u_tracking_origin_check_xdev(const struct xrt_device *xdev)
Check that the tracking origin of the given device has an ID, logs an error and asserts if it doesn't...
Definition u_tracking_origin.c:54
xrt_tracking_type
What kind of tracking system is this.
Definition xrt_tracking.h:55
A single HMD or input device.
Definition xrt_device.h:345
A tracking system or device origin.
Definition xrt_tracking.h:115
Header holding common defines.
Header defining the tracking system integration in Monado.