Skip to content

Commit

Permalink
Add example of using HTC trackers
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiaanOlij committed Apr 22, 2022
1 parent 4eebf34 commit e22fc7c
Show file tree
Hide file tree
Showing 12 changed files with 9,373 additions and 348 deletions.
5 changes: 5 additions & 0 deletions Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ func _ready():

func _on_right_hand_button_pressed(p_name):
print("Pressed " + str(p_name))

func _input(event):
if event is InputEventKey:
if event.is_action_pressed("ui_cancel"):
get_tree().quit()
10 changes: 9 additions & 1 deletion Main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=39 format=3 uid="uid://dp1w8qmqbqe41"]
[gd_scene load_steps=40 format=3 uid="uid://dp1w8qmqbqe41"]

[ext_resource type="Script" path="res://Main.gd" id="1_yxygs"]
[ext_resource type="PackedScene" uid="uid://dkbe7ndgv0ovc" path="res://addons/godot-xr-tools/functions/Function_Direct_movement.tscn" id="2_g0m70"]
Expand All @@ -10,6 +10,7 @@
[ext_resource type="PackedScene" uid="uid://dxwrf3facunbq" path="res://addons/godot-xr-tools/assets/PlayerBody.tscn" id="6_pxggg"]
[ext_resource type="PackedScene" path="res://addons/godot-xr-tools/functions/Function_Climb_movement.tscn" id="8_14dk1"]
[ext_resource type="Texture2D" uid="uid://cho2aoqvhpf0u" path="res://assets/ambientCG.com/Grass004/Grass004_1K_Color.jpg" id="10_4gi21"]
[ext_resource type="ArrayMesh" uid="uid://citqp4t547mn" path="res://assets/htc/vr_tracker_vive_3_0/vr_tracker_vive_3_0.obj" id="10_6cagh"]
[ext_resource type="Texture2D" uid="uid://wnewp7iuahdu" path="res://assets/ambientCG.com/Grass004/Grass004_1K_NormalGL.jpg" id="11_kkfc6"]
[ext_resource type="Texture2D" uid="uid://bi56aarct11p6" path="res://assets/ambientCG.com/Grass004/Grass004_1K_Roughness.jpg" id="12_mutam"]
[ext_resource type="PackedScene" uid="uid://c7mq5w60bchs0" path="res://scenes/MonkeyBars.tscn" id="13_y2500"]
Expand Down Expand Up @@ -278,6 +279,13 @@ max_samples = 10
left_pickup = NodePath("../LeftHand/Function_Pickup")
right_pickup = NodePath("../RightHand/Function_Pickup")

[node name="HTC_Tracker_Keyboard" type="XRController3D" parent="XROrigin3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.39313, 0)
tracker = &"/user/vive_tracker_htcx/role/keyboard"

[node name="MeshInstance3D" type="MeshInstance3D" parent="XROrigin3D/HTC_Tracker_Keyboard"]
mesh = ExtResource( "10_6cagh" )

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( "Environment_v7gtd" )

Expand Down
2 changes: 1 addition & 1 deletion addons/godot-xr-tools/assets/HandBlendTree.tres
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ nodes/Grip/position = Vector2(780, 180)
nodes/Trigger/node = SubResource( "2" )
nodes/Trigger/position = Vector2(560, 80)
nodes/output/position = Vector2(1020, 80)
node_connections = [&"Trigger", 0, &"Default", &"Trigger", 1, &"Fist", &"Grip", 0, &"Trigger", &"Grip", 1, &"Fist2", &"output", 0, &"Grip"]
node_connections = [&"output", 0, &"Grip", &"Grip", 0, &"Trigger", &"Grip", 1, &"Fist2", &"Trigger", 0, &"Default", &"Trigger", 1, &"Fist"]
37 changes: 37 additions & 0 deletions assets/htc/vr_tracker_vive_3_0/vr_tracker_vive_3_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"thumbnail": "vive_controller_thumbnail.png",
"components": {
"body": {
"filename": "vr_tracker_vive_3_0.obj",
"component_local": {
"origin": [ 0.0, 0.0, 0.0 ],
"rotate_xyz": [ 0.0, 0.0, 0.0 ]
}
},
"back": {
"component_local": {
"origin": [ 0.0, 0.0, 0.0 ],
"rotate_xyz": [ 0.0, 0.0, 180.0 ]
}
},
"pistol": {
"component_local": {
"origin": [ 0.0, 0.0, 0.0 ],
"rotate_xyz": [ -30.0, 0.0, 180.0 ]
}
},
"front_rolled": {
"component_local": {
"origin": [ 0.0, 0.0, 0.01 ],
"rotate_xyz": [ 90.0, 180.0, 0.0 ]
}
},
"front": {
"component_local": {
"origin": [ 0.0, 0.0, 0.01 ],
"rotate_xyz": [ 90.0, 0.0, 0.0 ]
}
}
}
}
}
28 changes: 28 additions & 0 deletions assets/htc/vr_tracker_vive_3_0/vr_tracker_vive_3_0.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
newmtl VIVE_Tracker_3_0_
illum 4
Kd 0.50 0.50 0.50
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00
newmtl VIVE_Tracker_CUI__
illum 4
Kd 0.50 0.50 0.50
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00
newmtl initialShadingGroup
illum 4
Kd 0.50 0.50 0.50
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00
newmtl vr_tracker_vive_3_0_SG
illum 4
Kd 0.00 0.00 0.00
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
map_Kd vr_tracker_vive_3_0_diff.png
Ni 1.00
Ks 0.00 0.00 0.00
map_Ks vr_tracker_vive_3_0_Spec.png
Ns 18.00
Loading

0 comments on commit e22fc7c

Please sign in to comment.