Skip to content

Commit

Permalink
Merge pull request #53 from Nitwel/testing
Browse files Browse the repository at this point in the history
Implement experimental handtracking
  • Loading branch information
Nitwel authored Nov 28, 2023
2 parents 35a1abb + f2dbcf0 commit 0c5cfba
Show file tree
Hide file tree
Showing 68 changed files with 1,248 additions and 293 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.tres filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.glb filter=lfs diff=lfs merge=lfs -text
*.gltf filter=lfs diff=lfs merge=lfs -text
*.obj filter=lfs diff=lfs merge=lfs -text
*.mtl filter=lfs diff=lfs merge=lfs -text
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ It is also possible to bubble up information by returning a dictionary from a fu

| Function called | Args | Description |
| -- | -- | -- |
| `_on_click` | `[event: EventRay]` | The back trigger button has been pressed and released |
| `_on_press_down` | `[event: EventRay]` | The back trigger button has been pressed down |
| `_on_press_move` | `[event: EventRay]` | The back trigger button has been moved while pressed down |
| `_on_press_up` | `[event: EventRay]` | The back trigger button has been released |
| `_on_grab_down` | `[event: EventRay]` | The side grab button been pressed down |
| `_on_grab_move` | `[event: EventRay]` | The side grab button been pressed down |
| `_on_grab_up` | `[event: EventRay]` | The side grab button been released |
| `_on_ray_enter` | `[event: EventRay]` | The ray-cast enters the the collision body |
| `_on_ray_leave` | `[event: EventRay]` | The ray-cast leaves the the collision body |
| `_on_click` | `[event: EventPointer]` | The back trigger button has been pressed and released |
| `_on_press_down` | `[event: EventPointer]` | The back trigger button has been pressed down |
| `_on_press_move` | `[event: EventPointer]` | The back trigger button has been moved while pressed down |
| `_on_press_up` | `[event: EventPointer]` | The back trigger button has been released |
| `_on_grab_down` | `[event: EventPointer]` | The side grab button been pressed down |
| `_on_grab_move` | `[event: EventPointer]` | The side grab button been pressed down |
| `_on_grab_up` | `[event: EventPointer]` | The side grab button been released |
| `_on_ray_enter` | `[event: EventPointer]` | The ray-cast enters the the collision body |
| `_on_ray_leave` | `[event: EventPointer]` | The ray-cast leaves the the collision body |
| `_on_key_down` | `[event: EventKey]` | The ray-cast leaves the the collision body |
| `_on_key_up` | `[event: EventKey]` | The ray-cast leaves the the collision body |
| `_on_focus_in` | `[event: EventFocus]` | The node is got focused |
Expand All @@ -140,8 +140,9 @@ Thus I've decided to use a custom event system that is similar to the one used i
| Group | Description |
| -- | -- |
| `entity` | Marks the object as being an entity placed in space |
| `ui_focus` | The element can be focused |
| `ui_focus_skip` | The focus will not be reset. Useful for keyboard |
| `ui_focus` | The element can be focused, can be a parent |
| `ui_focus_skip` | Focus checking on this element will be skipped |
| `ui_focus_stop` | The focus will not be reset. Useful for keyboard |


### Functions
Expand Down
26 changes: 13 additions & 13 deletions addons/godot-xr-tools/hands/scenes/highpoly/left_hand.tscn
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
[gd_scene load_steps=13 format=3 uid="uid://njx823gyk04n"]

