Skip to content

Conversation

@keveleigh
Copy link
Contributor

@keveleigh keveleigh commented Jul 11, 2025

  • Changed hasPinchData to compare against the value instead, to better represent the Unity method IsInProgress() when going through the fallback path.
  • Updated the polyfill logic to check if one of the "select" and "select value" is bound while the other is polyfilled. We can use the data from the bound action to synthesize the other better than the hand joint logic will. This also helps account for controller interaction profiles, like khr/simple_controller, that doesn't have both a bool and float action for select.

@keveleigh keveleigh self-assigned this Jul 11, 2025
@keveleigh keveleigh requested a review from a team as a code owner July 11, 2025 23:03
}

value = m_fallbackState.value;
return value > 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @whebertML, wanted to make sure this doesn't affect the intent of #852

}
else if (!m_isSelectValuePolyfilled && !m_isTrackingStatePolyfilled)
{
bool isPinched = ReadValue() >= (m_fallbackState.isPerformed ? 0.9f : 1.0f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, maybe we make these constants instead of hardcoding?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, would be nicer as it could be clearer where they've come from / what their intent is.

@keveleigh keveleigh force-pushed the improve-pinch-polyfill branch from e43defb to 44c1f48 Compare July 16, 2025 20:12
@keveleigh keveleigh marked this pull request as draft July 17, 2025 00:14
Hand joints are likely better than a 0 or 1 conversion
@keveleigh keveleigh force-pushed the improve-pinch-polyfill branch from 44c1f48 to d70cfff Compare August 27, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants