Skip to content

Commit 8dd68a2

Browse files
committed
hello_xr: Use squeeze/force for Valve Index controllers
squeeze/value corresponds to how much of the handle is touched which feels undesirable. squeeze/force corresponds to how much the handle is actually squeezed.
1 parent e7fcdd9 commit 8dd68a2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tests/hello_xr/openxr_program.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ struct OpenXrProgram : IOpenXrProgram {
409409

410410
std::array<XrPath, Side::COUNT> selectPath;
411411
std::array<XrPath, Side::COUNT> squeezeValuePath;
412+
std::array<XrPath, Side::COUNT> squeezeForcePath;
412413
std::array<XrPath, Side::COUNT> squeezeClickPath;
413414
std::array<XrPath, Side::COUNT> posePath;
414415
std::array<XrPath, Side::COUNT> hapticPath;
@@ -419,6 +420,8 @@ struct OpenXrProgram : IOpenXrProgram {
419420
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/right/input/select/click", &selectPath[Side::RIGHT]));
420421
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/left/input/squeeze/value", &squeezeValuePath[Side::LEFT]));
421422
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/right/input/squeeze/value", &squeezeValuePath[Side::RIGHT]));
423+
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/left/input/squeeze/force", &squeezeForcePath[Side::LEFT]));
424+
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/right/input/squeeze/force", &squeezeForcePath[Side::RIGHT]));
422425
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/left/input/squeeze/click", &squeezeClickPath[Side::LEFT]));
423426
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/right/input/squeeze/click", &squeezeClickPath[Side::RIGHT]));
424427
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/left/input/grip/pose", &posePath[Side::LEFT]));
@@ -494,8 +497,8 @@ struct OpenXrProgram : IOpenXrProgram {
494497
XrPath indexControllerInteractionProfilePath;
495498
CHECK_XRCMD(
496499
xrStringToPath(m_instance, "/interaction_profiles/valve/index_controller", &indexControllerInteractionProfilePath));
497-
std::vector<XrActionSuggestedBinding> bindings{{{m_input.grabAction, squeezeValuePath[Side::LEFT]},
498-
{m_input.grabAction, squeezeValuePath[Side::RIGHT]},
500+
std::vector<XrActionSuggestedBinding> bindings{{{m_input.grabAction, squeezeForcePath[Side::LEFT]},
501+
{m_input.grabAction, squeezeForcePath[Side::RIGHT]},
499502
{m_input.poseAction, posePath[Side::LEFT]},
500503
{m_input.poseAction, posePath[Side::RIGHT]},
501504
{m_input.quitAction, bClickPath[Side::LEFT]},

0 commit comments

Comments
 (0)