Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement grip threshold #222

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

BastiaanOlij
Copy link
Member

This PR introduces a grip threshold on our pickup function.

On controllers such as the Oculus touch our grip button is an actual button which results in our logic working pretty sweet.
On controllers such as the Index it's actually a pressure sensor. The problem is that the build in threshold makes it really hard to let go of things.
So here we are implementing our own so we have control over this threshold and use the grip axis as our input.

For controllers such as Oculus Touch controllers OpenXR already provides support so unpressed is 0.0 and pressed is 1.0 and switching from the grip button to the grip axis should be transparent.

Instead of having this as a property I'm introducing this as a project setting so we can share the same value on other scripts as well.
image
It's worth contemplating doing this for other shared settings as well.

I have also moved our Buttons enum to our plugin script, only the pickup function uses this but we can do further cleanup of other scripts so we don't re-define this everywhere

@BastiaanOlij BastiaanOlij added the enhancement New feature or request label Oct 25, 2022
@BastiaanOlij BastiaanOlij added this to the 3.1.0 milestone Oct 25, 2022
@BastiaanOlij BastiaanOlij self-assigned this Oct 25, 2022
@BastiaanOlij BastiaanOlij force-pushed the implement_grip_threshold branch from fbe933b to 836aff6 Compare October 25, 2022 10:43
@BastiaanOlij BastiaanOlij linked an issue Oct 25, 2022 that may be closed by this pull request
Copy link
Collaborator

@Malcolmnixon Malcolmnixon left a comment

Choose a reason for hiding this comment

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

Looks good. Tested on the Quest 2 and everything works fine.

@BastiaanOlij BastiaanOlij force-pushed the implement_grip_threshold branch from 5cfb5f8 to 238ac03 Compare October 25, 2022 23:58
@BastiaanOlij BastiaanOlij merged commit 675ac37 into GodotVR:master Oct 25, 2022
@BastiaanOlij BastiaanOlij deleted the implement_grip_threshold branch October 25, 2022 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to checking Grip Value instead of Grip Button
2 participants