[ext_resource type="PackedScene" uid="uid://q1l3fknstir2" path="res://addons/godot-xr-tools/hands/model/Hand_Nails_L.gltf" id="1"]
[ext_resource type="PackedScene" uid="uid://bh786yhm5v4fh" path="res://addons/godot-xr-tools/hands/model/Hand_Nails_L.gltf" id="1"]
[ext_resource type="PackedScene" uid="uid://the6y7swe6j0" path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" id="2"]
[ext_resource type="Script" path="res://addons/godot-xr-tools/hands/hand.gd" id="3"]
[ext_resource type="Resource" uid="uid://dertgu7k8alls" path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" id="3_k56uy"]
[ext_resource type="AnimationNodeBlendTree" uid="uid://dl8yf7ipqotd1" path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" id="5"]
[ext_resource type="Material" uid="uid://dbvge3quu3bju" path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" id="6"]

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_x12eo"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_e6byy"]
animation = &"Grip"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_kw2gg"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_bs8g1"]
animation = &"Grip"

[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_o8j0s"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_675c4"]
filter_enabled = true
filters = ["Armature/Skeleton3D:Little_Distal_L", "Armature/Skeleton3D:Little_Intermediate_L", "Armature/Skeleton3D:Little_Metacarpal_L", "Armature/Skeleton3D:Little_Proximal_L", "Armature/Skeleton3D:Middle_Distal_L", "Armature/Skeleton3D:Middle_Intermediate_L", "Armature/Skeleton3D:Middle_Metacarpal_L", "Armature/Skeleton3D:Middle_Proximal_L", "Armature/Skeleton3D:Ring_Distal_L", "Armature/Skeleton3D:Ring_Intermediate_L", "Armature/Skeleton3D:Ring_Metacarpal_L", "Armature/Skeleton3D:Ring_Proximal_L", "Armature/Skeleton3D:Thumb_Distal_L", "Armature/Skeleton3D:Thumb_Metacarpal_L", "Armature/Skeleton3D:Thumb_Proximal_L", "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L"]

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_cxcnq"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2ssci"]
animation = &"Grip 5"

[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_yn70n"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_narw6"]
filter_enabled = true
filters = ["Armature/Skeleton3D:Index_Distal_L", "Armature/Skeleton3D:Index_Intermediate_L", "Armature/Skeleton3D:Index_Metacarpal_L", "Armature/Skeleton3D:Index_Proximal_L", "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L"]

[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_v8owg"]
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_wp4n0"]
graph_offset = Vector2(-536, 11)
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_x12eo")
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_e6byy")
nodes/ClosedHand1/position = Vector2(-600, 300)
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_kw2gg")
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_bs8g1")
nodes/ClosedHand2/position = Vector2(-360, 300)
nodes/Grip/node = SubResource("AnimationNodeBlend2_o8j0s")
nodes/Grip/node = SubResource("AnimationNodeBlend2_675c4")
nodes/Grip/position = Vector2(0, 20)
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_cxcnq")
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_2ssci")
nodes/OpenHand/position = Vector2(-600, 100)
nodes/Trigger/node = SubResource("AnimationNodeBlend2_yn70n")
nodes/Trigger/node = SubResource("AnimationNodeBlend2_narw6")
nodes/Trigger/position = Vector2(-360, 20)
node_connections = [&"output", 0, &"Grip", &"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1"]

Expand Down Expand Up @@ -73,7 +73,7 @@ surface_material_override/0 = ExtResource("6")
[node name="AnimationPlayer" parent="Hand_Nails_L" instance=ExtResource("2")]

[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = SubResource("AnimationNodeBlendTree_v8owg")
tree_root = SubResource("AnimationNodeBlendTree_wp4n0")
anim_player = NodePath("../Hand_Nails_L/AnimationPlayer")
active = true
parameters/Grip/blend_amount = 0.0
Expand Down
3 changes: 3 additions & 0 deletions assets/immersive_home/button.mtl
Git LFS file not shown
3 changes: 3 additions & 0 deletions assets/immersive_home/button.obj
Git LFS file not shown
21 changes: 21 additions & 0 deletions assets/immersive_home/button.obj.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wavefront_obj"
importer_version=1
type="Mesh"
uid="uid://iv4lk77axlk4"
path="res://.godot/imported/button.obj-e6c969b54c5afbe601f3ea5c30bde0ec.mesh"

[deps]

files=["res://.godot/imported/button.obj-e6c969b54c5afbe601f3ea5c30bde0ec.mesh"]

source_file="res://assets/immersive_home/button.obj"
dest_files=["res://.godot/imported/button.obj-e6c969b54c5afbe601f3ea5c30bde0ec.mesh", "res://.godot/imported/button.obj-e6c969b54c5afbe601f3ea5c30bde0ec.mesh"]

[params]

generate_tangents=true
scale_mesh=Vector3(1, 1, 1)
offset_mesh=Vector3(0, 0, 0)
optimize_mesh=true
3 changes: 3 additions & 0 deletions assets/models/hands_steam/left_hand.glb
Git LFS file not shown
32 changes: 32 additions & 0 deletions assets/models/hands_steam/left_hand.glb.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[remap]

importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dt4ksvogfctkr"
path="res://.godot/imported/left_hand.glb-d1b6eb8d19651a395c75d8356aea3687.scn"

[deps]

source_file="res://assets/models/hands_steam/left_hand.glb"
dest_files=["res://.godot/imported/left_hand.glb-d1b6eb8d19651a395c75d8356aea3687.scn"]

[params]

nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/embedded_image_handling=1
3 changes: 3 additions & 0 deletions assets/models/hands_steam/left_hand_file2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions assets/models/hands_steam/left_hand_file2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://y2l04213se8o"
path.s3tc="res://.godot/imported/left_hand_file2.png-753ecb3429d6d797b17376208f876be4.s3tc.ctex"
path.etc2="res://.godot/imported/left_hand_file2.png-753ecb3429d6d797b17376208f876be4.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={}

[deps]

source_file="res://assets/models/hands_steam/left_hand_file2.png"
dest_files=["res://.godot/imported/left_hand_file2.png-753ecb3429d6d797b17376208f876be4.s3tc.ctex", "res://.godot/imported/left_hand_file2.png-753ecb3429d6d797b17376208f876be4.etc2.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=1
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=1
roughness/src_normal="res://left_hand_file2.png"
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
3 changes: 3 additions & 0 deletions assets/models/hands_steam/left_hand_file3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions assets/models/hands_steam/left_hand_file3.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dmrf63au6a5jr"
path.s3tc="res://.godot/imported/left_hand_file3.png-88d88e1602347accb4d3c945bb045e57.s3tc.ctex"
path.etc2="res://.godot/imported/left_hand_file3.png-88d88e1602347accb4d3c945bb045e57.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={}

[deps]

source_file="res://assets/models/hands_steam/left_hand_file3.png"
dest_files=["res://.godot/imported/left_hand_file3.png-88d88e1602347accb4d3c945bb045e57.s3tc.ctex", "res://.godot/imported/left_hand_file3.png-88d88e1602347accb4d3c945bb045e57.etc2.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
3 changes: 3 additions & 0 deletions assets/models/hands_steam/openxr_glove_left_model_slim.glb
Git LFS file not shown
32 changes: 32 additions & 0 deletions assets/models/hands_steam/openxr_glove_left_model_slim.glb.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[remap]

importer="scene"
importer_version=1
type="PackedScene"
uid="uid://cxaoselwp17hj"
path="res://.godot/imported/openxr_glove_left_model_slim.glb-3bc08bf7e42d440cc1352baebd3824f3.scn"

[deps]

source_file="res://assets/models/hands_steam/openxr_glove_left_model_slim.glb"
dest_files=["res://.godot/imported/openxr_glove_left_model_slim.glb-3bc08bf7e42d440cc1352baebd3824f3.scn"]

[params]

nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/embedded_image_handling=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cqq4ir2g3dtts"
path.s3tc="res://.godot/imported/openxr_glove_left_model_slim_file2.png-b570006e307615a62ead358262b940b2.s3tc.ctex"
path.etc2="res://.godot/imported/openxr_glove_left_model_slim_file2.png-b570006e307615a62ead358262b940b2.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={}

[deps]

source_file="res://assets/models/hands_steam/openxr_glove_left_model_slim_file2.png"
dest_files=["res://.godot/imported/openxr_glove_left_model_slim_file2.png-b570006e307615a62ead358262b940b2.s3tc.ctex", "res://.godot/imported/openxr_glove_left_model_slim_file2.png-b570006e307615a62ead358262b940b2.etc2.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=1
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=1
roughness/src_normal="res://hands/openxr_glove_left_model_slim_file2.png"
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cjyf87dcd0me5"
path.s3tc="res://.godot/imported/openxr_glove_left_model_slim_file3.png-e75731c876f664216c04a5bf1e9c9169.s3tc.ctex"
path.etc2="res://.godot/imported/openxr_glove_left_model_slim_file3.png-e75731c876f664216c04a5bf1e9c9169.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={}

[deps]

source_file="res://assets/models/hands_steam/openxr_glove_left_model_slim_file3.png"
dest_files=["res://.godot/imported/openxr_glove_left_model_slim_file3.png-e75731c876f664216c04a5bf1e9c9169.s3tc.ctex", "res://.godot/imported/openxr_glove_left_model_slim_file3.png-e75731c876f664216c04a5bf1e9c9169.etc2.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
3 changes: 3 additions & 0 deletions assets/models/hands_steam/right_hand.glb
Git LFS file not shown
Loading

0 comments on commit 0c5cfba

Please sign in to comment.