Monado OpenXR Runtime
Loading...
Searching...
No Matches
b_tracked_device.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 Per-device tracking state for the space overseer.
6 *
7 * @ingroup base
8 */
9
10#pragma once
11
12#include "xrt/xrt_space.h"
13
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19
20struct b_tracked_device;
21
22
23typedef void (*b_tracked_device_pose_space_cb)(struct xrt_space *xs, void *priv);
24
25
26/*!
27 * Create a tracked device with a reference to @p space.
28 *
29 * @public @memberof b_tracked_device
30 */
31struct b_tracked_device *
33
34/*!
35 * @public @memberof b_tracked_device
36 */
37void
38b_tracked_device_reference(struct b_tracked_device **dst, struct b_tracked_device *src);
39
40/*!
41 * Returns the device space without taking a reference.
42 *
43 * @public @memberof b_tracked_device
44 */
45struct xrt_space *
46b_tracked_device_get_space(struct b_tracked_device *btd);
47
48/*!
49 * Track a pose space owned by this device. The caller must hold the space
50 * overseer graph lock.
51 *
52 * @public @memberof b_tracked_device
53 */
54void
55b_tracked_device_track_pose_space(struct b_tracked_device *btd, struct xrt_space *xs);
56
57/*!
58 * Stop tracking a pose space. The caller must hold the space overseer graph
59 * lock.
60 *
61 * @public @memberof b_tracked_device
62 */
63void
64b_tracked_device_untrack_pose_space(struct b_tracked_device *btd, struct xrt_space *xs);
65
66/*!
67 * Iterate tracked pose spaces. The caller must hold the space overseer graph
68 * lock.
69 *
70 * @public @memberof b_tracked_device
71 */
72void
73b_tracked_device_for_each_pose_space(struct b_tracked_device *btd, b_tracked_device_pose_space_cb cb, void *priv);
74
75/*!
76 * Drop all tracked pose spaces without destroying them. The caller must hold the
77 * space overseer graph lock.
78 *
79 * @public @memberof b_tracked_device
80 */
81void
82b_tracked_device_clear_pose_spaces(struct b_tracked_device *btd);
83
84
85#ifdef __cplusplus
86}
87#endif
Definition b_tracked_device.c:19
struct b_tracked_device * b_tracked_device_create(struct xrt_space *space)
Create a tracked device with a reference to space.
Definition b_tracked_device.c:41
A space very similar to a OpenXR XrSpace but not a full one-to-one mapping, but used to power XrSpace...
Definition xrt_space.h:32
Header defining xrt space and space overseer.