aux/util: Move fov from u_device_simple_info::views to top level

This commit is contained in:
Christoph Haag 2022-02-19 02:02:36 +01:00 committed by Jakob Bornecrantz
parent 996a5d3e9a
commit 49b81e219f
8 changed files with 14 additions and 17 deletions

View file

@ -208,7 +208,7 @@ u_device_setup_split_side_by_side(struct xrt_device *xdev, const struct u_device
{
/* right eye */
if (!math_compute_fovs(w_meters, lens_center_x_meters[1], info->views[1].fov, h_meters,
if (!math_compute_fovs(w_meters, lens_center_x_meters[1], info->fov[1], h_meters,
lens_center_y_meters[1], 0, &xdev->hmd->distortion.fov[1])) {
return false;
}

View file

@ -63,10 +63,7 @@ struct u_device_simple_info
float lens_horizontal_separation_meters;
float lens_vertical_position_meters;
struct
{
float fov;
} views[2];
float fov[2];
};
/*!

View file

@ -188,8 +188,8 @@ dummy_hmd_create(void)
info.display.h_meters = 0.07f;
info.lens_horizontal_separation_meters = 0.13f / 2.0f;
info.lens_vertical_position_meters = 0.07f / 2.0f;
info.views[0].fov = 85.0f * (M_PI / 180.0f);
info.views[1].fov = 85.0f * (M_PI / 180.0f);
info.fov[0] = 85.0f * (M_PI / 180.0f);
info.fov[1] = 85.0f * (M_PI / 180.0f);
if (!u_device_setup_split_side_by_side(&dh->base, &info)) {
DH_ERROR(dh, "Failed to setup basic device info");

View file

@ -227,8 +227,8 @@ euroc_device_create(struct xrt_prober *xp)
info.display.h_meters = 0.07f;
info.lens_horizontal_separation_meters = 0.13f / 2.0f;
info.lens_vertical_position_meters = 0.07f / 2.0f;
info.views[0].fov = 85.0f * (M_PI / 180.0f);
info.views[1].fov = 85.0f * (M_PI / 180.0f);
info.fov[0] = 85.0f * (M_PI / 180.0f);
info.fov[1] = 85.0f * (M_PI / 180.0f);
bool ret = u_device_setup_split_side_by_side(xd, &info);
EUROC_ASSERT(ret, "Failed to setup HMD properties");

View file

@ -206,8 +206,8 @@ illixr_hmd_create(const char *path_in, const char *comp_in)
info.display.h_meters = 0.07f;
info.lens_horizontal_separation_meters = 0.13f / 2.0f;
info.lens_vertical_position_meters = 0.07f / 2.0f;
info.views[0].fov = 85.0f * (M_PI / 180.0f);
info.views[1].fov = 85.0f * (M_PI / 180.0f);
info.fov[0] = 85.0f * (M_PI / 180.0f);
info.fov[1] = 85.0f * (M_PI / 180.0f);
if (!u_device_setup_split_side_by_side(&dh->base, &info)) {
DH_ERROR(dh, "Failed to setup basic device info");

View file

@ -1059,8 +1059,8 @@ psvr_device_create(struct hid_device_info *sensor_hid_info,
info.display.h_meters = 0.07f;
info.lens_horizontal_separation_meters = 0.13f / 2.0f;
info.lens_vertical_position_meters = 0.07f / 2.0f;
info.views[0].fov = 85.0f * (M_PI / 180.0f);
info.views[1].fov = 85.0f * (M_PI / 180.0f);
info.fov[0] = 85.0f * (M_PI / 180.0f);
info.fov[1] = 85.0f * (M_PI / 180.0f);
if (!u_device_setup_split_side_by_side(&psvr->base, &info)) {
PSVR_ERROR(psvr, "Failed to setup basic device info");

View file

@ -255,8 +255,8 @@ qwerty_hmd_create(void)
info.display.h_meters = 0.07f;
info.lens_horizontal_separation_meters = 0.13f / 2.0f;
info.lens_vertical_position_meters = 0.07f / 2.0f;
info.views[0].fov = 85.0f * (M_PI / 180.0f);
info.views[1].fov = 85.0f * (M_PI / 180.0f);
info.fov[0] = 85.0f * (M_PI / 180.0f);
info.fov[1] = 85.0f * (M_PI / 180.0f);
if (!u_device_setup_split_side_by_side(xd, &info)) {
QWERTY_ERROR(qd, "Failed to setup HMD properties");

View file

@ -145,8 +145,8 @@ r_hmd_create(struct r_hub *r)
info.display.h_meters = 0.07f;
info.lens_horizontal_separation_meters = 0.13f / 2.0f;
info.lens_vertical_position_meters = 0.07f / 2.0f;
info.views[0].fov = 85.0f * (M_PI / 180.0f);
info.views[1].fov = 85.0f * (M_PI / 180.0f);
info.fov[0] = 85.0f * (M_PI / 180.0f);
info.fov[1] = 85.0f * (M_PI / 180.0f);
if (!u_device_setup_split_side_by_side(&rh->base, &info)) {
U_LOG_E("Failed to setup basic device info");