-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
OpenXR all hand tracking and controller features #999
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
base: master
Are you sure you want to change the base?
OpenXR all hand tracking and controller features #999
Conversation
$XROrigin3D/HandJoints.set_xr_interface(xr_interface) | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if xr_interface and xr_interface.is_initialized(): | ||
var vp = get_viewport() | ||
|
||
# Enable XR on the main viewport |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Enable XR on the main viewport | |
# Enable XR on the main viewport. |
# Enable XR on the main viewport | ||
vp.use_xr = true | ||
|
||
# Make sure v-sync is disabled, we're using the headsets v-sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Make sure v-sync is disabled, we're using the headsets v-sync | |
# Make sure v-sync is disabled, we're using the headsets v-sync. |
$FrontOfPlayer/FingerButton/Touched.visible = touching | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var fingertipnode = $Joints3D.get_node("R%d" % OpenXRInterface.HAND_JOINT_INDEX_TIP) | ||
var fingerbuttonnode = $FrontOfPlayer/FingerButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var fingertipnode = $Joints3D.get_node("R%d" % OpenXRInterface.HAND_JOINT_INDEX_TIP) | |
var fingerbuttonnode = $FrontOfPlayer/FingerButton | |
var finger_tipnode = $Joints3D.get_node("R%d" % OpenXRInterface.HAND_JOINT_INDEX_TIP) | |
var finger_button_node = $FrontOfPlayer/FingerButton |
# reposition the joining sticks | ||
var LRstick = "L%dt%d" if hand == 0 else "R%dt%d" | ||
for hjstick in hjsticks: | ||
for i in range(0, len(hjstick)-1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i in range(0, len(hjstick)-1): | |
for i in range(0, len(hjstick) - 1): |
func _input_float_changed(name, value, hand): | ||
var ifsig = flat_display.get_node_or_null("VSlider%d%s" % [ hand, name ]) | ||
if ifsig: | ||
ifsig.value = value*100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifsig.value = value*100 | |
ifsig.value = value * 100 |
var p3 = Vector2(p2.x * subviewport.size.x, (1-p2.y) * subviewport.size.y) | ||
var fingerlenglab = Label.new() | ||
fingerlenglab.text = LRd%j | ||
fingerlenglab.name = "FL_"+(LRd%j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fingerlenglab.name = "FL_"+(LRd%j) | |
finger_length_label.name = "FL_" + (LRd % j) |
var p2 = Vector2((p1.x*1.1 + flatdisplaymesh.mesh.size.x*0.5)/flatdisplaymesh.mesh.size.x, (p1.y + flatdisplaymesh.mesh.size.y*0.5)/flatdisplaymesh.mesh.size.y) | ||
var p3 = Vector2(p2.x * subviewport.size.x, (1-p2.y) * subviewport.size.y) | ||
var fingerlenglab = Label.new() | ||
fingerlenglab.text = LRd%j |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fingerlenglab.text = LRd%j | |
finger_length_label.text = LRd % j |
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