-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15d0abb
commit 6f27b6e
Showing
23 changed files
with
1,531 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/godot-openxr/godot_openxr.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
resource_name = "OpenXRHand" | ||
class_name = "OpenXRHand" | ||
library = ExtResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/godot-openxr/godot_openxr.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
resource_name = "OpenXRPose" | ||
class_name = "OpenXRPose" | ||
library = ExtResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/godot-openxr/godot_openxr.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
resource_name = "OpenXRSkeleton" | ||
class_name = "OpenXRSkeleton" | ||
library = ExtResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[gd_resource type="SpatialMaterial" format=2] | ||
|
||
[resource] | ||
|
||
resource_name = "Bone material" | ||
render_priority = 0 | ||
flags_transparent = false | ||
flags_unshaded = false | ||
flags_vertex_lighting = false | ||
flags_no_depth_test = false | ||
flags_use_point_size = false | ||
flags_world_triplanar = false | ||
flags_fixed_size = false | ||
flags_albedo_tex_force_srgb = false | ||
vertex_color_use_as_albedo = false | ||
vertex_color_is_srgb = false | ||
params_diffuse_mode = 0 | ||
params_specular_mode = 0 | ||
params_blend_mode = 0 | ||
params_cull_mode = 0 | ||
params_depth_draw_mode = 0 | ||
params_line_width = 1.0 | ||
params_point_size = 1.0 | ||
params_billboard_mode = 0 | ||
params_grow = false | ||
params_use_alpha_scissor = false | ||
albedo_color = Color( 1, 1, 1, 1 ) | ||
metallic = 0.0 | ||
metallic_specular = 0.5 | ||
metallic_texture_channel = 0 | ||
roughness = 0.7 | ||
roughness_texture_channel = 0 | ||
emission_enabled = false | ||
normal_enabled = false | ||
rim_enabled = false | ||
clearcoat_enabled = false | ||
anisotropy_enabled = false | ||
ao_enabled = false | ||
depth_enabled = false | ||
subsurf_scatter_enabled = false | ||
transmission_enabled = false | ||
refraction_enabled = false | ||
detail_enabled = false | ||
uv1_scale = Vector3( 1, 1, 1 ) | ||
uv1_offset = Vector3( 0, 0, 0 ) | ||
uv1_triplanar = false | ||
uv1_triplanar_sharpness = 1.0 | ||
uv2_scale = Vector3( 1, 1, 1 ) | ||
uv2_offset = Vector3( 0, 0, 0 ) | ||
uv2_triplanar = false | ||
uv2_triplanar_sharpness = 1.0 | ||
proximity_fade_enable = false | ||
distance_fade_enable = false | ||
_sections_unfolded = [ "Albedo", "Resource", "Roughness" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[gd_resource type="SpatialMaterial" format=2] | ||
|
||
[resource] | ||
|
||
resource_name = "Center ball" | ||
render_priority = 0 | ||
flags_transparent = false | ||
flags_unshaded = false | ||
flags_vertex_lighting = false | ||
flags_no_depth_test = false | ||
flags_use_point_size = false | ||
flags_world_triplanar = false | ||
flags_fixed_size = false | ||
flags_albedo_tex_force_srgb = false | ||
vertex_color_use_as_albedo = false | ||
vertex_color_is_srgb = false | ||
params_diffuse_mode = 0 | ||
params_specular_mode = 0 | ||
params_blend_mode = 0 | ||
params_cull_mode = 0 | ||
params_depth_draw_mode = 0 | ||
params_line_width = 1.0 | ||
params_point_size = 1.0 | ||
params_billboard_mode = 0 | ||
params_grow = false | ||
params_use_alpha_scissor = false | ||
albedo_color = Color( 0.949219, 0.241013, 0.241013, 1 ) | ||
metallic = 0.7 | ||
metallic_specular = 0.5 | ||
metallic_texture_channel = 0 | ||
roughness = 0.0 | ||
roughness_texture_channel = 0 | ||
emission_enabled = false | ||
normal_enabled = false | ||
rim_enabled = false | ||
clearcoat_enabled = false | ||
anisotropy_enabled = false | ||
ao_enabled = false | ||
depth_enabled = false | ||
subsurf_scatter_enabled = false | ||
transmission_enabled = false | ||
refraction_enabled = false | ||
detail_enabled = false | ||
uv1_scale = Vector3( 1, 1, 1 ) | ||
uv1_offset = Vector3( 0, 0, 0 ) | ||
uv1_triplanar = false | ||
uv1_triplanar_sharpness = 1.0 | ||
uv2_scale = Vector3( 1, 1, 1 ) | ||
uv2_offset = Vector3( 0, 0, 0 ) | ||
uv2_triplanar = false | ||
uv2_triplanar_sharpness = 1.0 | ||
proximity_fade_enable = false | ||
distance_fade_enable = false | ||
_sections_unfolded = [ "Albedo", "Metallic", "Resource" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
extends Spatial | ||
|
||
#################################################################################### | ||
# and some process logic to make our hands work | ||
|
||
func update_lengths(): | ||
# this probably is only needed once after tracking has been on for a few frames but... | ||
for d in range(0,5): | ||
# our 5 root nodes should be our 5 fingers | ||
var finger = get_child(d) | ||
if finger and finger.get_child_count() >= 2: | ||
# our first node is our joint, and our second joint is the bone to that joint | ||
var joint = finger.get_child(0) | ||
var bone = finger.get_child(1) | ||
while joint and bone: | ||
var bone_len = joint.translation.length() | ||
|
||
# use scale and translation to place our bone | ||
bone.scale = Vector3(1.0, bone_len, 1.0) | ||
bone.translation = Vector3(0.0, 0.0, -bone_len / 2.0) | ||
|
||
if joint.get_child_count() >= 2: | ||
bone = joint.get_child(1) | ||
joint = joint.get_child(0) | ||
else: | ||
# the end... | ||
joint = null | ||
bone = null | ||
|
||
func _physics_process(delta): | ||
# (we do this in physics because OpenXR updates positions in physics) | ||
update_lengths() |
Oops, something went wrong.