From 6e3eedb7d1742769d331788d6e3d3c379fcdb341 Mon Sep 17 00:00:00 2001 From: carlos padial Date: Sun, 6 Oct 2024 01:40:56 +0200 Subject: [PATCH] Function gaze pointer (#683) * function gaze pointer * hide laser pointer * remove trailing whitespace --- .../functions/function_gaze_pointer.gd | 555 ++++++++++++++++++ .../functions/function_gaze_pointer.tscn | 66 +++ ...hold_button_gaze_pointer_visualshader.tres | 313 ++++++++++ scenes/main_menu/main_menu_level.tscn | 59 +- scenes/pointer_demo/pointer_demo.tscn | 60 +- 5 files changed, 1000 insertions(+), 53 deletions(-) create mode 100644 addons/godot-xr-tools/functions/function_gaze_pointer.gd create mode 100644 addons/godot-xr-tools/functions/function_gaze_pointer.tscn create mode 100644 addons/godot-xr-tools/misc/hold_button_gaze_pointer_visualshader.tres diff --git a/addons/godot-xr-tools/functions/function_gaze_pointer.gd b/addons/godot-xr-tools/functions/function_gaze_pointer.gd new file mode 100644 index 00000000..2d6c17cc --- /dev/null +++ b/addons/godot-xr-tools/functions/function_gaze_pointer.gd @@ -0,0 +1,555 @@ +@tool +@icon("res://addons/godot-xr-tools/editor/icons/function.svg") +class_name XRToolsFunctionGazePointer +extends Node3D + + +## XR Tools Function Gaze Pointer Script +## +## This script implements a pointer function for a players camera. Pointer +## events (entered, exited, pressed, release, and movement) are delivered by +## invoking signals on the target node. +## +## Pointer target nodes commonly extend from [XRToolsInteractableArea] or +## [XRToolsInteractableBody]. + + +## Signal emitted when this object points at another object +signal pointing_event(event) + + +## Enumeration of laser show modes +enum LaserShow { + HIDE = 0, ## Hide laser + SHOW = 1, ## Show laser + COLLIDE = 2, ## Only show laser on collision +} + +## Enumeration of laser length modes +enum LaserLength { + FULL = 0, ## Full length + COLLIDE = 1 ## Draw to collision +} + + +## Default pointer collision mask of 21:pointable and 23:ui-objects +const DEFAULT_MASK := 0b0000_0000_0101_0000_0000_0000_0000_0000 + +## Default pointer collision mask of 23:ui-objects +const SUPPRESS_MASK := 0b0000_0000_0100_0000_0000_0000_0000_0000 + + +@export_group("General") + +## Pointer enabled +@export var enabled : bool = true: set = set_enabled + +## Y Offset for pointer +@export var y_offset : float = -0.013: set = set_y_offset + +## Pointer distance +@export var distance : float = 10: set = set_distance + +## Active button action +@export var active_button_action : String = "trigger_click" + +@export_group("Laser") + +## Controls when the laser is visible +@export var show_laser : LaserShow = LaserShow.SHOW: set = set_show_laser + +## Controls the length of the laser +@export var laser_length : LaserLength = LaserLength.FULL: set = set_laser_length + +## Laser pointer material +@export var laser_material : StandardMaterial3D = null : set = set_laser_material + +## Laser pointer material when hitting target +@export var laser_hit_material : StandardMaterial3D = null : set = set_laser_hit_material + +@export_group("Target") + +## If true, the pointer target is shown +@export var show_target : bool = false: set = set_show_target + +## Controls the target radius +@export var target_radius : float = 0.05: set = set_target_radius + +## Target material +@export var target_material : StandardMaterial3D = null : set = set_target_material + +@export_group("Collision") + +## Pointer collision mask +@export_flags_3d_physics var collision_mask : int = DEFAULT_MASK: set = set_collision_mask + +## Enable pointer collision with bodies +@export var collide_with_bodies : bool = true: set = set_collide_with_bodies + +## Enable pointer collision with areas +@export var collide_with_areas : bool = false: set = set_collide_with_areas + +@export_group("Suppression") + +## Suppress radius +@export var suppress_radius : float = 0.2: set = set_suppress_radius + +## Suppress mask +@export_flags_3d_physics var suppress_mask : int = SUPPRESS_MASK: set = set_suppress_mask + +@export_group("Gaze Pointer") + +## send clicks on hold or just move the mouse +@export var click_on_hold : bool = false + +## time on hold to release a click +@export var hold_time : float = 2.0 + +## Color our our visualisation +@export var color : Color = Color(1.0, 1.0, 1.0, 1.0): set = set_color + +## Size of the pointer end +@export var size : Vector2 = Vector2(0.3, 0.3): set = set_size + +## held time counter +var time_held = 0.0 + +## hold to click cursor material +var material : ShaderMaterial + +## bool for release click +var gaze_pressed = false + +## Current target node +var target : Node3D = null + +## Last target node +var last_target : Node3D = null + +## Last collision point +var last_collided_at : Vector3 = Vector3.ZERO + +# World scale +var _world_scale : float = 1.0 + +# The current camera +var _camera_parent : XRCamera3D + +## Add support for is_xr_class on XRTools classes +func is_xr_class(name : String) -> bool: + return name == "XRToolsFunctionGazePointer" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + # Do not initialise if in the editor + if Engine.is_editor_hint(): + return + + # Read the initial world-scale + _world_scale = XRServer.world_scale + + _camera_parent = get_parent() as XRCamera3D + + material = $Visualise.get_surface_override_material(0) + + if !Engine.is_editor_hint(): + _set_time_held(0.0) + + _update_size() + _update_color() + + # init our state + _update_y_offset() + _update_distance() + _update_pointer() + _update_target_radius() + _update_target_material() + _update_collision_mask() + _update_collide_with_bodies() + _update_collide_with_areas() + _update_suppress_radius() + _update_suppress_mask() + + +# Called on each frame to update the pickup +func _process(delta): + # Do not process if in the editor + if Engine.is_editor_hint() or !is_inside_tree(): + return + + # Handle world-scale changes + var new_world_scale := XRServer.world_scale + if (_world_scale != new_world_scale): + _world_scale = new_world_scale + _update_y_offset() + + # Find the new pointer target + var new_target : Node3D + var new_at : Vector3 + var suppress_area := $SuppressArea + if (enabled and + not $SuppressArea.has_overlapping_bodies() and + not $SuppressArea.has_overlapping_areas() and + $RayCast.is_colliding()): + new_at = $RayCast.get_collision_point() + if target: + # Locked to 'target' even if we're colliding with something else + new_target = target + else: + # Target is whatever the raycast is colliding with + new_target = $RayCast.get_collider() + + # hide gaze pointer when pressed + if gaze_pressed: + show_target = false + else: + show_target = true + + # If no current or previous collisions then skip + if not new_target and not last_target: + return + + # Handle pointer changes + if new_target and not last_target: + # Pointer entered new_target + XRToolsPointerEvent.entered(self, new_target, new_at) + + # Pointer moved on new_target for the first time + XRToolsPointerEvent.moved(self, new_target, new_at, new_at) + + if click_on_hold and !gaze_pressed: + _set_time_held(time_held + delta) + if time_held > hold_time: + _button_pressed() + + # Update visible artifacts for hit + _visible_hit(new_at) + elif not new_target and last_target: + # Pointer exited last_target + XRToolsPointerEvent.exited(self, last_target, last_collided_at) + + if click_on_hold: + _set_time_held(0.0) + gaze_pressed = false + + # Update visible artifacts for miss + _visible_miss() + elif new_target != last_target: + # Pointer exited last_target + XRToolsPointerEvent.exited(self, last_target, last_collided_at) + + if click_on_hold: + _set_time_held(0.0) + gaze_pressed = false + + # Pointer entered new_target + XRToolsPointerEvent.entered(self, new_target, new_at) + + # Pointer moved on new_target + XRToolsPointerEvent.moved(self, new_target, new_at, new_at) + + if click_on_hold and !gaze_pressed: + _set_time_held(time_held + delta) + if time_held > hold_time: + _button_pressed() + + # Move visible artifacts + _visible_move(new_at) + elif new_at != last_collided_at: + # Pointer moved on new_target + XRToolsPointerEvent.moved(self, new_target, new_at, last_collided_at) + + if click_on_hold and !gaze_pressed: + _set_time_held(time_held + delta) + if time_held > hold_time: + _button_pressed() + + # Move visible artifacts + _visible_move(new_at) + + # Update last values + last_target = new_target + last_collided_at = new_at + + +# Set pointer enabled property +func set_enabled(p_enabled : bool) -> void: + enabled = p_enabled + if is_inside_tree(): + _update_pointer() + + +# Set pointer y_offset property +func set_y_offset(p_offset : float) -> void: + y_offset = p_offset + if is_inside_tree(): + _update_y_offset() + + +# Set pointer distance property +func set_distance(p_new_value : float) -> void: + distance = p_new_value + if is_inside_tree(): + _update_distance() + + +# Set pointer show_laser property +func set_show_laser(p_show : LaserShow) -> void: + show_laser = p_show + if is_inside_tree(): + _update_pointer() + + +# Set pointer laser_length property +func set_laser_length(p_laser_length : LaserLength) -> void: + laser_length = p_laser_length + if is_inside_tree(): + _update_pointer() + + +# Set pointer laser_material property +func set_laser_material(p_laser_material : StandardMaterial3D) -> void: + laser_material = p_laser_material + if is_inside_tree(): + _update_pointer() + + +# Set pointer laser_hit_material property +func set_laser_hit_material(p_laser_hit_material : StandardMaterial3D) -> void: + laser_hit_material = p_laser_hit_material + if is_inside_tree(): + _update_pointer() + + +# Set pointer show_target property +func set_show_target(p_show_target : bool) -> void: + show_target = p_show_target + if is_inside_tree(): + $Target.visible = enabled and show_target and last_target + + +# Set pointer target_radius property +func set_target_radius(p_target_radius : float) -> void: + target_radius = p_target_radius + if is_inside_tree(): + _update_target_radius() + + +# Set pointer target_material property +func set_target_material(p_target_material : StandardMaterial3D) -> void: + target_material = p_target_material + if is_inside_tree(): + _update_target_material() + + +# Set pointer collision_mask property +func set_collision_mask(p_new_mask : int) -> void: + collision_mask = p_new_mask + if is_inside_tree(): + _update_collision_mask() + + +# Set pointer collide_with_bodies property +func set_collide_with_bodies(p_new_value : bool) -> void: + collide_with_bodies = p_new_value + if is_inside_tree(): + _update_collide_with_bodies() + + +# Set pointer collide_with_areas property +func set_collide_with_areas(p_new_value : bool) -> void: + collide_with_areas = p_new_value + if is_inside_tree(): + _update_collide_with_areas() + + +# Set suppress radius property +func set_suppress_radius(p_suppress_radius : float) -> void: + suppress_radius = p_suppress_radius + if is_inside_tree(): + _update_suppress_radius() + + +func set_suppress_mask(p_suppress_mask : int) -> void: + suppress_mask = p_suppress_mask + if is_inside_tree(): + _update_suppress_mask() + + +# Pointer Y offset update handler +func _update_y_offset() -> void: + $Laser.position.y = y_offset * _world_scale + $RayCast.position.y = y_offset * _world_scale + + +# Pointer distance update handler +func _update_distance() -> void: + $RayCast.target_position.z = -distance + _update_pointer() + + +# Pointer target radius update handler +func _update_target_radius() -> void: + $Target.mesh.radius = target_radius + $Target.mesh.height = target_radius * 2 + + +# Pointer target_material update handler +func _update_target_material() -> void: + $Target.set_surface_override_material(0, target_material) + + +# Pointer collision_mask update handler +func _update_collision_mask() -> void: + $RayCast.collision_mask = collision_mask + + +# Pointer collide_with_bodies update handler +func _update_collide_with_bodies() -> void: + $RayCast.collide_with_bodies = collide_with_bodies + + +# Pointer collide_with_areas update handler +func _update_collide_with_areas() -> void: + $RayCast.collide_with_areas = collide_with_areas + + +# Pointer suppress_radius update handler +func _update_suppress_radius() -> void: + $SuppressArea/CollisionShape3D.shape.radius = suppress_radius + + +# Pointer suppress_mask update handler +func _update_suppress_mask() -> void: + $SuppressArea.collision_mask = suppress_mask + + +# Pointer visible artifacts update handler +func _update_pointer() -> void: + if enabled and last_target: + _visible_hit(last_collided_at) + else: + _visible_miss() + + +# Pointer-activation button pressed handler +func _button_pressed() -> void: + if $RayCast.is_colliding(): + # Report pressed + target = $RayCast.get_collider() + last_collided_at = $RayCast.get_collision_point() + XRToolsPointerEvent.pressed(self, target, last_collided_at) + if click_on_hold: + _set_time_held(0.0) + gaze_pressed = true + XRToolsPointerEvent.released(self, last_target, last_collided_at) + target = null + _set_time_held(0.0) + +# Pointer-activation button released handler +func _button_released() -> void: + if target: + # Report release + XRToolsPointerEvent.released(self, target, last_collided_at) + target = null + last_collided_at = Vector3(0, 0, 0) + + +# Update the laser active material +func _update_laser_active_material(hit : bool) -> void: + if hit and laser_hit_material: + $Laser.set_surface_override_material(0, laser_hit_material) + else: + $Laser.set_surface_override_material(0, laser_material) + + +# Update the visible artifacts to show a hit +func _visible_hit(at : Vector3) -> void: + # Show target if enabled + if show_target: + $Target.global_transform.origin = at + $Target.visible = true + + # Control laser visibility + if show_laser != LaserShow.HIDE: + # Ensure the correct laser material is set + _update_laser_active_material(true) + + # Adjust laser length + if laser_length == LaserLength.COLLIDE: + var collide_len : float = at.distance_to(global_transform.origin) + $Laser.mesh.size.z = collide_len + $Laser.position.z = collide_len * -0.5 + else: + $Laser.mesh.size.z = distance + $Laser.position.z = distance * -0.5 + + # Show laser + $Laser.visible = true + else: + # Ensure laser is hidden + $Laser.visible = false + + +# Move the visible pointer artifacts to the target +func _visible_move(at : Vector3) -> void: + # Move target if configured + if show_target: + $Target.global_transform.origin = at + + # Adjust laser length if set to collide-length + if laser_length == LaserLength.COLLIDE: + var collide_len : float = at.distance_to(global_transform.origin) + $Laser.mesh.size.z = collide_len + $Laser.position.z = collide_len * -0.5 + + $Visualise.global_transform.origin = at + + +# Update the visible artifacts to show a miss +func _visible_miss() -> void: + # Ensure target is hidden + $Target.visible = false + + # Ensure the correct laser material is set + _update_laser_active_material(false) + + # Hide laser if not set to show always + $Laser.visible = show_laser == LaserShow.SHOW + + # Restore laser length if set to collide-length + $Laser.mesh.size.z = distance + $Laser.position.z = distance * -0.5 + +#set gaze pointer visualization +func _set_time_held(p_time_held): + time_held = p_time_held + if material: + $Visualise.visible = time_held > 0.0 + material.set_shader_parameter("value", time_held/hold_time) + +# set gaze pointer size +func set_size(p_size: Vector2): + size = p_size + _update_size() + +# update gaze pointer size +func _update_size(): + if material: # Note, material won't be set until after we setup our scene + var mesh : QuadMesh = $Visualise.mesh + if mesh.size != size: + mesh.size = size + + # updating the size will unset our material, so reset it + $Visualise.set_surface_override_material(0, material) + +#set gaze_pointer_color +func set_color(p_color: Color): + color = p_color + _update_color() + +#update gaze pointer color +func _update_color(): + if material: + material.set_shader_parameter("albedo", color) diff --git a/addons/godot-xr-tools/functions/function_gaze_pointer.tscn b/addons/godot-xr-tools/functions/function_gaze_pointer.tscn new file mode 100644 index 00000000..27348190 --- /dev/null +++ b/addons/godot-xr-tools/functions/function_gaze_pointer.tscn @@ -0,0 +1,66 @@ +[gd_scene load_steps=9 format=3 uid="uid://do1wif8rpqtwj"] + +[ext_resource type="Script" path="res://addons/godot-xr-tools/functions/function_gaze_pointer.gd" id="1_ipkdr"] +[ext_resource type="Material" path="res://addons/godot-xr-tools/materials/pointer.tres" id="2_ndm62"] +[ext_resource type="Shader" uid="uid://dncfip67nl2sf" path="res://addons/godot-xr-tools/misc/hold_button_gaze_pointer_visualshader.tres" id="3_1p5pd"] + +[sub_resource type="BoxMesh" id="1"] +resource_local_to_scene = true +material = ExtResource("2_ndm62") +size = Vector3(0.002, 0.002, 10) +subdivide_depth = 20 + +[sub_resource type="SphereMesh" id="2"] +material = ExtResource("2_ndm62") +radius = 0.05 +height = 0.1 +radial_segments = 16 +rings = 8 + +[sub_resource type="SphereShape3D" id="SphereShape3D_k3gfm"] +radius = 0.2 + +[sub_resource type="QuadMesh" id="QuadMesh_lulcv"] +resource_local_to_scene = true + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_ico2c"] +render_priority = -100 +shader = ExtResource("3_1p5pd") +shader_parameter/albedo = Color(1, 1, 1, 1) +shader_parameter/value = 0.2 +shader_parameter/fade = 0.05 +shader_parameter/radius = 0.8 +shader_parameter/width = 0.2 + +[node name="FunctionGazePointer" type="Node3D"] +script = ExtResource("1_ipkdr") +show_laser = 0 +show_target = true + +[node name="RayCast" type="RayCast3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.013, 0) +target_position = Vector3(0, 0, -10) +collision_mask = 5242880 + +[node name="Laser" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.013, -5) +visible = false +cast_shadow = 0 +mesh = SubResource("1") + +[node name="Target" type="MeshInstance3D" parent="."] +visible = false +mesh = SubResource("2") + +[node name="SuppressArea" type="Area3D" parent="."] +collision_layer = 0 +collision_mask = 4194304 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="SuppressArea"] +shape = SubResource("SphereShape3D_k3gfm") + +[node name="Visualise" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1) +cast_shadow = 0 +mesh = SubResource("QuadMesh_lulcv") +surface_material_override/0 = SubResource("ShaderMaterial_ico2c") diff --git a/addons/godot-xr-tools/misc/hold_button_gaze_pointer_visualshader.tres b/addons/godot-xr-tools/misc/hold_button_gaze_pointer_visualshader.tres new file mode 100644 index 00000000..b88bb9a3 --- /dev/null +++ b/addons/godot-xr-tools/misc/hold_button_gaze_pointer_visualshader.tres @@ -0,0 +1,313 @@ +[gd_resource type="VisualShader" load_steps=28 format=3 uid="uid://dncfip67nl2sf"] + +[sub_resource type="VisualShaderNodeFloatOp" id="1"] +output_port_for_preview = 0 +default_input_values = [0, 0.0, 1, 0.1] +operator = 3 + +[sub_resource type="VisualShaderNodeFloatParameter" id="2"] +parameter_name = "width" + +[sub_resource type="VisualShaderNodeFloatOp" id="11"] +output_port_for_preview = 0 +default_input_values = [0, 1.0, 1, 0.0] +operator = 1 + +[sub_resource type="VisualShaderNodeFloatOp" id="12"] +output_port_for_preview = 0 +operator = 1 + +[sub_resource type="VisualShaderNodeFloatParameter" id="13"] +parameter_name = "fade" + +[sub_resource type="VisualShaderNodeFloatOp" id="14"] +default_input_values = [0, 0.0, 1, 2.0] +operator = 3 + +[sub_resource type="VisualShaderNodeVectorFunc" id="15"] +output_port_for_preview = 0 + +[sub_resource type="VisualShaderNodeDotProduct" id="16"] +default_input_values = [0, Vector3(0, 0, 0), 1, Vector3(0, -1, 0)] + +[sub_resource type="VisualShaderNodeVectorOp" id="17"] +default_input_values = [0, Vector3(0, 0, 0), 1, Vector3(0, -1, 0)] +operator = 8 + +[sub_resource type="VisualShaderNodeColorParameter" id="3"] +parameter_name = "albedo" + +[sub_resource type="VisualShaderNodeVectorDecompose" id="18"] + +[sub_resource type="VisualShaderNodeIf" id="19"] + +[sub_resource type="VisualShaderNodeFloatOp" id="20"] +default_input_values = [0, 6.28319, 1, 0.0] +operator = 1 + +[sub_resource type="VisualShaderNodeFloatFunc" id="21"] +output_port_for_preview = 0 +function = 4 + +[sub_resource type="VisualShaderNodeFloatOp" id="22"] +output_port_for_preview = 0 +default_input_values = [0, 0.0, 1, 6.28319] +operator = 3 + +[sub_resource type="VisualShaderNodeFloatParameter" id="23"] +parameter_name = "value" + +[sub_resource type="VisualShaderNodeFloatOp" id="24"] +output_port_for_preview = 0 +operator = 1 + +[sub_resource type="VisualShaderNodeFloatOp" id="25"] +output_port_for_preview = 0 +operator = 3 + +[sub_resource type="VisualShaderNodeFloatOp" id="26"] +output_port_for_preview = 0 +operator = 6 + +[sub_resource type="VisualShaderNodeInput" id="4"] +output_port_for_preview = 0 +input_name = "uv" + +[sub_resource type="VisualShaderNodeFloatOp" id="27"] +default_input_values = [0, 0.0, 1, 6.28319] +operator = 3 + +[sub_resource type="VisualShaderNodeVectorOp" id="5"] +output_port_for_preview = 0 +default_input_values = [0, Vector3(0, 0, 0), 1, Vector3(2, 2, 0)] +operator = 2 + +[sub_resource type="VisualShaderNodeVectorOp" id="6"] +output_port_for_preview = 0 +default_input_values = [0, Vector3(0, 0, 0), 1, Vector3(-1, -1, 0)] + +[sub_resource type="VisualShaderNodeVectorLen" id="7"] +output_port_for_preview = 0 + +[sub_resource type="VisualShaderNodeFloatOp" id="8"] +output_port_for_preview = 0 +operator = 1 + +[sub_resource type="VisualShaderNodeFloatParameter" id="9"] +parameter_name = "radius" + +[sub_resource type="VisualShaderNodeFloatFunc" id="10"] +output_port_for_preview = 0 +function = 12 + +[resource] +code = "shader_type spatial; +render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_schlick_ggx, depth_test_disabled, unshaded; + +uniform vec4 albedo : source_color; +uniform float value; +uniform float fade; +uniform float radius; +uniform float width; + + + +void fragment() { +// ColorParameter:2 + vec4 n_out2p0 = albedo; + + +// Input:3 + vec2 n_out3p0 = UV; + + +// VectorOp:4 + vec3 n_in4p1 = vec3(2.00000, 2.00000, 0.00000); + vec3 n_out4p0 = vec3(n_out3p0, 0.0) * n_in4p1; + + +// VectorOp:5 + vec3 n_in5p1 = vec3(-1.00000, -1.00000, 0.00000); + vec3 n_out5p0 = n_out4p0 + n_in5p1; + + +// VectorFunc:17 + vec3 n_out17p0 = normalize(n_out5p0); + + +// VectorOp:19 + vec3 n_in19p1 = vec3(0.00000, -1.00000, 0.00000); + vec3 n_out19p0 = cross(n_out17p0, n_in19p1); + + +// VectorDecompose:20 + float n_out20p0 = n_out19p0.x; + float n_out20p1 = n_out19p0.y; + float n_out20p2 = n_out19p0.z; + + +// DotProduct:18 + vec3 n_in18p1 = vec3(0.00000, -1.00000, 0.00000); + float n_out18p0 = dot(n_out17p0, n_in18p1); + + +// FloatFunc:24 + float n_out24p0 = acos(n_out18p0); + + +// FloatOp:23 + float n_in23p0 = 6.28319; + float n_out23p0 = n_in23p0 - n_out24p0; + + + vec3 n_out22p0; +// If:22 + float n_in22p1 = 0.00000; + float n_in22p2 = 0.00001; + if(abs(n_out20p2 - n_in22p1) < n_in22p2) + { + n_out22p0 = vec3(n_out24p0); + } + else if(n_out20p2 < n_in22p1) + { + n_out22p0 = vec3(n_out24p0); + } + else + { + n_out22p0 = vec3(n_out23p0); + } + + +// FloatOp:25 + float n_in25p1 = 6.28319; + float n_out25p0 = n_out22p0.x / n_in25p1; + + +// FloatParameter:26 + float n_out26p0 = value; + + +// FloatOp:27 + float n_out27p0 = n_out25p0 - n_out26p0; + + +// FloatParameter:14 + float n_out14p0 = fade; + + +// FloatOp:30 + float n_in30p1 = 6.28319; + float n_out30p0 = n_out14p0 / n_in30p1; + + +// FloatOp:28 + float n_out28p0 = n_out27p0 / n_out30p0; + + +// VectorLen:6 + float n_out6p0 = length(n_out5p0); + + +// FloatParameter:8 + float n_out8p0 = radius; + + +// FloatOp:7 + float n_out7p0 = n_out6p0 - n_out8p0; + + +// FloatFunc:9 + float n_out9p0 = abs(n_out7p0); + + +// FloatParameter:11 + float n_out11p0 = width; + + +// FloatOp:15 + float n_in15p1 = 2.00000; + float n_out15p0 = n_out11p0 / n_in15p1; + + +// FloatOp:13 + float n_out13p0 = n_out9p0 - n_out15p0; + + +// FloatOp:10 + float n_out10p0 = n_out13p0 / n_out14p0; + + +// FloatOp:29 + float n_out29p0 = max(n_out28p0, n_out10p0); + + +// FloatOp:12 + float n_in12p0 = 1.00000; + float n_out12p0 = n_in12p0 - n_out29p0; + + +// Output:0 + ALBEDO = vec3(n_out2p0.xyz); + ALPHA = n_out12p0; + + +} +" +flags/depth_test_disabled = true +flags/unshaded = true +nodes/fragment/0/position = Vector2(1800, -40) +nodes/fragment/2/node = SubResource("3") +nodes/fragment/2/position = Vector2(1480, -200) +nodes/fragment/3/node = SubResource("4") +nodes/fragment/3/position = Vector2(-220, 200) +nodes/fragment/4/node = SubResource("5") +nodes/fragment/4/position = Vector2(-20, 200) +nodes/fragment/5/node = SubResource("6") +nodes/fragment/5/position = Vector2(180, 200) +nodes/fragment/6/node = SubResource("7") +nodes/fragment/6/position = Vector2(380, 200) +nodes/fragment/7/node = SubResource("8") +nodes/fragment/7/position = Vector2(580, 200) +nodes/fragment/8/node = SubResource("9") +nodes/fragment/8/position = Vector2(260, 440) +nodes/fragment/9/node = SubResource("10") +nodes/fragment/9/position = Vector2(780, 200) +nodes/fragment/10/node = SubResource("1") +nodes/fragment/10/position = Vector2(1200, 200) +nodes/fragment/11/node = SubResource("2") +nodes/fragment/11/position = Vector2(260, 600) +nodes/fragment/12/node = SubResource("11") +nodes/fragment/12/position = Vector2(1600, 60) +nodes/fragment/13/node = SubResource("12") +nodes/fragment/13/position = Vector2(1000, 200) +nodes/fragment/14/node = SubResource("13") +nodes/fragment/14/position = Vector2(260, 780) +nodes/fragment/15/node = SubResource("14") +nodes/fragment/15/position = Vector2(560, 600) +nodes/fragment/17/node = SubResource("15") +nodes/fragment/17/position = Vector2(-380, -100) +nodes/fragment/18/node = SubResource("16") +nodes/fragment/18/position = Vector2(-120, -40) +nodes/fragment/19/node = SubResource("17") +nodes/fragment/19/position = Vector2(-120, -180) +nodes/fragment/20/node = SubResource("18") +nodes/fragment/20/position = Vector2(60, -180) +nodes/fragment/22/node = SubResource("19") +nodes/fragment/22/position = Vector2(620, -100) +nodes/fragment/23/node = SubResource("20") +nodes/fragment/23/position = Vector2(360, 40) +nodes/fragment/24/node = SubResource("21") +nodes/fragment/24/position = Vector2(60, -40) +nodes/fragment/25/node = SubResource("22") +nodes/fragment/25/position = Vector2(800, -100) +nodes/fragment/26/node = SubResource("23") +nodes/fragment/26/position = Vector2(660, -360) +nodes/fragment/27/node = SubResource("24") +nodes/fragment/27/position = Vector2(1000, -100) +nodes/fragment/28/node = SubResource("25") +nodes/fragment/28/position = Vector2(1200, -100) +nodes/fragment/29/node = SubResource("26") +nodes/fragment/29/position = Vector2(1400, 60) +nodes/fragment/30/node = SubResource("27") +nodes/fragment/30/position = Vector2(1000, -240) +nodes/fragment/connections = PackedInt32Array(2, 0, 0, 0, 3, 0, 4, 0, 4, 0, 5, 0, 5, 0, 6, 0, 6, 0, 7, 0, 8, 0, 7, 1, 7, 0, 9, 0, 12, 0, 0, 1, 9, 0, 13, 0, 13, 0, 10, 0, 14, 0, 10, 1, 11, 0, 15, 0, 15, 0, 13, 1, 5, 0, 17, 0, 17, 0, 18, 0, 17, 0, 19, 0, 19, 0, 20, 0, 18, 0, 24, 0, 24, 0, 23, 1, 22, 0, 25, 0, 20, 2, 22, 0, 24, 0, 22, 3, 23, 0, 22, 4, 24, 0, 22, 5, 25, 0, 27, 0, 26, 0, 27, 1, 27, 0, 28, 0, 28, 0, 29, 0, 10, 0, 29, 1, 29, 0, 12, 1, 14, 0, 30, 0, 30, 0, 28, 1) diff --git a/scenes/main_menu/main_menu_level.tscn b/scenes/main_menu/main_menu_level.tscn index a4dfa4da..f0c5d6ec 100644 --- a/scenes/main_menu/main_menu_level.tscn +++ b/scenes/main_menu/main_menu_level.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=53 format=3 uid="uid://037lluf8eoy6"] +[gd_scene load_steps=54 format=3 uid="uid://037lluf8eoy6"] [ext_resource type="PackedScene" uid="uid://qbmx03iibuuu" path="res://addons/godot-xr-tools/staging/scene_base.tscn" id="1"] [ext_resource type="Script" path="res://scenes/main_menu/main_menu_level.gd" id="2_taoax"] [ext_resource type="PackedScene" uid="uid://b228p8k6sonve" path="res://addons/godot-xr-tools/player/fade/fade_collision.tscn" id="3_ocaqi"] +[ext_resource type="PackedScene" uid="uid://do1wif8rpqtwj" path="res://addons/godot-xr-tools/functions/function_gaze_pointer.tscn" id="4_b4cul"] [ext_resource type="PackedScene" uid="uid://bjcxf427un2wp" path="res://addons/godot-xr-tools/player/poke/poke.tscn" id="4_eoo0b"] [ext_resource type="PackedScene" uid="uid://42xbeno6pt3y" path="res://addons/godot-xr-tools/desktop-support/function_desktop_pointer.tscn" id="4_ru24x"] [ext_resource type="PackedScene" uid="uid://b6bk2pj8vbj28" path="res://addons/godot-xr-tools/functions/movement_turn.tscn" id="5"] @@ -41,65 +42,65 @@ [ext_resource type="Texture2D" uid="uid://cr1l4g7btdyht" path="res://scenes/origin_gravity_demo/origin_gravity_demo.png" id="32_c4n1q"] [ext_resource type="Texture2D" uid="uid://dhd30j0xpcxoi" path="res://scenes/sphere_world_demo/sphere_world_demo.png" id="34_xw8ig"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_sj2ko"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vj83u"] animation = &"Grip" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6aaih"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_wyexy"] animation = &"Grip" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_brcrv"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_ddwb8"] 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_248ms"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_jb6pp"] animation = &"Grip 5" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_2gkw7"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_ul4yl"] 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_mh5hs"] +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_o0q24"] graph_offset = Vector2(-536, 11) -nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_sj2ko") +nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_vj83u") nodes/ClosedHand1/position = Vector2(-600, 300) -nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_6aaih") +nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_wyexy") nodes/ClosedHand2/position = Vector2(-360, 300) -nodes/Grip/node = SubResource("AnimationNodeBlend2_brcrv") +nodes/Grip/node = SubResource("AnimationNodeBlend2_ddwb8") nodes/Grip/position = Vector2(0, 20) -nodes/OpenHand/node = SubResource("AnimationNodeAnimation_248ms") +nodes/OpenHand/node = SubResource("AnimationNodeAnimation_jb6pp") nodes/OpenHand/position = Vector2(-600, 100) -nodes/Trigger/node = SubResource("AnimationNodeBlend2_2gkw7") +nodes/Trigger/node = SubResource("AnimationNodeBlend2_ul4yl") nodes/Trigger/position = Vector2(-360, 20) node_connections = [&"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1", &"output", 0, &"Grip"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_s4vic"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6o27q"] animation = &"Grip" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_70e5h"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_y6awy"] animation = &"Grip" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_6pk6s"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_a4xth"] filter_enabled = true filters = ["Armature/Skeleton3D:Little_Distal_R", "Armature/Skeleton3D:Little_Intermediate_R", "Armature/Skeleton3D:Little_Metacarpal_R", "Armature/Skeleton3D:Little_Proximal_R", "Armature/Skeleton3D:Middle_Distal_R", "Armature/Skeleton3D:Middle_Intermediate_R", "Armature/Skeleton3D:Middle_Metacarpal_R", "Armature/Skeleton3D:Middle_Proximal_R", "Armature/Skeleton3D:Ring_Distal_R", "Armature/Skeleton3D:Ring_Intermediate_R", "Armature/Skeleton3D:Ring_Metacarpal_R", "Armature/Skeleton3D:Ring_Proximal_R", "Armature/Skeleton3D:Thumb_Distal_R", "Armature/Skeleton3D:Thumb_Metacarpal_R", "Armature/Skeleton3D:Thumb_Proximal_R", "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_85bwh"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_x86ld"] animation = &"Grip 5" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_uijff"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_jlv0k"] filter_enabled = true filters = ["Armature/Skeleton3D:Index_Distal_R", "Armature/Skeleton3D:Index_Intermediate_R", "Armature/Skeleton3D:Index_Metacarpal_R", "Armature/Skeleton3D:Index_Proximal_R", "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R"] -[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_nh6hc"] +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_gnohk"] graph_offset = Vector2(-552.664, 107.301) -nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_s4vic") +nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_6o27q") nodes/ClosedHand1/position = Vector2(-600, 300) -nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_70e5h") +nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_y6awy") nodes/ClosedHand2/position = Vector2(-360, 300) -nodes/Grip/node = SubResource("AnimationNodeBlend2_6pk6s") +nodes/Grip/node = SubResource("AnimationNodeBlend2_a4xth") nodes/Grip/position = Vector2(0, 40) -nodes/OpenHand/node = SubResource("AnimationNodeAnimation_85bwh") +nodes/OpenHand/node = SubResource("AnimationNodeAnimation_x86ld") nodes/OpenHand/position = Vector2(-600, 100) -nodes/Trigger/node = SubResource("AnimationNodeBlend2_uijff") +nodes/Trigger/node = SubResource("AnimationNodeBlend2_jlv0k") nodes/Trigger/position = Vector2(-360, 40) node_connections = [&"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1", &"output", 0, &"Grip"] @@ -108,9 +109,13 @@ script = ExtResource("2_taoax") [node name="FadeCollision" parent="XROrigin3D/XRCamera3D" index="0" instance=ExtResource("3_ocaqi")] -[node name="FunctionDesktopPointer" parent="XROrigin3D/XRCamera3D" index="1" instance=ExtResource("4_ru24x")] +[node name="FunctionGazePointer" parent="XROrigin3D/XRCamera3D" index="1" instance=ExtResource("4_b4cul")] +click_on_hold = true +color = Color(1, 0, 1, 1) -[node name="Vignette" parent="XROrigin3D/XRCamera3D" index="2" instance=ExtResource("5_wwfro")] +[node name="FunctionDesktopPointer" parent="XROrigin3D/XRCamera3D" index="2" instance=ExtResource("4_ru24x")] + +[node name="Vignette" parent="XROrigin3D/XRCamera3D" index="3" instance=ExtResource("5_wwfro")] auto_inner_radius = 0.5 [node name="LeftHand" parent="XROrigin3D/LeftHand" index="0" instance=ExtResource("23_pr05t")] @@ -146,7 +151,7 @@ transform = Transform3D(0.999999, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) [node name="AnimationTree" parent="XROrigin3D/LeftHand/LeftHand" index="1"] root_node = NodePath("../Hand_low_L") -tree_root = SubResource("AnimationNodeBlendTree_mh5hs") +tree_root = SubResource("AnimationNodeBlendTree_o0q24") [node name="FunctionPoseDetector" parent="XROrigin3D/LeftHand" index="1" instance=ExtResource("5_xgcrx")] @@ -193,7 +198,7 @@ transform = Transform3D(0.999999, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) [node name="AnimationTree" parent="XROrigin3D/RightHand/RightHand" index="1"] root_node = NodePath("../Hand_low_R") -tree_root = SubResource("AnimationNodeBlendTree_nh6hc") +tree_root = SubResource("AnimationNodeBlendTree_gnohk") [node name="FunctionPoseDetector" parent="XROrigin3D/RightHand" index="1" instance=ExtResource("5_xgcrx")] diff --git a/scenes/pointer_demo/pointer_demo.tscn b/scenes/pointer_demo/pointer_demo.tscn index 3b4f1fd7..8e2df9ca 100644 --- a/scenes/pointer_demo/pointer_demo.tscn +++ b/scenes/pointer_demo/pointer_demo.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=34 format=3 uid="uid://bfw18y0j2blo4"] +[gd_scene load_steps=35 format=3 uid="uid://bfw18y0j2blo4"] [ext_resource type="PackedScene" uid="uid://qbmx03iibuuu" path="res://addons/godot-xr-tools/staging/scene_base.tscn" id="1"] [ext_resource type="PackedScene" uid="uid://3a6wjr3a13vd" path="res://assets/meshes/teleport/teleport.tscn" id="2"] [ext_resource type="Script" path="res://scenes/demo_scene_base.gd" id="2_pbiwr"] +[ext_resource type="PackedScene" uid="uid://do1wif8rpqtwj" path="res://addons/godot-xr-tools/functions/function_gaze_pointer.tscn" id="3_c8d7e"] [ext_resource type="PackedScene" uid="uid://b4kad2kuba1yn" path="res://addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn" id="3_j5kt2"] [ext_resource type="Texture2D" uid="uid://ckw6nliyayo6a" path="res://scenes/main_menu/return to main menu.png" id="4"] [ext_resource type="PackedScene" uid="uid://bjcxf427un2wp" path="res://addons/godot-xr-tools/player/poke/poke.tscn" id="4_6fs7c"] @@ -22,71 +23,75 @@ [ext_resource type="PackedScene" uid="uid://ct3p5sgwvkmva" path="res://assets/meshes/control_pad/control_pad.tscn" id="12_yae1p"] [ext_resource type="PackedScene" uid="uid://bk34216s7eynw" path="res://scenes/pointer_demo/objects/color_change_cube.tscn" id="15"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8hr6n"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_52604"] animation = &"Grip" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ybqq3"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_y82s1"] animation = &"Grip" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_yf56w"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_17ope"] 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_c2siu"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_f44mv"] animation = &"Grip 5" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_tw4wh"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_p755d"] 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_4l1td"] +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_phxai"] graph_offset = Vector2(-536, 11) -nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_8hr6n") +nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_52604") nodes/ClosedHand1/position = Vector2(-600, 300) -nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_ybqq3") +nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_y82s1") nodes/ClosedHand2/position = Vector2(-360, 300) -nodes/Grip/node = SubResource("AnimationNodeBlend2_yf56w") +nodes/Grip/node = SubResource("AnimationNodeBlend2_17ope") nodes/Grip/position = Vector2(0, 20) -nodes/OpenHand/node = SubResource("AnimationNodeAnimation_c2siu") +nodes/OpenHand/node = SubResource("AnimationNodeAnimation_f44mv") nodes/OpenHand/position = Vector2(-600, 100) -nodes/Trigger/node = SubResource("AnimationNodeBlend2_tw4wh") +nodes/Trigger/node = SubResource("AnimationNodeBlend2_p755d") nodes/Trigger/position = Vector2(-360, 20) node_connections = [&"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1", &"output", 0, &"Grip"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_e5hqe"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_w3q17"] animation = &"Grip" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_3sod0"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_858io"] animation = &"Grip" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_ennjd"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_jqj0l"] filter_enabled = true filters = ["Armature/Skeleton3D:Little_Distal_R", "Armature/Skeleton3D:Little_Intermediate_R", "Armature/Skeleton3D:Little_Metacarpal_R", "Armature/Skeleton3D:Little_Proximal_R", "Armature/Skeleton3D:Middle_Distal_R", "Armature/Skeleton3D:Middle_Intermediate_R", "Armature/Skeleton3D:Middle_Metacarpal_R", "Armature/Skeleton3D:Middle_Proximal_R", "Armature/Skeleton3D:Ring_Distal_R", "Armature/Skeleton3D:Ring_Intermediate_R", "Armature/Skeleton3D:Ring_Metacarpal_R", "Armature/Skeleton3D:Ring_Proximal_R", "Armature/Skeleton3D:Thumb_Distal_R", "Armature/Skeleton3D:Thumb_Metacarpal_R", "Armature/Skeleton3D:Thumb_Proximal_R", "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_xnghj"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ski4q"] animation = &"Grip 5" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_umwmp"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_1lh7b"] filter_enabled = true filters = ["Armature/Skeleton3D:Index_Distal_R", "Armature/Skeleton3D:Index_Intermediate_R", "Armature/Skeleton3D:Index_Metacarpal_R", "Armature/Skeleton3D:Index_Proximal_R", "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R"] -[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_ylpnl"] +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_sve7d"] graph_offset = Vector2(-552.664, 107.301) -nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_e5hqe") +nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_w3q17") nodes/ClosedHand1/position = Vector2(-600, 300) -nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_3sod0") +nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_858io") nodes/ClosedHand2/position = Vector2(-360, 300) -nodes/Grip/node = SubResource("AnimationNodeBlend2_ennjd") +nodes/Grip/node = SubResource("AnimationNodeBlend2_jqj0l") nodes/Grip/position = Vector2(0, 40) -nodes/OpenHand/node = SubResource("AnimationNodeAnimation_xnghj") +nodes/OpenHand/node = SubResource("AnimationNodeAnimation_ski4q") nodes/OpenHand/position = Vector2(-600, 100) -nodes/Trigger/node = SubResource("AnimationNodeBlend2_umwmp") +nodes/Trigger/node = SubResource("AnimationNodeBlend2_1lh7b") nodes/Trigger/position = Vector2(-360, 40) node_connections = [&"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1", &"output", 0, &"Grip"] [node name="PointerDemo" instance=ExtResource("1")] script = ExtResource("2_pbiwr") +[node name="FunctionGazePointer" parent="XROrigin3D/XRCamera3D" index="0" instance=ExtResource("3_c8d7e")] +click_on_hold = true +color = Color(1, 0, 1, 1) + [node name="LeftHand" parent="XROrigin3D/LeftHand" index="0" instance=ExtResource("3_j5kt2")] [node name="Skeleton3D" parent="XROrigin3D/LeftHand/LeftHand/Hand_Nails_low_L/Armature" index="0"] @@ -121,7 +126,8 @@ mask = 4194304 push_bodies = false [node name="AnimationTree" parent="XROrigin3D/LeftHand/LeftHand" index="1"] -tree_root = SubResource("AnimationNodeBlendTree_4l1td") +root_node = NodePath("../Hand_Nails_low_L") +tree_root = SubResource("AnimationNodeBlendTree_phxai") [node name="MovementDirect" parent="XROrigin3D/LeftHand" index="1" instance=ExtResource("7")] strafe = true @@ -171,7 +177,8 @@ mask = 4194304 push_bodies = false [node name="AnimationTree" parent="XROrigin3D/RightHand/RightHand" index="1"] -tree_root = SubResource("AnimationNodeBlendTree_ylpnl") +root_node = NodePath("../Hand_Nails_low_R") +tree_root = SubResource("AnimationNodeBlendTree_sve7d") [node name="MovementDirect" parent="XROrigin3D/RightHand" index="1" instance=ExtResource("7")] @@ -196,15 +203,16 @@ target_material = ExtResource("10_fxi5i") [node name="Teleport" parent="." index="2" instance=ExtResource("2")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4) -scene_base = NodePath("..") title = ExtResource("4") [node name="Display" parent="." index="3" instance=ExtResource("12")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, -3) +scene_properties_keys = PackedStringArray("keyboard_test_screen.gd") [node name="VirtualKeyboard" parent="." index="4" instance=ExtResource("11")] transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 0.9, -2) screen_size = Vector2(0.5, 0.244) +scene_properties_keys = PackedStringArray("virtual_keyboard_2d.gd") [node name="ColorChangeCube1" parent="." index="5" instance=ExtResource("15")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 2.5, -3)