Skip to content

Commit

Permalink
Merge pull request #20 from gatlanit/NitinDev
Browse files Browse the repository at this point in the history
Added a bunch of enhancements
  • Loading branch information
gatlanit authored Oct 7, 2024
2 parents 9f1f089 + 9e53882 commit 73204c4
Show file tree
Hide file tree
Showing 16 changed files with 171 additions and 60 deletions.
24 changes: 12 additions & 12 deletions addons/godot-xr-tools/hands/scenes/lowpoly/left_fullglove_low.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
[ext_resource type="Resource" uid="uid://dertgu7k8alls" path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" id="3_wyae6"]
[ext_resource type="AnimationNodeBlendTree" uid="uid://dl8yf7ipqotd1" path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" id="5"]

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_gnqoa"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_boqlj"]
animation = &"Grip"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_uae3a"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_mi6lp"]
animation = &"Grip"

[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_cjp7y"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_te0b2"]
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_dt3mk"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5ypxp"]
animation = &"Grip 5"

[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_4fx2c"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_st614"]
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_feydw"]
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_tl8dy"]
graph_offset = Vector2(-536, 11)
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_gnqoa")
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_boqlj")
nodes/ClosedHand1/position = Vector2(-600, 300)
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_uae3a")
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_mi6lp")
nodes/ClosedHand2/position = Vector2(-360, 300)
nodes/Grip/node = SubResource("AnimationNodeBlend2_cjp7y")
nodes/Grip/node = SubResource("AnimationNodeBlend2_te0b2")
nodes/Grip/position = Vector2(0, 20)
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_dt3mk")
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_5ypxp")
nodes/OpenHand/position = Vector2(-600, 100)
nodes/Trigger/node = SubResource("AnimationNodeBlend2_4fx2c")
nodes/Trigger/node = SubResource("AnimationNodeBlend2_st614")
nodes/Trigger/position = Vector2(-360, 20)
node_connections = [&"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1", &"output", 0, &"Grip"]

Expand Down Expand Up @@ -70,7 +70,7 @@ bones/23/rotation = Quaternion(0.00687177, -0.00357275, -0.211953, 0.977249)

[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath("../Hand_low_L")
tree_root = SubResource("AnimationNodeBlendTree_feydw")
tree_root = SubResource("AnimationNodeBlendTree_tl8dy")
anim_player = NodePath("../Hand_low_L/AnimationPlayer")
parameters/Grip/blend_amount = 0.0
parameters/Trigger/blend_amount = 0.0
Expand Down
24 changes: 12 additions & 12 deletions addons/godot-xr-tools/hands/scenes/lowpoly/right_fullglove_low.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
[ext_resource type="Script" path="res://addons/godot-xr-tools/hands/hand.gd" id="4"]
[ext_resource type="AnimationNodeBlendTree" uid="uid://m85b1gogdums" path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" id="6"]

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_y5f0n"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_i7cnd"]
animation = &"Grip"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_s5jfd"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_op177"]
animation = &"Grip"

[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_c67s5"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_ex0e6"]
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_p458p"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_avi0n"]
animation = &"Grip 5"

[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_5g3qd"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_fa0wq"]
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_e6y78"]
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_o3fch"]
graph_offset = Vector2(-552.664, 107.301)
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_y5f0n")
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_i7cnd")
nodes/ClosedHand1/position = Vector2(-600, 300)
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_s5jfd")
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_op177")
nodes/ClosedHand2/position = Vector2(-360, 300)
nodes/Grip/node = SubResource("AnimationNodeBlend2_c67s5")
nodes/Grip/node = SubResource("AnimationNodeBlend2_ex0e6")
nodes/Grip/position = Vector2(0, 40)
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_p458p")
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_avi0n")
nodes/OpenHand/position = Vector2(-600, 100)
nodes/Trigger/node = SubResource("AnimationNodeBlend2_5g3qd")
nodes/Trigger/node = SubResource("AnimationNodeBlend2_fa0wq")
nodes/Trigger/position = Vector2(-360, 40)
node_connections = [&"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1", &"output", 0, &"Grip"]

Expand Down Expand Up @@ -70,7 +70,7 @@ bones/23/rotation = Quaternion(0.00687177, 0.00357275, 0.211953, 0.977249)

