The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/survive: Apply device IPD to view poses

+13 -2
+13 -2
src/xrt/drivers/survive/survive_driver.c
··· 65 65 #define MAX_TRACKED_DEVICE_COUNT 16 66 66 67 67 DEBUG_GET_ONCE_BOOL_OPTION(survive_disable_hand_emulation, "SURVIVE_DISABLE_HAND_EMULATION", false) 68 + DEBUG_GET_ONCE_BOOL_OPTION(survive_default_ipd, "SURVIVE_DEFAULT_IPD", false) 68 69 69 70 #define SURVIVE_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->sys->log_level, __VA_ARGS__) 70 71 #define SURVIVE_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->sys->log_level, __VA_ARGS__) ··· 140 141 { 141 142 float proximity; // [0,1] 142 143 float ipd; 144 + bool use_default_ipd; 143 145 144 146 struct vive_config config; 145 147 } hmd; ··· 516 518 // Only supports two views. 517 519 assert(view_count <= 2); 518 520 519 - u_device_get_view_poses(xdev, default_eye_relation, at_timestamp_ns, view_count, out_head_relation, out_fovs, 521 + struct survive_device *survive = (struct survive_device *)xdev; 522 + 523 + struct xrt_vec3 eye_relation = {0}; 524 + 525 + if (survive->hmd.use_default_ipd) { 526 + eye_relation = *default_eye_relation; 527 + } else { 528 + eye_relation.x = survive->hmd.ipd; 529 + } 530 + 531 + u_device_get_view_poses(xdev, &eye_relation, at_timestamp_ns, view_count, out_head_relation, out_fovs, 520 532 out_poses); 521 533 522 534 // This is for the Index' canted displays, on the Vive [Pro] they are identity. 523 - struct survive_device *survive = (struct survive_device *)xdev; 524 535 for (uint32_t i = 0; i < view_count && i < ARRAY_SIZE(survive->hmd.config.display.rot); i++) { 525 536 out_poses[i].orientation = survive->hmd.config.display.rot[i]; 526 537 }