Skip to content

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

$XROrigin3D/HandJoints.set_xr_interface(xr_interface)



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

Comment on lines +23 to +24


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

if xr_interface and xr_interface.is_initialized():
var vp = get_viewport()

# Enable XR on the main viewport
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
# 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
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
# 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



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

Comment on lines +258 to +259
var fingertipnode = $Joints3D.get_node("R%d" % OpenXRInterface.HAND_JOINT_INDEX_TIP)
var fingerbuttonnode = $FrontOfPlayer/FingerButton
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
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):
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
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
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
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)
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
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
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
fingerlenglab.text = LRd%j
finger_length_label.text = LRd % j

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