[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath("../Hand_low_R")
tree_root = SubResource("AnimationNodeBlendTree_e6y78")
tree_root = SubResource("AnimationNodeBlendTree_o3fch")
anim_player = NodePath("../Hand_low_R/AnimationPlayer")
parameters/Grip/blend_amount = 0.0
parameters/Trigger/blend_amount = 0.0
Expand Down
Binary file added assets/audio/lowRoar.wav
Binary file not shown.
24 changes: 24 additions & 0 deletions assets/audio/lowRoar.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[remap]

importer="wav"
type="AudioStreamWAV"
uid="uid://b8b52jn2l67et"
path="res://.godot/imported/lowRoar.wav-311e4226cc2fc240dcf0ec61d8028f75.sample"

[deps]

source_file="res://assets/audio/lowRoar.wav"
dest_files=["res://.godot/imported/lowRoar.wav-311e4226cc2fc240dcf0ec61d8028f75.sample"]

[params]

force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
File renamed without changes
6 changes: 3 additions & 3 deletions icon.svg.import → assets/textures/icon.svg.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b4hgljiomvgtr"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
path="res://.godot/imported/icon.svg-958a189a5c2fe57391e3d9b3ea181aa4.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
source_file="res://assets/textures/icon.svg"
dest_files=["res://.godot/imported/icon.svg-958a189a5c2fe57391e3d9b3ea181aa4.ctex"]

[params]

Expand Down
4 changes: 2 additions & 2 deletions export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../Desktop/releases/Dev/Crystal Bridges Experience.apk"
export_path="../Desktop/releases/Snapshot Finale/Crystal Bridges Experience.apk"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
Expand Down Expand Up @@ -42,7 +42,7 @@ package/exclude_from_recents=false
package/show_in_android_tv=false
package/show_in_app_library=true
package/show_as_launcher_app=false
launcher_icons/main_192x192=""
launcher_icons/main_192x192="res://icon.png"
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
graphics/opengl_debug=false
Expand Down
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cqmuvnxg460uj"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
4 changes: 3 additions & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ config_version=5
config/name="Crystal Bridges Experience"
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
config/icon="res://icon.svg"
boot_splash/bg_color=Color(0, 0, 0, 1)
boot_splash/image="res://icon.png"
config/icon="res://icon.png"

[autoload]

Expand Down
26 changes: 10 additions & 16 deletions scenes/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[ext_resource type="Script" path="res://scenes/scripts/main.gd" id="1_l4pqy"]
[ext_resource type="PackedScene" uid="uid://clc5dre31iskm" path="res://addons/godot-xr-tools/xr/start_xr.tscn" id="2_aig0f"]
[ext_resource type="PackedScene" uid="uid://b5b2bb5n5csv5" path="res://scenes/player.tscn" id="3_kd12i"]
[ext_resource type="AudioStream" uid="uid://b8b52jn2l67et" path="res://assets/audio/lowRoar.wav" id="5_iwmk5"]

[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ayq3e"]
sky_horizon_color = Color(0.6363, 0.646984, 0.663357, 1)
Expand All @@ -20,20 +21,6 @@ tonemap_mode = 2
fog_mode = 1
fog_density = 1.0

[sub_resource type="GDScript" id="GDScript_6fows"]
script/source = "extends XROrigin3D


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
"

[node name="Main" type="Node3D"]
script = ExtResource("1_l4pqy")

Expand All @@ -45,9 +32,16 @@ shadow_enabled = true
environment = SubResource("Environment_0h2sb")

[node name="Museum" parent="." instance=ExtResource("1_bnt0x")]
transform = Transform3D(0.015, 0, 0, 0, 0.015, 0, 0, 0, 0.015, 0, -0.1, 0)

[node name="StartXR" parent="." instance=ExtResource("2_aig0f")]

[node name="Player" parent="." instance=ExtResource("3_kd12i")]
script = SubResource("GDScript_6fows")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, 0)

[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource("5_iwmk5")

[connection signal="bButton" from="Player" to="." method="_on_player_b_button"]
[connection signal="thumbVecL" from="Player" to="." method="_on_player_thumb_vec_l"]
[connection signal="thumbVecR" from="Player" to="." method="_on_player_thumb_vec_r"]
[connection signal="yButton" from="Player" to="." method="_on_player_y_button"]
14 changes: 13 additions & 1 deletion scenes/museum.tscn
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
[gd_scene load_steps=4 format=3 uid="uid://2ju31kvpsco2"]
[gd_scene load_steps=6 format=3 uid="uid://2ju31kvpsco2"]

[ext_resource type="Texture2D" uid="uid://tyyttj30dscd" path="res://assets/textures/CBMAAbuildingOBJ-150K_u1_v1-2.png" id="1_pkhsg"]
[ext_resource type="Script" path="res://scenes/scripts/museum.gd" id="1_xfjmg"]
[ext_resource type="ArrayMesh" uid="uid://c6x4k4cc5e0us" path="res://assets/musuem.obj" id="2_o3x0p"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_m0dr2"]
albedo_texture = ExtResource("1_pkhsg")
metallic_specular = 0.0

[sub_resource type="BoxShape3D" id="BoxShape3D_v8rbu"]
size = Vector3(2.12674, 0.572723, 3.18872)

[node name="Museum" type="Node3D"]
script = ExtResource("1_xfjmg")

[node name="Musuem" type="MeshInstance3D" parent="."]
transform = Transform3D(0.015, 0, 0, 0, 0.015, 0, 0, 0, 0.015, 0, 0, 0)
material_override = SubResource("StandardMaterial3D_m0dr2")
mesh = ExtResource("2_o3x0p")

[node name="Area3D" type="Area3D" parent="."]

[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0607758, 0.000457913, 0.00182438)
shape = SubResource("BoxShape3D_v8rbu")
2 changes: 2 additions & 0 deletions scenes/player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ tracker = &"right_hand"
[node name="AutoHandtracker" parent="RightHand" instance=ExtResource("2_a0ncu")]

[connection signal="button_pressed" from="LeftHand" to="." method="_on_left_hand_button_pressed"]
[connection signal="input_vector2_changed" from="LeftHand" to="." method="_on_left_hand_input_vector_2_changed"]
[connection signal="button_pressed" from="RightHand" to="." method="_on_right_hand_button_pressed"]
[connection signal="input_vector2_changed" from="RightHand" to="." method="_on_right_hand_input_vector_2_changed"]
38 changes: 37 additions & 1 deletion scenes/scripts/main.gd
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
extends Node3D

@onready var stream = $AudioStreamPlayer3D
@onready var model = $Museum

var move_speed: float = 1.5 # Speed of movement

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
enable_passthrough()

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
func _process(_delta: float) -> void:
pass

# Passthrough
Expand All @@ -23,3 +28,34 @@ func enable_passthrough() -> bool:

get_viewport().transparent_bg = true
return true

# Buttons

# Thumbstick
func _on_player_thumb_vec_l(_name: String, value: Vector2) -> void:
var rotateAmt = value.x * move_speed * get_process_delta_time()
model.rotate_y(-rotateAmt)

func _on_player_thumb_vec_r(_name: String, value: Vector2) -> void:
# How much to move based on y component of vector, speed, and delta
var upDownAmt = value.y * move_speed * get_process_delta_time()

# Create new y value
var new_y = model.global_transform.origin.y + upDownAmt

# Y value between 0 and 1 (no modulo because x/0 = undefined)
new_y = clamp(new_y, 0.0, 1.0)

# Update model y position with y value
var new_transform = model.global_transform
new_transform.origin.y = new_y
model.global_transform = new_transform


func _on_player_b_button() -> void:
if !stream.playing:
stream.play()

func _on_player_y_button() -> void:
if stream.playing:
stream.stop()
1 change: 1 addition & 0 deletions scenes/scripts/museum.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends Node3D
30 changes: 18 additions & 12 deletions scenes/scripts/player.gd
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
extends XROrigin3D

# Do all controller specific things here
signal bButton
signal yButton

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

signal thumbVecL(name: String, value: Vector2)
signal thumbVecR(name: String, value: Vector2)

# Left buttons (click)
func _on_left_hand_button_pressed(name: String) -> void:
pass # Replace with function body.

if name == "ax_button":
yButton.emit()

# Right buttons (click)
func _on_right_hand_button_pressed(name: String) -> void:
pass # Replace with function body.
if name == "by_button":
bButton.emit()

# Left buttons (Vector2)
func _on_left_hand_input_vector_2_changed(name: String, value: Vector2) -> void:
thumbVecL.emit(name, value)

# Right buttons (Vector2)
func _on_right_hand_input_vector_2_changed(name: String, value: Vector2) -> void:
thumbVecR.emit(name, value)

0 comments on commit 73204c4

Please sign in to comment.