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

OpenXR all hand tracking and controller features #999

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

goatchurchprime
Copy link

This demo illustrates all the available and working inputs from the OpenXR interface in raw and unfiltered form. This helps to tell which features are actually supported on each VR headset.

When hand-tracking is working there are 50 transforms corresponding to the joint positions and rotations for both hands as well as flags for tracking and validity. Each joint has a radius as well as linear and rotational velocity (this is not supported on some headsets). This demo also calculates and states the length of each finger as measured between these joints.

When controllers are in use there are only pose/transforms available (aim and grip), as well as 12 buttons, 10 touch sensors 4 linear values, and two XY thumb operated joysticks.

There are further features for interrogating the play area which will be implemented in version4.3

image

Comment on lines 18 to 20
@onready var FlatDisplay = $FrontOfPlayer/FlatDisplayMesh/SubViewport/FlatDisplay
@onready var joints3D = $Joints3D
@onready var joints2D = $FrontOfPlayer/Joints2D
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@onready var FlatDisplay = $FrontOfPlayer/FlatDisplayMesh/SubViewport/FlatDisplay
@onready var joints3D = $Joints3D
@onready var joints2D = $FrontOfPlayer/Joints2D
@onready var flat_display = $FrontOfPlayer/FlatDisplayMesh/SubViewport/FlatDisplay
@onready var joints_3D = $Joints3D
@onready var joints_2D = $FrontOfPlayer/Joints2D

Use camel_case in GDScript, same everywhere for variables

Copy link
Author

Choose a reason for hiding this comment

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

Done the top one, not the others. I don't think the _ in joints_3D helps here. This is similar to a numbering example like (p1, p2, p3, ...)[good] vs (p_1, p_2, p_3,...)[bad].
Now you could argue that the D on the end converts it from a mere number into a separate word-clause in order to apply the notrunningwordstogether rule, but this is too pedantic. As to fixing all the other local variables, it's going to cause a lot of bugs. I could convert them all to two or three letter variables that don't require camel case or _ separators if that would help.

get_node("Joints3D/L0").transform.origin = Vector3(0,1.7,-0.2)


func buttonsignal(name, hand, pressed):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func buttonsignal(name, hand, pressed):
func _button_signal(name, hand, pressed):

Prefix private/internal methods with _ for clarity, same for all of these

Copy link
Author

Choose a reason for hiding this comment

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

Done these. I don't think you mean that these are private/internal methods, since by their nature they are being called by signals from outside the class. I think the convention is for functions that are called by signals to be prefixed with the _ to make them look like they are not to be called from normal functions.

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.

None yet

3 participants