mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
xrt: Add xrt_device::get_view_poses function
This commit is contained in:
parent
b322ff689b
commit
780f1763e3
|
@ -369,6 +369,43 @@ struct xrt_device
|
|||
uint32_t view_index,
|
||||
struct xrt_pose *out_pose);
|
||||
|
||||
/*!
|
||||
* @brief Get the per-view pose in relation to the view space.
|
||||
*
|
||||
* On most device with coplanar displays, this just calls a helper to
|
||||
* process the provided eye relation, but this may also handle canted
|
||||
* displays as well as eye tracking.
|
||||
*
|
||||
* Does not do any device level tracking, use
|
||||
* xrt_device::get_tracked_pose for that.
|
||||
*
|
||||
* @param[in] xdev The device.
|
||||
* @param[in] default_eye_relation
|
||||
* The interpupillary relation as a 3D position.
|
||||
* Most simple stereo devices would just want to
|
||||
* set `out_pose->position.[x|y|z] = ipd.[x|y|z]
|
||||
* / 2.0f` and adjust for left vs right view.
|
||||
* Not to be confused with IPD that is absolute
|
||||
* distance, this is a full 3D translation
|
||||
* If a device has a more accurate/dynamic way of
|
||||
* knowing the eye relation, it may ignore this
|
||||
* input.
|
||||
* @param[in] view_count Number of views.
|
||||
* @param[out] out_pose Output poses. See default_eye_relation
|
||||
* argument for sample position. Be sure to also
|
||||
* set orientation: most likely identity
|
||||
* orientation unless you have canted screens.
|
||||
* (Caution: Even if you have eye tracking, you
|
||||
* won't use eye orientation here!)
|
||||
*/
|
||||
void (*get_view_poses)(struct xrt_device *xdev,
|
||||
const struct xrt_vec3 *default_eye_relation,
|
||||
uint64_t at_timestamp_ns,
|
||||
uint32_t view_count,
|
||||
struct xrt_space_relation *out_head_relation,
|
||||
struct xrt_fov *out_fovs,
|
||||
struct xrt_pose *out_poses);
|
||||
|
||||
bool (*compute_distortion)(struct xrt_device *xdev, int view, float u, float v, struct xrt_uv_triplet *result);
|
||||
|
||||
/*!
|
||||
|
@ -442,6 +479,27 @@ xrt_device_get_view_pose(struct xrt_device *xdev,
|
|||
xdev->get_view_pose(xdev, eye_relation, view_index, out_pose);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Helper function for @ref xrt_device::get_view_poses.
|
||||
*
|
||||
* @out_head_relation in the device's tracking space without tracking_origin offset applied.
|
||||
* @out_poses are view poses relative th @out_head_relation.
|
||||
*
|
||||
* @public @memberof xrt_device
|
||||
*/
|
||||
static inline void
|
||||
xrt_device_get_view_poses(struct xrt_device *xdev,
|
||||
const struct xrt_vec3 *default_eye_relation,
|
||||
uint64_t at_timestamp_ns,
|
||||
uint32_t view_count,
|
||||
struct xrt_space_relation *out_head_relation,
|
||||
struct xrt_fov *out_fovs,
|
||||
struct xrt_pose *out_poses)
|
||||
{
|
||||
xdev->get_view_poses(xdev, default_eye_relation, at_timestamp_ns, view_count, out_head_relation, out_fovs,
|
||||
out_poses);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Helper function for @ref xrt_device::compute_distortion.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue