mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-09 23:38:04 +00:00
xrt: Add function to request recentering of local spaces
This commit is contained in:
parent
65f1078950
commit
9b5cfadc64
src/xrt/include/xrt
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2020-2022, Collabora, Ltd.
|
||||
// Copyright 2020-2023, Collabora, Ltd.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
/*!
|
||||
* @file
|
||||
|
@ -158,4 +158,9 @@ typedef enum xrt_result
|
|||
* Some D3D12 error
|
||||
*/
|
||||
XRT_ERROR_D3D12 = -25,
|
||||
/*!
|
||||
* The @ref xrt_space_overseer doesn't support recentering driven from
|
||||
* the application side of things.
|
||||
*/
|
||||
XRT_ERROR_RECENTERING_NOT_SUPPORTED = -26,
|
||||
} xrt_result_t;
|
||||
|
|
|
@ -235,6 +235,16 @@ struct xrt_space_overseer
|
|||
*/
|
||||
xrt_result_t (*ref_space_dec)(struct xrt_space_overseer *xso, enum xrt_reference_space_type type);
|
||||
|
||||
/*!
|
||||
* Trigger a re-center of the local and local_floor spaces, not all
|
||||
* implementations of @ref xrt_space_overseer may support recenter. The
|
||||
* recenter operation will normally mean that the local and local_floor
|
||||
* will move to the where the view space currently is.
|
||||
*
|
||||
* @param[in] xso The space overseer.
|
||||
*/
|
||||
xrt_result_t (*recenter_local_spaces)(struct xrt_space_overseer *xso);
|
||||
|
||||
/*!
|
||||
* Destroy function.
|
||||
*
|
||||
|
@ -338,6 +348,19 @@ xrt_space_overseer_ref_space_dec(struct xrt_space_overseer *xso, enum xrt_refere
|
|||
return xso->ref_space_dec(xso, type);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @copydoc xrt_space_overseer::recenter_local_spaces
|
||||
*
|
||||
* Helper for calling through the function pointer.
|
||||
*
|
||||
* @public @memberof xrt_space_overseer
|
||||
*/
|
||||
static inline xrt_result_t
|
||||
xrt_space_overseer_recenter_local_spaces(struct xrt_space_overseer *xso)
|
||||
{
|
||||
return xso->recenter_local_spaces(xso);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Helper for calling through the function pointer: does a null check and sets
|
||||
* xc_ptr to null if freed.
|
||||
|
|
Loading…
Reference in a new issue