|
Monado OpenXR Runtime
|
The base module provide the default implementations of some of the XRT interfaces objects, such as the xrt_system and xrt_session. More...

Directories | |
| directory | base |
| The base module implementation files. | |
Files | |
| file | b_documentation.h |
| Documentation for the base module. | |
| file | b_space_overseer.c |
| A implementation of the xrt_space_overseer interface. | |
| file | b_space_overseer.h |
| A implementation of the xrt_space_overseer interface. | |
| file | b_system_devices.c |
| Default implementation helpers for xrt_system_devices. | |
| file | b_system_devices.h |
| Default implementation helpers for xrt_system_devices. | |
Data Structures | |
| struct | b_system_devices |
| Helper struct to manage devices by implementing the xrt_system_devices. More... | |
| struct | b_system_devices_static |
| Helper struct to manage devices by implementing the xrt_system_devices, this has only static device roles. More... | |
Functions | |
| struct b_space_overseer * | b_space_overseer_create (struct xrt_session_event_sink *broadcast) |
| Create a default implementation of a space overseer. | |
| void | b_space_overseer_legacy_setup (struct b_space_overseer *uso, struct xrt_device **xdevs, uint32_t xdev_count, struct xrt_device *head, const struct xrt_pose *local_offset, bool root_is_unbounded, bool per_app_local_spaces) |
| Sets up the space overseer and all semantic spaces in a way that works with the old xrt_tracking_origin information. | |
| void | b_space_overseer_create_null_space (struct b_space_overseer *uso, struct xrt_space *parent, struct xrt_space **out_space) |
| Creates a space without any offset, this is just for optimisation over a regular offset space. | |
| void | b_space_overseer_link_space_to_device (struct b_space_overseer *uso, struct xrt_space *xs, struct xrt_device *xdev) |
| The space overseer internally keeps track the space that xrt_device is in, and then uses that mapping when creating pose spaces. | |
| static struct b_system_devices * | b_system_devices (struct xrt_system_devices *xsysd) |
| Small inline helper to cast from xrt_system_devices. | |
| struct b_system_devices * | b_system_devices_allocate (void) |
| Allocates a empty b_system_devices to be filled in by the caller, only the destroy function is filled in. | |
| void | b_system_devices_close (struct xrt_system_devices *xsysd) |
| Destroys all devices and clears out the frame context, doesn't free the struct itself, useful for code embedding the system devices struct into other objects where it's not the first member or C++ classes. | |
| static struct b_system_devices_static * | b_system_devices_static (struct xrt_system_devices *xsysd) |
| Small inline helper to cast from xrt_system_devices. | |
| struct b_system_devices_static * | b_system_devices_static_allocate (void) |
| Allocates a empty b_system_devices to be filled in by the caller, only the destroy function is filled in. | |
| void | b_system_devices_static_finalize (struct b_system_devices_static *bsysds, struct xrt_device *left, struct xrt_device *right, struct xrt_device *gamepad) |
| Finalizes the static struct with the given input devices, the system devices will always return these devices for the left and right role. | |
The base module provide the default implementations of some of the XRT interfaces objects, such as the xrt_system and xrt_session.
Some of the objects are even extendable by external users of the the Monado codebase. These lives here instead of in other places such as the auxiliary or state tracker modules.
| struct b_space_overseer * b_space_overseer_create | ( | struct xrt_session_event_sink * | broadcast | ) |
#include <base/b_space_overseer.h>
Create a default implementation of a space overseer.
| [in] | broadcast | Event sink that broadcasts events to all sessions. |
References xrt_space_overseer::add_device, xrt_space_overseer::attach_device, b_space_overseer::broadcast, xrt_space_overseer::create_local_space, xrt_space_overseer::create_offset_space, xrt_space_overseer::create_pose_space, xrt_space_overseer::destroy, xrt_space_overseer::get_reference_space_offset, xrt_space_overseer::get_tracking_origin_offset, xrt_space_overseer::locate_device, xrt_space_overseer::locate_space, xrt_space_overseer::locate_spaces, b_space_overseer::lock, xrt_space_overseer::recenter_local_spaces, xrt_space_overseer::ref_space_dec, xrt_space_overseer::ref_space_inc, xrt_space_overseer::set_reference_space_offset, xrt_space_overseer::set_tracking_origin_offset, U_TYPED_CALLOC, b_space_overseer::xdev_map, and b_space_overseer::xto_map.
Referenced by t_builder_create_space_overseer_legacy().
| void b_space_overseer_create_null_space | ( | struct b_space_overseer * | uso, |
| struct xrt_space * | parent, | ||
| struct xrt_space ** | out_space | ||
| ) |
#include <base/b_space_overseer.h>
Creates a space without any offset, this is just for optimisation over a regular offset space.
References create_space().
Referenced by b_space_overseer_legacy_setup().
| void b_space_overseer_legacy_setup | ( | struct b_space_overseer * | uso, |
| struct xrt_device ** | xdevs, | ||
| uint32_t | xdev_count, | ||
| struct xrt_device * | head, | ||
| const struct xrt_pose * | local_offset, | ||
| bool | root_is_unbounded, | ||
| bool | per_app_local_spaces | ||
| ) |
#include <base/b_space_overseer.h>
Sets up the space overseer and all semantic spaces in a way that works with the old xrt_tracking_origin information.
Will automatically create local and stage spaces. If another setup is needed the builder should manually set the space graph up using below functions.
References add_device_helper(), b_space_overseer_create_null_space(), b_space_overseer::b_space_overseer_create_offset_space(), b_space_overseer::b_space_overseer_create_pose_space(), xrt_space_overseer::local, xrt_space_overseer::local_floor, b_space_overseer::notify, b_space_overseer::per_app_local_spaces, xrt_space_overseer::root, xrt_space_overseer::stage, xrt_device::supported, U_LOG_E, xrt_space_overseer::unbounded, xrt_space_overseer::view, XRT_INPUT_GENERIC_HEAD_POSE, and XRT_SUCCESS.
Referenced by t_builder_create_space_overseer_legacy().
| void b_space_overseer_link_space_to_device | ( | struct b_space_overseer * | uso, |
| struct xrt_space * | xs, | ||
| struct xrt_device * | xdev | ||
| ) |
#include <base/b_space_overseer.h>
The space overseer internally keeps track the space that xrt_device is in, and then uses that mapping when creating pose spaces.
This function allows builders to create a much more bespoke setup. This function adds a reference to the space.
References b_space_overseer::lock, xrt_device::str, U_LOG_W, b_space_overseer::xdev_map, and xrt_space::xrt_space_reference().
Referenced by add_device_helper(), and remote_builder_setup_space_overseer().
|
inlinestatic |
#include <base/b_system_devices.h>
Small inline helper to cast from xrt_system_devices.
| struct b_system_devices * b_system_devices_allocate | ( | void | ) |
#include <base/b_system_devices.h>
Allocates a empty b_system_devices to be filled in by the caller, only the destroy function is filled in.
References xrt_system_devices::destroy, and U_TYPED_CALLOC.
| void b_system_devices_close | ( | struct xrt_system_devices * | xsysd | ) |
#include <base/b_system_devices.h>
Destroys all devices and clears out the frame context, doesn't free the struct itself, useful for code embedding the system devices struct into other objects where it's not the first member or C++ classes.
References ARRAY_SIZE, xrt_system_devices::static_xdevs, and b_system_devices::xfctx.
|
inlinestatic |
#include <base/b_system_devices.h>
Small inline helper to cast from xrt_system_devices.
| struct b_system_devices_static * b_system_devices_static_allocate | ( | void | ) |
#include <base/b_system_devices.h>
Allocates a empty b_system_devices to be filled in by the caller, only the destroy function is filled in.
References xrt_system_devices::destroy, xrt_system_devices::feature_dec, xrt_system_devices::feature_inc, xrt_system_devices::get_roles, and U_TYPED_CALLOC.
Referenced by t_builder_roles_helper_open_system().
| void b_system_devices_static_finalize | ( | struct b_system_devices_static * | bsysds, |
| struct xrt_device * | left, | ||
| struct xrt_device * | right, | ||
| struct xrt_device * | gamepad | ||
| ) |
#include <base/b_system_devices.h>
Finalizes the static struct with the given input devices, the system devices will always return these devices for the left and right role.
This function must be called before xrt_system_devices_get_roles is called.
References b_system_devices_static::cached, xrt_system_roles::gamepad, xrt_system_roles::left, xrt_system_devices::left, xrt_system_roles::right, xrt_system_devices::right, U_LOG_D, and xrt_system_roles::XRT_SYSTEM_ROLES_INIT.
Referenced by t_builder_roles_helper_open_system().