Merge pull request #149 from Nitwel/imp2
Update to Godot 4.3, add Sound Effects, fix bugs
This commit is contained in:
commit
875424b413
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:59d5063a65a06775814e6a8d0ce94ba11292e6d262fd908d4e9511bd08d3879f
|
||||
size 1545632
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e82ab01c93b949e0ba617774946dcdd7f2706253ee880d90a76e29db5ce742e1
|
||||
size 1421072
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c70e5b762ad7e6a252d05b7942979b6e3fb6ff3954f519ef62de0d9babb5ce35
|
||||
size 1711880
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:32a3af490a43567c353013f5a5d453c0fc415715a91de67931cfde1d608c7064
|
||||
size 1645056
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:726491737bb6a42253fae56d22d51c43b2ca2ee6a0e0b5bc77b18683a388b8c6
|
||||
size 2367488
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0d209ab5f1224b52f0e5c523a26c7dd0be853762c53cd54241eba48cd0148e75
|
||||
size 2343936
|
2
app/addons/godotopenxrvendors/.gitignore
vendored
Normal file
2
app/addons/godotopenxrvendors/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Ignore copies of the binaries Godot makes at startup
|
||||
.bin/windows/*/*/~*.dll
|
|
@ -1,5 +1,16 @@
|
|||
# Change history for the Godot OpenXR loaders asset
|
||||
|
||||
## 3.0.0
|
||||
- Merge GDExtension into a single implementation
|
||||
- Upgrade Android, Gradle, Godot and Kotlin dependencies
|
||||
- Add XR_FB_face_tracking support
|
||||
- Update to OpenXR 1.0.34 headers
|
||||
- Add XR_FB_render_model extension wrapper and OpenXRFBRenderModel node
|
||||
- Add XR_FB_passthrough extension wrapper
|
||||
- Add XR_FB_hand_tracking_mesh extension wrapper and OpenXRFbHandTrackingMesh node
|
||||
- Add XR_FB_hand_tracking_aim support
|
||||
- Update Meta OpenXR mobile SDK to version 62
|
||||
|
||||
## 2.0.3
|
||||
- Migrate the export scripts from gdscript to C++ via gdextension
|
||||
- Manually request eye tracking permission if it's included in the app manifest
|
||||
|
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:26f362bafe639d182bf6f7efb0a9aefc0bebf013980031f7f6ad7f6c5330cd86
|
||||
size 912568
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0f6c924193505d9b73764c1a495f3a41799b4226a22e0a4ef116e0082fe8a9ff
|
||||
size 891368
|
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d884b9973d9c35a3e4080931d66787ed3b925c686118ccfeead281f795cc43ee
|
||||
size 1676800
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8bf90daffe7b97b6f8526af400246806f6c28fc91b0af160f48a98f183363edc
|
||||
size 1682944
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d884b9973d9c35a3e4080931d66787ed3b925c686118ccfeead281f795cc43ee
|
||||
size 1676800
|
|
@ -1,18 +0,0 @@
|
|||
[configuration]
|
||||
|
||||
entry_symbol = "plugin_library_init"
|
||||
compatibility_minimum = "4.2"
|
||||
android_aar_plugin = true
|
||||
|
||||
[libraries]
|
||||
|
||||
android.debug.arm64 = "res://addons/godotopenxrvendors/khronos/.bin/debug/arm64-v8a/libgodotopenxrkhronos.so"
|
||||
android.release.arm64 = "res://addons/godotopenxrvendors/khronos/.bin/release/arm64-v8a/libgodotopenxrkhronos.so"
|
||||
android.debug.x86_64 = "res://addons/godotopenxrvendors/khronos/.bin/debug/x86_64/libgodotopenxrkhronos.so"
|
||||
android.release.x86_64 = "res://addons/godotopenxrvendors/khronos/.bin/release/x86_64/libgodotopenxrkhronos.so"
|
||||
macos.debug = "res://addons/godotopenxrvendors/khronos/.bin/libgodotopenxrkhronos.macos.template_debug.framework"
|
||||
macos.release = "res://addons/godotopenxrvendors/khronos/.bin/libgodotopenxrkhronos.macos.template_release.framework"
|
||||
windows.debug.x86_64 = "res://addons/godotopenxrvendors/khronos/.bin/libgodotopenxrkhronos.windows.template_debug.x86_64.dll"
|
||||
windows.release.x86_64 = "res://addons/godotopenxrvendors/khronos/.bin/libgodotopenxrkhronos.windows.template_release.x86_64.dll"
|
||||
linux.debug.x86_64 = "res://addons/godotopenxrvendors/khronos/.bin/libgodotopenxrkhronos.linux.template_debug.x86_64.so"
|
||||
linux.release.x86_64 = "res://addons/godotopenxrvendors/khronos/.bin/libgodotopenxrkhronos.linux.template_release.x86_64.so"
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2559fb3d21e335f6b69322c499f30152e72d50379d0d659f3ca984e5df8b76e8
|
||||
size 904376
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:18cd089d0f38393962c49bb32681d66be22341cf9bc22bd8a0dd71da391acf91
|
||||
size 883176
|
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:906d6bd4955dacc673f04e542773f88386ab4be7d2d504aed1207c97e7d3922e
|
||||
size 1672704
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cf246430cc976618365cdee9498b352b011acd86d75fdfbda293667c1a0781e5
|
||||
size 1675776
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:906d6bd4955dacc673f04e542773f88386ab4be7d2d504aed1207c97e7d3922e
|
||||
size 1672704
|
|
@ -1,16 +0,0 @@
|
|||
[configuration]
|
||||
|
||||
entry_symbol = "plugin_library_init"
|
||||
compatibility_minimum = "4.2"
|
||||
android_aar_plugin = true
|
||||
|
||||
[libraries]
|
||||
|
||||
android.debug.arm64 = "res://addons/godotopenxrvendors/lynx/.bin/debug/arm64-v8a/libgodotopenxrlynx.so"
|
||||
android.release.arm64 = "res://addons/godotopenxrvendors/lynx/.bin/release/arm64-v8a/libgodotopenxrlynx.so"
|
||||
macos.debug = "res://addons/godotopenxrvendors/lynx/.bin/libgodotopenxrlynx.macos.template_debug.framework"
|
||||
macos.release = "res://addons/godotopenxrvendors/lynx/.bin/libgodotopenxrlynx.macos.template_release.framework"
|
||||
windows.debug.x86_64 = "res://addons/godotopenxrvendors/lynx/.bin/libgodotopenxrlynx.windows.template_debug.x86_64.dll"
|
||||
windows.release.x86_64 = "res://addons/godotopenxrvendors/lynx/.bin/libgodotopenxrlynx.windows.template_release.x86_64.dll"
|
||||
linux.debug.x86_64 = "res://addons/godotopenxrvendors/lynx/.bin/libgodotopenxrlynx.linux.template_debug.x86_64.so"
|
||||
linux.release.x86_64 = "res://addons/godotopenxrvendors/lynx/.bin/libgodotopenxrlynx.linux.template_release.x86_64.so"
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4cbacbc1657bfcb0352b6a8d7abbdcf515ffdd81c0f0413d4aa57fb2007ff581
|
||||
size 1105296
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:304291cbe35cb725e34f23a111b150cb0f5fa3152581412f9b7b3600b1f542e8
|
||||
size 1071624
|
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1a6d5e0e480c32edc33a6fb08ac5e66fd8878499bbe9b9427b53330cfba1fdcd
|
||||
size 1841152
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:31bbebac4bfebc45e47bd00b2c12c52940672712eeedf1d7ef876f111fb1c466
|
||||
size 1840128
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1a6d5e0e480c32edc33a6fb08ac5e66fd8878499bbe9b9427b53330cfba1fdcd
|
||||
size 1841152
|
|
@ -1,16 +0,0 @@
|
|||
[configuration]
|
||||
|
||||
entry_symbol = "plugin_library_init"
|
||||
compatibility_minimum = "4.2"
|
||||
android_aar_plugin = true
|
||||
|
||||
[libraries]
|
||||
|
||||
android.debug.arm64 = "res://addons/godotopenxrvendors/meta/.bin/debug/arm64-v8a/libgodotopenxrmeta.so"
|
||||
android.release.arm64 = "res://addons/godotopenxrvendors/meta/.bin/release/arm64-v8a/libgodotopenxrmeta.so"
|
||||
macos.debug = "res://addons/godotopenxrvendors/meta/.bin/libgodotopenxrmeta.macos.template_debug.framework"
|
||||
macos.release = "res://addons/godotopenxrvendors/meta/.bin/libgodotopenxrmeta.macos.template_release.framework"
|
||||
windows.debug.x86_64 = "res://addons/godotopenxrvendors/meta/.bin/libgodotopenxrmeta.windows.template_debug.x86_64.dll"
|
||||
windows.release.x86_64 = "res://addons/godotopenxrvendors/meta/.bin/libgodotopenxrmeta.windows.template_release.x86_64.dll"
|
||||
linux.debug.x86_64 = "res://addons/godotopenxrvendors/meta/.bin/libgodotopenxrmeta.linux.template_debug.x86_64.so"
|
||||
linux.release.x86_64 = "res://addons/godotopenxrvendors/meta/.bin/libgodotopenxrmeta.linux.template_release.x86_64.so"
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0e4b1ec6b67b7dd1683b6d0b96079b0443946eb6a836f1a372974053aad721a8
|
||||
size 904376
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6b466b78078a8be5de46b0293fb24f90a17ce911e8a0fb010469f084fb5719d3
|
||||
size 883176
|
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f63bc9eac6eef5126e756c3fd168205d859ae96ad9be9ace673ce1ba05fa5d7c
|
||||
size 1672704
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7e58ea69d21c2b234a344bed15228e9f17beb0c8f8ae16d70ecfe3fe8085b2ae
|
||||
size 1675776
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f63bc9eac6eef5126e756c3fd168205d859ae96ad9be9ace673ce1ba05fa5d7c
|
||||
size 1672704
|
|
@ -1,16 +0,0 @@
|
|||
[configuration]
|
||||
|
||||
entry_symbol = "plugin_library_init"
|
||||
compatibility_minimum = "4.2"
|
||||
android_aar_plugin = true
|
||||
|
||||
[libraries]
|
||||
|
||||
android.debug.arm64 = "res://addons/godotopenxrvendors/pico/.bin/debug/arm64-v8a/libgodotopenxrpico.so"
|
||||
android.release.arm64 = "res://addons/godotopenxrvendors/pico/.bin/release/arm64-v8a/libgodotopenxrpico.so"
|
||||
macos.debug = "res://addons/godotopenxrvendors/pico/.bin/libgodotopenxrpico.macos.template_debug.framework"
|
||||
macos.release = "res://addons/godotopenxrvendors/pico/.bin/libgodotopenxrpico.macos.template_release.framework"
|
||||
windows.debug.x86_64 = "res://addons/godotopenxrvendors/pico/.bin/libgodotopenxrpico.windows.template_debug.x86_64.dll"
|
||||
windows.release.x86_64 = "res://addons/godotopenxrvendors/pico/.bin/libgodotopenxrpico.windows.template_release.x86_64.dll"
|
||||
linux.debug.x86_64 = "res://addons/godotopenxrvendors/pico/.bin/libgodotopenxrpico.linux.template_debug.x86_64.so"
|
||||
linux.release.x86_64 = "res://addons/godotopenxrvendors/pico/.bin/libgodotopenxrpico.linux.template_release.x86_64.so"
|
18
app/addons/godotopenxrvendors/plugin.gdextension
Normal file
18
app/addons/godotopenxrvendors/plugin.gdextension
Normal file
|
@ -0,0 +1,18 @@
|
|||
[configuration]
|
||||
|
||||
entry_symbol = "plugin_library_init"
|
||||
compatibility_minimum = "4.3"
|
||||
android_aar_plugin = true
|
||||
|
||||
[libraries]
|
||||
|
||||
android.debug.arm64 = "res://addons/godotopenxrvendors/.bin/android/template_debug/arm64/libgodotopenxrvendors.so"
|
||||
android.release.arm64 = "res://addons/godotopenxrvendors/.bin/android/template_release/arm64/libgodotopenxrvendors.so"
|
||||
android.debug.x86_64 = "res://addons/godotopenxrvendors/.bin/android/template_debug/x86_64/libgodotopenxrvendors.so"
|
||||
android.release.x86_64 = "res://addons/godotopenxrvendors/.bin/android/template_release/x86_64/libgodotopenxrvendors.so"
|
||||
macos.debug = "res://addons/godotopenxrvendors/.bin/macos/template_debug/libgodotopenxrvendors.macos.framework"
|
||||
macos.release = "res://addons/godotopenxrvendors/.bin/macos/template_release/libgodotopenxrvendors.macos.framework"
|
||||
windows.debug.x86_64 = "res://addons/godotopenxrvendors/.bin/windows/template_debug/x86_64/libgodotopenxrvendors.dll"
|
||||
windows.release.x86_64 = "res://addons/godotopenxrvendors/.bin/windows/template_release/x86_64/libgodotopenxrvendors.dll"
|
||||
linux.debug.x86_64 = "res://addons/godotopenxrvendors/.bin/linux/template_debug/x86_64/libgodotopenxrvendors.so"
|
||||
linux.release.x86_64 = "res://addons/godotopenxrvendors/.bin/linux/template_release/x86_64/libgodotopenxrvendors.so"
|
|
@ -64,6 +64,9 @@ static func effect(callback: Callable):
|
|||
if !deconstructor.is_null():
|
||||
deconstructor.call()
|
||||
|
||||
if callback.is_valid() == false:
|
||||
return
|
||||
|
||||
var result=callback.call(_arg)
|
||||
|
||||
if result is Callable:
|
||||
|
|
|
@ -1 +1 @@
|
|||
4.2.2.stable
|
||||
4.3.dev6
|
||||
|
|
|
@ -29,6 +29,7 @@ animation/import=true
|
|||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
fbx/importer=0
|
||||
|
|
|
@ -29,6 +29,7 @@ animation/import=true
|
|||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
fbx/importer=0
|
||||
|
|
BIN
app/assets/sound/analog-appliance-button.mp3
Normal file
BIN
app/assets/sound/analog-appliance-button.mp3
Normal file
Binary file not shown.
19
app/assets/sound/analog-appliance-button.mp3.import
Normal file
19
app/assets/sound/analog-appliance-button.mp3.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://cxhsv4h1q8pm7"
|
||||
path="res://.godot/imported/analog-appliance-button.mp3-3400d402b6dbe616a93c6ce4dfd33aab.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sound/analog-appliance-button.mp3"
|
||||
dest_files=["res://.godot/imported/analog-appliance-button.mp3-3400d402b6dbe616a93c6ce4dfd33aab.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
BIN
app/assets/sound/camera-shutter.mp3
Normal file
BIN
app/assets/sound/camera-shutter.mp3
Normal file
Binary file not shown.
19
app/assets/sound/camera-shutter.mp3.import
Normal file
19
app/assets/sound/camera-shutter.mp3.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://c0ffdufx3cgg2"
|
||||
path="res://.godot/imported/camera-shutter.mp3-09c4e70bc95a3baac5e36d55131e6433.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sound/camera-shutter.mp3"
|
||||
dest_files=["res://.godot/imported/camera-shutter.mp3-09c4e70bc95a3baac5e36d55131e6433.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
BIN
app/assets/sound/crumple.mp3
Normal file
BIN
app/assets/sound/crumple.mp3
Normal file
Binary file not shown.
19
app/assets/sound/crumple.mp3.import
Normal file
19
app/assets/sound/crumple.mp3.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://bm2uxwqfmnvs6"
|
||||
path="res://.godot/imported/crumple.mp3-9a9f9e732def4983e19646093aa79cb8.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sound/crumple.mp3"
|
||||
dest_files=["res://.godot/imported/crumple.mp3-9a9f9e732def4983e19646093aa79cb8.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
BIN
app/assets/sound/finger-snap.mp3
Normal file
BIN
app/assets/sound/finger-snap.mp3
Normal file
Binary file not shown.
19
app/assets/sound/finger-snap.mp3.import
Normal file
19
app/assets/sound/finger-snap.mp3.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://du7ur0lu28cvn"
|
||||
path="res://.godot/imported/finger-snap.mp3-ee69ae79e1da4049d24dd085be327ce3.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sound/finger-snap.mp3"
|
||||
dest_files=["res://.godot/imported/finger-snap.mp3-ee69ae79e1da4049d24dd085be327ce3.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
BIN
app/assets/sound/message-incoming.mp3
Normal file
BIN
app/assets/sound/message-incoming.mp3
Normal file
Binary file not shown.
19
app/assets/sound/message-incoming.mp3.import
Normal file
19
app/assets/sound/message-incoming.mp3.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://c0fj5p6544ab7"
|
||||
path="res://.godot/imported/message-incoming.mp3-f3b0b0d850f78a95341ef72186559e01.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sound/message-incoming.mp3"
|
||||
dest_files=["res://.godot/imported/message-incoming.mp3-f3b0b0d850f78a95341ef72186559e01.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
|
@ -29,6 +29,7 @@ animation/import=true
|
|||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
fbx/importer=0
|
||||
|
|
|
@ -14,6 +14,7 @@ const color_wheel_img := preload ("res://assets/canvas.png")
|
|||
@onready var mode_next = $Modes/Next
|
||||
@onready var mode_before = $Modes/Previous
|
||||
@onready var mode_label = $Modes/Label
|
||||
@onready var snap_sound = $SnapSound
|
||||
|
||||
var active = R.state(false)
|
||||
var brightness = R.state(0) # 0-255
|
||||
|
@ -78,6 +79,8 @@ func _ready():
|
|||
"rgb_color": [int(picked_color.r * 255), int(picked_color.g * 255), int(picked_color.b * 255)],
|
||||
}
|
||||
|
||||
snap_sound.play()
|
||||
|
||||
HomeApi.set_state(entity_id, "on", attributes)
|
||||
)
|
||||
color_supported = true
|
||||
|
@ -123,6 +126,7 @@ func set_state(stateInfo):
|
|||
|
||||
func _on_click(event):
|
||||
if event.target == self:
|
||||
snap_sound.play()
|
||||
_toggle()
|
||||
|
||||
func quick_action():
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://cw86rc42dv2d8"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://cw86rc42dv2d8"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/entities/light/light.gd" id="1_ykxy3"]
|
||||
[ext_resource type="Script" path="res://content/functions/movable.gd" id="4_4sfxb"]
|
||||
|
@ -6,6 +6,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://pk5k1q8bx0rj" path="res://content/ui/components/slider/slider.tscn" id="6_mhjlm"]
|
||||
[ext_resource type="Texture2D" uid="uid://hy2f6is7qjyv" path="res://assets/canvas.png" id="7_ximu1"]
|
||||
[ext_resource type="Script" path="res://content/functions/clickable.gd" id="8_1sfll"]
|
||||
[ext_resource type="AudioStream" uid="uid://du7ur0lu28cvn" path="res://assets/sound/finger-snap.mp3" id="8_3togy"]
|
||||
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="8_nhcff"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_ukj14"]
|
||||
|
@ -105,3 +106,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.01, 0, 0)
|
|||
pixel_size = 0.001
|
||||
text = "Default"
|
||||
horizontal_alignment = 0
|
||||
|
||||
[node name="SnapSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("8_3togy")
|
||||
volume_db = -20.0
|
||||
|
|
|
@ -3,6 +3,7 @@ extends Entity
|
|||
const Entity = preload ("../entity.gd")
|
||||
|
||||
@onready var sprite: AnimatedSprite3D = $Icon
|
||||
@onready var snap_sound = $SnapSound
|
||||
|
||||
var active = R.state(false)
|
||||
|
||||
|
@ -29,6 +30,7 @@ func set_state(stateInfo):
|
|||
icon.value = "toggle_" + stateInfo["state"]
|
||||
|
||||
func _on_click(_event):
|
||||
snap_sound.play()
|
||||
_toggle()
|
||||
|
||||
func quick_action():
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://cscl5k7lhopj5"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cscl5k7lhopj5"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/entities/switch/switch.gd" id="1_8ffhi"]
|
||||
[ext_resource type="Texture2D" uid="uid://br3p0c2foputg" path="res://assets/materials/swich_on.png" id="1_w68gw"]
|
||||
[ext_resource type="Texture2D" uid="uid://co2ishj2hx57p" path="res://assets/materials/switch_off.png" id="2_86ba1"]
|
||||
[ext_resource type="Script" path="res://content/functions/movable.gd" id="4_6xr03"]
|
||||
[ext_resource type="AudioStream" uid="uid://du7ur0lu28cvn" path="res://assets/sound/finger-snap.mp3" id="5_qvw3h"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_ukj14"]
|
||||
radius = 0.0482081
|
||||
|
@ -37,3 +38,7 @@ sprite_frames = SubResource("SpriteFrames_ldpuo")
|
|||
[node name="Movable" type="Node" parent="."]
|
||||
script = ExtResource("4_6xr03")
|
||||
resizable = true
|
||||
|
||||
[node name="SnapSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("5_qvw3h")
|
||||
volume_db = -20.0
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
[sub_resource type="BoxShape3D" id="BoxShape3D_3qyo4"]
|
||||
size = Vector3(0.32, 0.16, 0.02)
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_nktla"]
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_v0oi8"]
|
||||
resource_local_to_scene = true
|
||||
render_priority = 10
|
||||
shader = ExtResource("6_40cd1")
|
||||
|
@ -25,7 +25,7 @@ shader_parameter/corner_radius = 0.8
|
|||
shader_parameter/roughness = 0.3
|
||||
shader_parameter/grain_amount = 0.02
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_mqjqg"]
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_pbdeb"]
|
||||
size = Vector2(0.32, 0.16)
|
||||
|
||||
[node name="Timer" type="StaticBody3D" groups=["entity"]]
|
||||
|
@ -78,7 +78,7 @@ label = "stop"
|
|||
icon = true
|
||||
|
||||
[node name="Panel" parent="." instance=ExtResource("5_j3gsb")]
|
||||
material_override = SubResource("ShaderMaterial_nktla")
|
||||
mesh = SubResource("QuadMesh_mqjqg")
|
||||
material_override = SubResource("ShaderMaterial_v0oi8")
|
||||
mesh = SubResource("QuadMesh_pbdeb")
|
||||
size = Vector2(0.32, 0.16)
|
||||
corner_radius = 0.8
|
||||
|
|
|
@ -13,7 +13,6 @@ signal on_moved()
|
|||
|
||||
var initiator = null
|
||||
var initiator2 = null
|
||||
var resizing = false
|
||||
|
||||
var relative_transform = Transform3D()
|
||||
var initial_point = Vector3()
|
||||
|
@ -27,7 +26,7 @@ var initial_transform = Transform3D()
|
|||
var distances = Vector2()
|
||||
|
||||
func _process(delta):
|
||||
if get_tree().debug_collisions_hint&&resizing:
|
||||
if get_tree().debug_collisions_hint&&initiator2 != null:
|
||||
DebugDraw3D.draw_line(initial_position, initial_position + initial_direction, Color(1, 0, 0))
|
||||
DebugDraw3D.draw_line(initial_position, initial_position + initial_up, Color(0, 1, 0))
|
||||
|
||||
|
@ -38,12 +37,11 @@ func _on_grab_down(event: EventPointer):
|
|||
if restricted&&event.target != get_parent():
|
||||
return
|
||||
|
||||
if resizing&&initiator2 != null:
|
||||
if initiator != null&&initiator2 != null:
|
||||
return
|
||||
|
||||
if resizable&&initiator != null:
|
||||
if initiator != null&&initiator2 == null&&initiator != event.initiator:
|
||||
initiator2 = event.initiator
|
||||
resizing = true
|
||||
|
||||
distances.y = event.ray.get_collision_point().distance_to(event.ray.global_position)
|
||||
|
||||
|
@ -54,8 +52,7 @@ func _on_grab_down(event: EventPointer):
|
|||
|
||||
return
|
||||
|
||||
if resizable:
|
||||
distances.x = event.ray.get_collision_point().distance_to(event.ray.global_position)
|
||||
distances.x = event.ray.get_collision_point().distance_to(event.ray.global_position)
|
||||
|
||||
initiator = event.initiator
|
||||
|
||||
|
@ -69,11 +66,14 @@ func _on_grab_move(event: EventPointer):
|
|||
if event.initiator != initiator:
|
||||
return
|
||||
|
||||
if resizing:
|
||||
if initiator != null&&initiator2 != null:
|
||||
var new_position = _get_first_ray_point()
|
||||
var new_direction = _get_second_ray_point() - new_position
|
||||
var new_up = -initiator.node.global_transform.basis.z.normalized() * distances.x
|
||||
|
||||
if resizable == false:
|
||||
new_direction = new_direction.normalized() * initial_direction.length()
|
||||
|
||||
if get_tree().debug_collisions_hint:
|
||||
DebugDraw3D.draw_line(new_position, new_position + new_direction, Color(1, 0, 0))
|
||||
DebugDraw3D.draw_line(new_position, new_position + new_up, Color(0, 1, 0))
|
||||
|
@ -93,7 +93,6 @@ func _on_grab_move(event: EventPointer):
|
|||
func _on_grab_up(event: EventPointer):
|
||||
if event.initiator == initiator2:
|
||||
initiator2 = null
|
||||
resizing = false
|
||||
_update_relative_transform()
|
||||
return
|
||||
|
||||
|
@ -101,12 +100,10 @@ func _on_grab_up(event: EventPointer):
|
|||
if initiator2 != null:
|
||||
initiator = initiator2
|
||||
initiator2 = null
|
||||
resizing = false
|
||||
_update_relative_transform()
|
||||
else:
|
||||
initiator = null
|
||||
initiator2 = null
|
||||
resizing = false
|
||||
on_moved.emit()
|
||||
|
||||
func _get_first_ray_point():
|
||||
|
|
|
@ -48,9 +48,6 @@ func _ready():
|
|||
toggle_menu()
|
||||
elif action.name == "by_button":
|
||||
House.body.mini_view.small.value=!House.body.mini_view.small.value
|
||||
elif action.name == "ax_button":
|
||||
if take_screenshot():
|
||||
EventSystem.notify("Screenshot taken", EventNotify.Type.INFO)
|
||||
)
|
||||
|
||||
EventSystem.on_focus_in.connect(func(event):
|
||||
|
@ -124,9 +121,6 @@ func _input(event):
|
|||
if event is InputEventKey and Input.is_key_pressed(KEY_F10):
|
||||
var vp = get_viewport()
|
||||
vp.debug_draw = (vp.debug_draw + 1) % 5
|
||||
|
||||
if event is InputEventKey and Input.is_key_pressed(KEY_F2):
|
||||
take_screenshot()
|
||||
|
||||
if event is InputEventKey and Input.is_key_pressed(KEY_M):
|
||||
toggle_menu()
|
||||
|
@ -149,27 +143,4 @@ func vector_key_mapping(key_positive_x: int, key_negative_x: int, key_positive_y
|
|||
if vec:
|
||||
vec = vec.normalized()
|
||||
|
||||
return vec
|
||||
|
||||
func take_screenshot():
|
||||
var vp = get_viewport()
|
||||
var texture = vp.get_texture()
|
||||
var image = texture.get_image()
|
||||
|
||||
var file_name = "%s.png" % Time.get_datetime_string_from_system().replace(":", "-")
|
||||
|
||||
if image == null:
|
||||
return false
|
||||
|
||||
if OS.get_name() == "Android":
|
||||
var path = OS.get_system_dir(OS.SYSTEM_DIR_PICTURES, false) + "/immersive-home/" + file_name
|
||||
|
||||
if not FileAccess.file_exists(path):
|
||||
var dir = path.get_base_dir()
|
||||
DirAccess.open("user://").make_dir_recursive(dir)
|
||||
|
||||
image.save_png(path)
|
||||
else:
|
||||
image.save_png("user://screenshots/%s.png" % Time.get_datetime_string_from_system().replace(":", "-"))
|
||||
|
||||
return true
|
||||
return vec
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=12 format=3 uid="uid://eecv28y6jxk4"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://eecv28y6jxk4"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://clc5dre31iskm" path="res://addons/godot-xr-tools/xr/start_xr.tscn" id="1_i4c04"]
|
||||
[ext_resource type="Script" path="res://content/main.gd" id="1_uvrd4"]
|
||||
|
@ -10,6 +10,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://c3kdssrmv84kv" path="res://content/ui/menu/menu.tscn" id="8_du83w"]
|
||||
[ext_resource type="PackedScene" uid="uid://lrehk38exd5n" path="res://content/system/keyboard/keyboard.tscn" id="9_e5n3p"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbemihbxkd4ll" path="res://content/system/house/house.tscn" id="9_np6mw"]
|
||||
[ext_resource type="Script" path="res://lib/utils/screenshot.gd" id="12_e13ym"]
|
||||
[ext_resource type="PackedScene" uid="uid://bhyddd1f0ry1x" path="res://content/ui/onboarding/onboarding.tscn" id="12_uq2nj"]
|
||||
|
||||
[node name="Main" type="Node3D"]
|
||||
|
@ -33,17 +34,17 @@ enable_passthrough = true
|
|||
[node name="XRControllerLeft" parent="XROrigin3D" instance=ExtResource("2_2lraw")]
|
||||
transform = Transform3D(0.999999, -1.39633e-11, 0, 9.48075e-12, 1, 0, 0, 0, 1, -0.355145, 0.550439, -0.477945)
|
||||
|
||||
[node name="IndexTip" parent="XROrigin3D/XRControllerLeft" index="6"]
|
||||
transform = Transform3D(0.967526, 0.252326, -0.0150302, -0.0150302, 0.116784, 0.993043, 0.252326, -0.960569, 0.116784, -0.00665802, 0.0427913, -0.169868)
|
||||
[node name="IndexTip" parent="XROrigin3D/XRControllerLeft" index="4"]
|
||||
transform = Transform3D(0.967526, 0.252326, -0.0150302, -0.0150302, 0.116784, 0.993043, 0.252326, -0.960569, 0.116784, -0.00665808, 0.0427912, -0.169868)
|
||||
|
||||
[node name="ThumbTip" parent="XROrigin3D/XRControllerLeft" index="7"]
|
||||
transform = Transform3D(0.967042, 0.24582, -0.0663439, -0.0663439, 0.494837, 0.866449, 0.24582, -0.833492, 0.494837, 0.0261569, 0.0891964, -0.0934418)
|
||||
[node name="ThumbTip" parent="XROrigin3D/XRControllerLeft" index="5"]
|
||||
transform = Transform3D(0.967043, 0.24582, -0.0663439, -0.0663439, 0.494837, 0.86645, 0.24582, -0.833492, 0.494837, 0.0261569, 0.0891963, -0.0934418)
|
||||
|
||||
[node name="MiddleTip" parent="XROrigin3D/XRControllerLeft" index="8"]
|
||||
transform = Transform3D(0.98042, 0.196912, 0.00149799, 0.001498, -0.015065, 0.999885, 0.196912, -0.980305, -0.0150651, -0.00327212, -0.00771424, -0.176318)
|
||||
[node name="MiddleTip" parent="XROrigin3D/XRControllerLeft" index="6"]
|
||||
transform = Transform3D(0.98042, 0.196912, 0.00149799, 0.001498, -0.015065, 0.999885, 0.196912, -0.980305, -0.0150651, -0.00327212, -0.00771427, -0.176318)
|
||||
|
||||
[node name="Palm" parent="XROrigin3D/XRControllerLeft" index="9"]
|
||||
transform = Transform3D(1, 3.12364e-06, -3.13861e-06, -3.12371e-06, 1, -1.97886e-05, 3.13854e-06, 1.97889e-05, 1, 0.0307807, -0.0419721, -0.0399505)
|
||||
[node name="Palm" parent="XROrigin3D/XRControllerLeft" index="7"]
|
||||
transform = Transform3D(1, 3.12361e-06, -3.13859e-06, -3.12371e-06, 1, -1.97886e-05, 3.13859e-06, 1.97889e-05, 1, 0.0307807, -0.0419722, -0.0399505)
|
||||
|
||||
[node name="XRControllerRight" parent="XROrigin3D" instance=ExtResource("7_0b3tc")]
|
||||
transform = Transform3D(0.999999, -1.39635e-11, 0, 1.31553e-10, 1, 0, 0, 0, 1, 0.336726, 0.575093, -0.437942)
|
||||
|
@ -65,5 +66,8 @@ transform = Transform3D(0.5, 5.24309e-05, 0.000144384, -0.000139169, 0.353553, 0
|
|||
[node name="Onboarding" parent="." instance=ExtResource("12_uq2nj")]
|
||||
transform = Transform3D(1, -1.39636e-11, 0, 4.42413e-11, 1, 0, 0, 0, 1, -0.576793, 0.820168, -0.60016)
|
||||
|
||||
[node name="Node" type="Node" parent="."]
|
||||
script = ExtResource("12_e13ym")
|
||||
|
||||
[editable path="XROrigin3D/XRControllerLeft"]
|
||||
[editable path="XROrigin3D/XRControllerLeft/hand_l"]
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
extends XRController3D
|
||||
|
||||
const Entity = preload ("res://content/entities/entity.gd")
|
||||
const Pointer = preload ("res://lib/utils/pointer/pointer.gd")
|
||||
const Initiator = preload ("res://lib/utils/pointer/initiator.gd")
|
||||
const Finger = preload ("res://lib/utils/touch/finger.gd")
|
||||
|
@ -23,9 +22,6 @@ const Miniature = preload ("res://content/system/house/mini/miniature.gd")
|
|||
|
||||
@onready var palm = $Palm
|
||||
@onready var ray: RayCast3D = $Raycast
|
||||
@onready var area = $trash_bin/Area3D
|
||||
@onready var trash_bin = $trash_bin
|
||||
@onready var animation = $AnimationPlayer
|
||||
@onready var quick_actions = $Palm/QuickActions
|
||||
|
||||
var hand_active = false
|
||||
|
@ -38,72 +34,10 @@ var grip_distance = 0.02
|
|||
var pressed = false
|
||||
var grabbed = false
|
||||
|
||||
var to_delete = []
|
||||
var trash_bin_visible: bool = true:
|
||||
set(value):
|
||||
if trash_bin_visible == value:
|
||||
return
|
||||
|
||||
if value:
|
||||
add_child(trash_bin)
|
||||
else:
|
||||
if animation.is_playing():
|
||||
await animation.animation_finished
|
||||
remove_child(trash_bin)
|
||||
|
||||
trash_bin_visible = value
|
||||
|
||||
var trash_bin_large: bool = false:
|
||||
set(value):
|
||||
if trash_bin_large == value:
|
||||
return
|
||||
|
||||
if value:
|
||||
animation.play("add_trashbin")
|
||||
else:
|
||||
animation.play_backwards("add_trashbin")
|
||||
|
||||
trash_bin_large = value
|
||||
|
||||
func _ready():
|
||||
trash_bin_visible = false
|
||||
|
||||
_setup_hand()
|
||||
|
||||
EventSystem.on_grab_down.connect(func(event: EventPointer):
|
||||
trash_bin_visible=_get_entity(event.target) != null
|
||||
)
|
||||
|
||||
EventSystem.on_grab_move.connect(func(event):
|
||||
if !trash_bin_visible:
|
||||
return
|
||||
|
||||
var entity=_get_entity(event.target)
|
||||
|
||||
if entity is Entity&&area.overlaps_body(entity):
|
||||
if !to_delete.has(entity):
|
||||
to_delete.append(entity)
|
||||
trash_bin_large=true
|
||||
|
||||
else:
|
||||
to_delete.erase(entity)
|
||||
trash_bin_large=false
|
||||
|
||||
)
|
||||
|
||||
EventSystem.on_grab_up.connect(func(_event: EventPointer):
|
||||
if !trash_bin_visible:
|
||||
return
|
||||
|
||||
for entity in to_delete:
|
||||
entity.queue_free()
|
||||
to_delete.clear()
|
||||
trash_bin_large=false
|
||||
trash_bin_visible=false
|
||||
|
||||
House.body.save_all_entities()
|
||||
)
|
||||
|
||||
func _process(_delta):
|
||||
if !hand_active:
|
||||
if quick_actions.is_inside_tree(): palm.remove_child(quick_actions)
|
||||
|
@ -124,28 +58,19 @@ func _physics_process(_delta):
|
|||
var grab_close = distance_grab <= grip_distance
|
||||
|
||||
if trigger_close&&!pressed:
|
||||
initiator.on_press.emit(Initiator.EventType.TRIGGER)
|
||||
pointer.pressed(Initiator.EventType.TRIGGER)
|
||||
pressed = true
|
||||
elif !trigger_close&&pressed:
|
||||
initiator.on_release.emit(Initiator.EventType.TRIGGER)
|
||||
pointer.released(Initiator.EventType.TRIGGER)
|
||||
pressed = false
|
||||
|
||||
if grab_close&&!grabbed:
|
||||
initiator.on_press.emit(Initiator.EventType.GRIP)
|
||||
pointer.pressed(Initiator.EventType.GRIP)
|
||||
grabbed = true
|
||||
elif !grab_close&&grabbed:
|
||||
initiator.on_release.emit(Initiator.EventType.GRIP)
|
||||
pointer.released(Initiator.EventType.GRIP)
|
||||
grabbed = false
|
||||
|
||||
func _get_entity(node: Node):
|
||||
if node is Entity:
|
||||
return node
|
||||
|
||||
if node.get_parent() == null:
|
||||
return null
|
||||
|
||||
return _get_entity(node.get_parent())
|
||||
|
||||
func _setup_hand():
|
||||
TouchManager.add_finger(Finger.Type.INDEX_LEFT, $IndexTip/TouchArea)
|
||||
|
||||
|
@ -183,4 +108,4 @@ func _setup_hand():
|
|||
initiator.node = self
|
||||
|
||||
pointer = Pointer.new(initiator, ray)
|
||||
add_child(pointer)
|
||||
add_child(pointer)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
[gd_scene load_steps=16 format=3 uid="uid://b30w6tywfj4fp"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://b30w6tywfj4fp"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/system/controller_left/controller_left.gd" id="1_2j3qs"]
|
||||
[ext_resource type="PackedScene" uid="uid://dqjcqdhe3rbtn" path="res://assets/models/trash_bin/trash_bin.gltf" id="3_m33ce"]
|
||||
[ext_resource type="PackedScene" uid="uid://dscp8x0ari57n" path="res://content/system/raycast/raycast.tscn" id="4_n7lao"]
|
||||
[ext_resource type="PackedScene" uid="uid://bufelcry36rw1" path="res://addons/xr-autohandtracker/auto_handtracker.tscn" id="4_oe7fv"]
|
||||
[ext_resource type="PackedScene" uid="uid://dhaqth6q5yw4n" path="res://addons/godot-xr-tools/hands/model/hand_l.gltf" id="5_w1pvs"]
|
||||
[ext_resource type="Shader" path="res://assets/materials/hands.gdshader" id="6_wk733"]
|
||||
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="6_x5vuc"]
|
||||
[ext_resource type="PackedScene" uid="uid://cfsnkoxb7mtok" path="res://content/system/trash_bin/trash_bin.tscn" id="7_vigb6"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_m58yb"]
|
||||
ao_enabled = true
|
||||
|
@ -15,91 +15,8 @@ ao_enabled = true
|
|||
material = SubResource("StandardMaterial3D_m58yb")
|
||||
size = Vector3(0.01, 0.01, 0.01)
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_x2eyr"]
|
||||
height = 0.105954
|
||||
radius = 0.0447927
|
||||
|
||||
[sub_resource type="Animation" id="Animation_7owc4"]
|
||||
length = 0.001
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("trash_bin:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("trash_bin:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("trash_bin:scale:z")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_hax52"]
|
||||
resource_name = "add_trashbin"
|
||||
length = 0.3
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("trash_bin:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0, 0.04, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.3)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("trash_bin:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0, 0.04, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.3)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("trash_bin:scale:z")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0, 0.04, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.3)
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_hkli8"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_7owc4"),
|
||||
"add_trashbin": SubResource("Animation_hax52")
|
||||
}
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ca85m"]
|
||||
render_priority = 0
|
||||
render_priority = 50
|
||||
shader = ExtResource("6_wk733")
|
||||
shader_parameter/albedo = Color(1, 1, 1, 0.4)
|
||||
shader_parameter/fade_offset = 0.0
|
||||
|
@ -117,22 +34,6 @@ script = ExtResource("1_2j3qs")
|
|||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_ir3co")
|
||||
|
||||
[node name="trash_bin" parent="." instance=ExtResource("3_m33ce")]
|
||||
transform = Transform3D(0.03, 0, 0, 0, 0.03, 0, 0, 0, 0.03, 0.0864577, -0.119983, 0.0462675)
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="trash_bin"]
|
||||
transform = Transform3D(25, 0, 0, 0, 25, 0, 0, 0, 25, 0, 0, 0)
|
||||
collision_layer = 0
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="trash_bin/Area3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0542412, 0)
|
||||
shape = SubResource("CylinderShape3D_x2eyr")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_hkli8")
|
||||
}
|
||||
|
||||
[node name="Raycast" parent="." instance=ExtResource("4_n7lao")]
|
||||
is_right = false
|
||||
|
||||
|
@ -163,7 +64,7 @@ collision_mask = 4
|
|||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="IndexTip/TouchArea"]
|
||||
transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
transform = Transform3D(1, 0, 0, 1.49012e-08, 1, 0, 1.86265e-09, -7.45058e-09, 1, 0, -0.01, 0)
|
||||
shape = SubResource("CapsuleShape3D_65k2y")
|
||||
|
||||
[node name="ThumbTip" type="BoneAttachment3D" parent="."]
|
||||
|
@ -210,4 +111,7 @@ transform = Transform3D(1, 1.73472e-18, 0, 0, 1, 0, 0, 0, 1, 0.0600001, -5.68873
|
|||
label = "humidity_mid"
|
||||
icon = true
|
||||
|
||||
[node name="TrashBin" parent="." instance=ExtResource("7_vigb6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.109418, -0.126353, 0.0278937)
|
||||
|
||||
[editable path="hand_l"]
|
||||
|
|
|
@ -58,15 +58,15 @@ func _physics_process(_delta):
|
|||
var grab_close = distance_grab <= grip_distance
|
||||
|
||||
if trigger_close&&!pressed:
|
||||
initiator.on_press.emit(Initiator.EventType.TRIGGER)
|
||||
pointer.pressed(Initiator.EventType.TRIGGER)
|
||||
pressed = true
|
||||
elif !trigger_close&&pressed:
|
||||
initiator.on_release.emit(Initiator.EventType.TRIGGER)
|
||||
pointer.released(Initiator.EventType.TRIGGER)
|
||||
pressed = false
|
||||
|
||||
if grab_close&&!grabbed:
|
||||
initiator.on_press.emit(Initiator.EventType.GRIP)
|
||||
pointer.pressed(Initiator.EventType.GRIP)
|
||||
grabbed = true
|
||||
elif !grab_close&&grabbed:
|
||||
initiator.on_release.emit(Initiator.EventType.GRIP)
|
||||
pointer.released(Initiator.EventType.GRIP)
|
||||
grabbed = false
|
|
@ -54,7 +54,7 @@ collision_mask = 4
|
|||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="IndexTip/TouchArea"]
|
||||
transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
transform = Transform3D(1, 0, 0, -1.49012e-08, 1, 0, 0, -7.45058e-09, 1, 0, -0.01, 0)
|
||||
shape = SubResource("CapsuleShape3D_66uu0")
|
||||
|
||||
[node name="ThumbTip" type="BoneAttachment3D" parent="."]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
[ext_resource type="Shader" path="res://assets/materials/hands.gdshader" id="1_kyekt"]
|
||||
|
||||
[resource]
|
||||
render_priority = 0
|
||||
render_priority = 50
|
||||
shader = ExtResource("1_kyekt")
|
||||
shader_parameter/albedo = Color(1, 1, 1, 0.4)
|
||||
shader_parameter/fade_offset = 0.0
|
||||
|
|
|
@ -7,6 +7,7 @@ const TOUCH_LONG = 400.0
|
|||
@export var entity: Entity
|
||||
|
||||
@onready var collision = $CollisionShape3D
|
||||
@onready var snap_sound = $SnapSound
|
||||
@onready var label = $Label3D
|
||||
var active = R.state(false)
|
||||
var disabled = R.state(true)
|
||||
|
@ -36,6 +37,7 @@ func _ready():
|
|||
func _on_click(_event: EventPointer):
|
||||
if entity.has_method("quick_action")&&miniature.entity_select.selection_active() == false:
|
||||
entity.quick_action()
|
||||
snap_sound.play()
|
||||
else:
|
||||
miniature.entity_select.toggle(entity)
|
||||
|
||||
|
@ -62,6 +64,7 @@ func _on_touch_leave(_event: EventTouch):
|
|||
if touch_ran: return
|
||||
|
||||
if entity.has_method("quick_action")&&miniature.entity_select.selection_active() == false:
|
||||
snap_sound.play()
|
||||
entity.quick_action()
|
||||
else:
|
||||
miniature.entity_select.toggle(entity)
|
||||
miniature.entity_select.toggle(entity)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://b5buw1sas18n4"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://b5buw1sas18n4"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/system/dot/dot.gd" id="1_vdpux"]
|
||||
[ext_resource type="AudioStream" uid="uid://du7ur0lu28cvn" path="res://assets/sound/finger-snap.mp3" id="3_04fcm"]
|
||||
[ext_resource type="FontVariation" uid="uid://sshfnckriqxn" path="res://assets/icons/icons.tres" id="4_504vw"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_3wgjq"]
|
||||
|
@ -34,3 +35,7 @@ monitoring = false
|
|||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Area3D"]
|
||||
shape = SubResource("SphereShape3D_y1ne8")
|
||||
|
||||
[node name="SnapSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("3_04fcm")
|
||||
volume_db = -20.0
|
||||
|
|
|
@ -1,150 +0,0 @@
|
|||
extends Node3D
|
||||
|
||||
const Pointer = preload ("res://lib/utils/pointer/pointer.gd")
|
||||
const Initiator = preload ("res://lib/utils/pointer/initiator.gd")
|
||||
const Finger = preload ("res://lib/utils/touch/finger.gd")
|
||||
const Touch = preload ("res://lib/utils/touch/touch.gd")
|
||||
const Collide = preload ("res://lib/utils/touch/collide.gd")
|
||||
const Miniature = preload ("res://content/system/house/mini/miniature.gd")
|
||||
|
||||
@onready var main = $"/root/Main"
|
||||
@onready var palm = $XRHandLeft/Palm
|
||||
@onready var quick_actions = $XRHandLeft/Palm/QuickActions
|
||||
@onready var mini_view_button = $XRHandLeft/Palm/QuickActions/MiniView
|
||||
@onready var temperature_button = $XRHandLeft/Palm/QuickActions/Temperature
|
||||
@onready var humidity_button = $XRHandLeft/Palm/QuickActions/Humidity
|
||||
@export var ray_left: RayCast3D
|
||||
@export var ray_right: RayCast3D
|
||||
@export var hand_left: Node3D
|
||||
@export var hand_right: Node3D
|
||||
|
||||
@onready var bone_attachments_right = [$XRHandRight/IndexTip, $XRHandRight/ThumbTip, $XRHandRight/MiddleTip]
|
||||
@onready var bone_attachments_left = [$XRHandLeft/IndexTip, $XRHandLeft/ThumbTip, $XRHandLeft/MiddleTip]
|
||||
|
||||
enum Fingers {INDEX, THUMB, MIDDLE}
|
||||
|
||||
var left_initiator: Initiator = Initiator.new()
|
||||
var right_initiator: Initiator = Initiator.new()
|
||||
var touch: Touch
|
||||
var collide: Collide
|
||||
var left_pointer: Pointer
|
||||
var right_pointer: Pointer
|
||||
var press_distance = 0.03
|
||||
var grip_distance = 0.03
|
||||
|
||||
var pressed_left = false
|
||||
var pressed_right = false
|
||||
var grabbed_left = false
|
||||
var grabbed_right = false
|
||||
|
||||
func _ready():
|
||||
var fingers = {
|
||||
Finger.Type.INDEX_RIGHT: $XRHandRight/IndexTip/TouchArea,
|
||||
Finger.Type.INDEX_LEFT: $XRHandLeft/IndexTip/TouchArea,
|
||||
Finger.Type.MIDDLE_RIGHT: $XRHandRight/MiddleTip/TouchArea,
|
||||
Finger.Type.MIDDLE_LEFT: $XRHandLeft/MiddleTip/TouchArea
|
||||
}
|
||||
|
||||
touch = Touch.new(fingers)
|
||||
collide = Collide.new(hand_left, hand_right, $XRHandLeft/IndexTip/TouchArea, $XRHandRight/IndexTip/TouchArea)
|
||||
add_child(touch)
|
||||
add_child(collide)
|
||||
|
||||
_ready_hand()
|
||||
|
||||
mini_view_button.on_button_up.connect(func():
|
||||
House.body.mini_view.small.value=!House.body.mini_view.small.value
|
||||
)
|
||||
|
||||
temperature_button.on_button_up.connect(func():
|
||||
if House.body.mini_view.heatmap_type.value == Miniature.HeatmapType.TEMPERATURE:
|
||||
House.body.mini_view.heatmap_type.value=Miniature.HeatmapType.NONE
|
||||
else:
|
||||
House.body.mini_view.heatmap_type.value=Miniature.HeatmapType.TEMPERATURE
|
||||
)
|
||||
|
||||
humidity_button.on_button_up.connect(func():
|
||||
if House.body.mini_view.heatmap_type.value == Miniature.HeatmapType.HUMIDITY:
|
||||
House.body.mini_view.heatmap_type.value=Miniature.HeatmapType.NONE
|
||||
else:
|
||||
House.body.mini_view.heatmap_type.value=Miniature.HeatmapType.HUMIDITY
|
||||
)
|
||||
|
||||
func _ready_hand():
|
||||
left_initiator.type = Initiator.Type.HAND_LEFT
|
||||
left_initiator.node = ray_left.get_parent()
|
||||
|
||||
left_pointer = Pointer.new(left_initiator, ray_left)
|
||||
add_child(left_pointer)
|
||||
|
||||
right_initiator.type = Initiator.Type.HAND_RIGHT
|
||||
right_initiator.node = ray_right.get_parent()
|
||||
|
||||
right_pointer = Pointer.new(right_initiator, ray_right)
|
||||
add_child(right_pointer)
|
||||
|
||||
func _process(_delta):
|
||||
if main.camera.global_transform.basis.z.dot(palm.global_transform.basis.y) > 0.85:
|
||||
if quick_actions.is_inside_tree() == false: palm.add_child(quick_actions)
|
||||
else:
|
||||
if quick_actions.is_inside_tree(): palm.remove_child(quick_actions)
|
||||
|
||||
func _physics_process(_delta):
|
||||
_process_hand_left(hand_left)
|
||||
_process_hand_right(hand_right)
|
||||
|
||||
func _process_hand_left(hand: Node3D):
|
||||
var index_tip = bone_attachments_left[Fingers.INDEX].get_node("Marker3D")
|
||||
var thumb_tip = bone_attachments_left[Fingers.THUMB].get_node("Marker3D")
|
||||
var middle_tip = bone_attachments_left[Fingers.MIDDLE].get_node("Marker3D")
|
||||
|
||||
var _ray = ray_left if hand == hand_left else ray_right
|
||||
var initiator = left_initiator if hand == hand_left else right_initiator
|
||||
|
||||
var distance_trigger = index_tip.global_position.distance_to(thumb_tip.global_position)
|
||||
var distance_grab = middle_tip.global_position.distance_to(thumb_tip.global_position)
|
||||
|
||||
var trigger_close = distance_trigger <= press_distance
|
||||
var grab_close = distance_grab <= grip_distance
|
||||
|
||||
if trigger_close&&!pressed_left:
|
||||
initiator.on_press.emit(Initiator.EventType.TRIGGER)
|
||||
pressed_left = true
|
||||
elif !trigger_close&&pressed_left:
|
||||
initiator.on_release.emit(Initiator.EventType.TRIGGER)
|
||||
pressed_left = false
|
||||
|
||||
if grab_close&&!grabbed_left:
|
||||
initiator.on_press.emit(Initiator.EventType.GRIP)
|
||||
grabbed_left = true
|
||||
elif !grab_close&&grabbed_left:
|
||||
initiator.on_release.emit(Initiator.EventType.GRIP)
|
||||
grabbed_left = false
|
||||
|
||||
func _process_hand_right(hand: Node3D):
|
||||
var index_tip = bone_attachments_right[Fingers.INDEX].get_node("Marker3D")
|
||||
var thumb_tip = bone_attachments_right[Fingers.THUMB].get_node("Marker3D")
|
||||
var middle_tip = bone_attachments_right[Fingers.MIDDLE].get_node("Marker3D")
|
||||
|
||||
var _ray = ray_left if hand == hand_left else ray_right
|
||||
var initiator = left_initiator if hand == hand_left else right_initiator
|
||||
|
||||
var distance_trigger = index_tip.global_position.distance_to(thumb_tip.global_position)
|
||||
var distance_grab = middle_tip.global_position.distance_to(thumb_tip.global_position)
|
||||
|
||||
var trigger_close = distance_trigger <= press_distance
|
||||
var grab_close = distance_grab <= grip_distance
|
||||
|
||||
if trigger_close&&!pressed_right:
|
||||
initiator.on_press.emit(Initiator.EventType.TRIGGER)
|
||||
pressed_right = true
|
||||
elif !trigger_close&&pressed_right:
|
||||
initiator.on_release.emit(Initiator.EventType.TRIGGER)
|
||||
pressed_right = false
|
||||
|
||||
if grab_close&&!grabbed_right:
|
||||
initiator.on_press.emit(Initiator.EventType.GRIP)
|
||||
grabbed_right = true
|
||||
elif !grab_close&&grabbed_right:
|
||||
initiator.on_release.emit(Initiator.EventType.GRIP)
|
||||
grabbed_right = false
|
|
@ -1,137 +0,0 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://bsx12q23v8apy"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/system/hands/hands.gd" id="1_c4f76"]
|
||||
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="3_te2p8"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dopke"]
|
||||
radius = 0.001
|
||||
height = 0.02
|
||||
|
||||
[node name="Hands" type="Node3D"]
|
||||
script = ExtResource("1_c4f76")
|
||||
|
||||
[node name="XRHandLeft" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.999999, -1.39628e-11, 0, 9.48119e-12, 0.999999, -4.54747e-13, 0, 0, 0.999999, -0.25, 0, 0)
|
||||
|
||||
[node name="IndexTip" type="BoneAttachment3D" parent="XRHandLeft"]
|
||||
transform = Transform3D(0.967526, 0.252326, -0.0150302, -0.0150302, 0.116784, 0.993043, 0.252326, -0.960569, 0.116784, -0.00665802, 0.0427913, -0.169868)
|
||||
bone_name = "Index_Tip_L"
|
||||
bone_idx = 9
|
||||
use_external_skeleton = true
|
||||
external_skeleton = NodePath("")
|
||||
|
||||
[node name="Marker3D" type="Marker3D" parent="XRHandLeft/IndexTip"]
|
||||
gizmo_extents = 0.02
|
||||
|
||||
[node name="TouchArea" type="Area3D" parent="XRHandLeft/IndexTip"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0.01)
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandLeft/IndexTip/TouchArea"]
|
||||
transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("CapsuleShape3D_dopke")
|
||||
|
||||
[node name="ThumbTip" type="BoneAttachment3D" parent="XRHandLeft"]
|
||||
transform = Transform3D(0.967043, 0.24582, -0.0663439, -0.0663439, 0.494837, 0.86645, 0.24582, -0.833492, 0.494837, 0.0261569, 0.0891964, -0.0934418)
|
||||
bone_name = "Thumb_Tip_L"
|
||||
bone_idx = 4
|
||||
use_external_skeleton = true
|
||||
external_skeleton = NodePath("")
|
||||
|
||||
[node name="Marker3D" type="Marker3D" parent="XRHandLeft/ThumbTip"]
|
||||
gizmo_extents = 0.02
|
||||
|
||||
[node name="MiddleTip" type="BoneAttachment3D" parent="XRHandLeft"]
|
||||
transform = Transform3D(0.98042, 0.196912, 0.00149799, 0.001498, -0.015065, 0.999885, 0.196912, -0.980305, -0.0150651, -0.00327212, -0.00771424, -0.176318)
|
||||
bone_name = "Middle_Tip_L"
|
||||
bone_idx = 14
|
||||
use_external_skeleton = true
|
||||
external_skeleton = NodePath("")
|
||||
|
||||
[node name="Marker3D" type="Marker3D" parent="XRHandLeft/MiddleTip"]
|
||||
gizmo_extents = 0.02
|
||||
|
||||
[node name="TouchArea" type="Area3D" parent="XRHandLeft/MiddleTip"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0.01)
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandLeft/MiddleTip/TouchArea"]
|
||||
transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("CapsuleShape3D_dopke")
|
||||
|
||||
[node name="Palm" type="Node3D" parent="XRHandLeft"]
|
||||
transform = Transform3D(-0.707107, -8.74228e-08, -0.707107, 6.18173e-08, -1, 6.18173e-08, -0.707107, -8.29045e-24, 0.707107, 0.01, -0.04, -5.58794e-09)
|
||||
|
||||
[node name="QuickActions" type="Node3D" parent="XRHandLeft/Palm"]
|
||||
transform = Transform3D(0.5, -4.47035e-08, -4.37114e-08, 4.37114e-08, -2.18557e-08, 0.5, -4.47035e-08, -0.5, -2.18557e-08, 0.005, 0, 0.005)
|
||||
|
||||
[node name="MiniView" parent="XRHandLeft/Palm/QuickActions" instance=ExtResource("3_te2p8")]
|
||||
transform = Transform3D(1, -3.55271e-15, -4.33681e-19, 3.55271e-15, 1, 3.5525e-15, -4.33681e-19, -3.55291e-15, 1, -0.0600001, 0, 0)
|
||||
label = "nest_multi_room"
|
||||
icon = true
|
||||
|
||||
[node name="Temperature" parent="XRHandLeft/Palm/QuickActions" instance=ExtResource("3_te2p8")]
|
||||
label = "device_thermostat"
|
||||
icon = true
|
||||
|
||||
[node name="Humidity" parent="XRHandLeft/Palm/QuickActions" instance=ExtResource("3_te2p8")]
|
||||
transform = Transform3D(1, 1.73472e-18, 0, 0, 1, 0, 0, 0, 1, 0.0600001, -5.68873e-13, 0)
|
||||
label = "humidity_mid"
|
||||
icon = true
|
||||
|
||||
[node name="XRHandRight" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.999998, 0, 0, 0, 0.999999, 0, 0, 0, 0.999999, 0.264391, 0, 0)
|
||||
|
||||
[node name="IndexTip" type="BoneAttachment3D" parent="XRHandRight"]
|
||||
transform = Transform3D(0.967526, -0.252326, 0.0150302, 0.0150302, 0.116784, 0.993043, -0.252326, -0.960569, 0.116784, 0.00665802, 0.0427913, -0.169868)
|
||||
bone_name = "Index_Tip_R"
|
||||
bone_idx = 9
|
||||
use_external_skeleton = true
|
||||
external_skeleton = NodePath("")
|
||||
|
||||
[node name="Marker3D" type="Marker3D" parent="XRHandRight/IndexTip"]
|
||||
gizmo_extents = 0.02
|
||||
|
||||
[node name="TouchArea" type="Area3D" parent="XRHandRight/IndexTip"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0.01)
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandRight/IndexTip/TouchArea"]
|
||||
transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("CapsuleShape3D_dopke")
|
||||
|
||||
[node name="ThumbTip" type="BoneAttachment3D" parent="XRHandRight"]
|
||||
transform = Transform3D(0.967042, -0.24582, 0.0663439, 0.0663439, 0.494837, 0.866449, -0.24582, -0.833492, 0.494837, -0.0261569, 0.0891963, -0.0934418)
|
||||
bone_name = "Thumb_Tip_R"
|
||||
bone_idx = 4
|
||||
use_external_skeleton = true
|
||||
external_skeleton = NodePath("")
|
||||
|
||||
[node name="Marker3D" type="Marker3D" parent="XRHandRight/ThumbTip"]
|
||||
gizmo_extents = 0.02
|
||||
|
||||
[node name="MiddleTip" type="BoneAttachment3D" parent="XRHandRight"]
|
||||
transform = Transform3D(0.98042, -0.196912, -0.00149799, -0.001498, -0.015065, 0.999885, -0.196912, -0.980305, -0.0150651, 0.00327212, -0.00771424, -0.176318)
|
||||
bone_name = "Middle_Tip_R"
|
||||
bone_idx = 14
|
||||
use_external_skeleton = true
|
||||
external_skeleton = NodePath("")
|
||||
|
||||
[node name="Marker3D" type="Marker3D" parent="XRHandRight/MiddleTip"]
|
||||
gizmo_extents = 0.02
|
||||
|
||||
[node name="TouchArea" type="Area3D" parent="XRHandRight/MiddleTip"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0.01)
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="XRHandRight/MiddleTip/TouchArea"]
|
||||
transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
shape = SubResource("CapsuleShape3D_dopke")
|
|
@ -28,11 +28,11 @@ func _ready():
|
|||
|
||||
get_parent().button_pressed.connect(func(button: String):
|
||||
if _event_type_map.has(button):
|
||||
initiator.on_press.emit(_event_type_map[button])
|
||||
pointer.pressed(_event_type_map[button])
|
||||
)
|
||||
get_parent().button_released.connect(func(button: String):
|
||||
if _event_type_map.has(button):
|
||||
initiator.on_release.emit(_event_type_map[button])
|
||||
pointer.released(_event_type_map[button])
|
||||
)
|
||||
|
||||
func _physics_process(_delta):
|
||||
|
|
85
app/content/system/trash_bin/trash_bin.gd
Normal file
85
app/content/system/trash_bin/trash_bin.gd
Normal file
|
@ -0,0 +1,85 @@
|
|||
extends Node3D
|
||||
|
||||
const Entity = preload ("res://content/entities/entity.gd")
|
||||
|
||||
@onready var trash_bin = $trash_bin
|
||||
@onready var bin_area = $trash_bin/Area3D
|
||||
|
||||
@onready var delete_sound = $DeleteSound
|
||||
@onready var animation = $AnimationPlayer
|
||||
|
||||
var to_delete = []
|
||||
var trash_bin_visible: bool = true:
|
||||
set(value):
|
||||
if trash_bin_visible == value:
|
||||
return
|
||||
|
||||
if value:
|
||||
add_child(trash_bin)
|
||||
else:
|
||||
if animation.is_playing():
|
||||
await animation.animation_finished
|
||||
remove_child(trash_bin)
|
||||
|
||||
trash_bin_visible = value
|
||||
|
||||
var trash_bin_large: bool = false:
|
||||
set(value):
|
||||
if trash_bin_large == value:
|
||||
return
|
||||
|
||||
if value:
|
||||
animation.play("add_trashbin")
|
||||
else:
|
||||
animation.play_backwards("add_trashbin")
|
||||
|
||||
trash_bin_large = value
|
||||
|
||||
func _ready():
|
||||
trash_bin_visible = false
|
||||
|
||||
EventSystem.on_grab_down.connect(func(event: EventPointer):
|
||||
trash_bin_visible=_get_entity(event.target) != null
|
||||
)
|
||||
|
||||
EventSystem.on_grab_move.connect(func(event):
|
||||
if !trash_bin_visible:
|
||||
return
|
||||
|
||||
var entity=_get_entity(event.target)
|
||||
|
||||
if entity is Entity&&bin_area.overlaps_body(entity):
|
||||
if !to_delete.has(entity):
|
||||
to_delete.append(entity)
|
||||
trash_bin_large=true
|
||||
|
||||
else:
|
||||
to_delete.erase(entity)
|
||||
trash_bin_large=false
|
||||
|
||||
)
|
||||
|
||||
EventSystem.on_grab_up.connect(func(_event: EventPointer):
|
||||
if !trash_bin_visible:
|
||||
return
|
||||
|
||||
if to_delete.size() > 0:
|
||||
delete_sound.play()
|
||||
|
||||
for entity in to_delete:
|
||||
entity.queue_free()
|
||||
to_delete.clear()
|
||||
trash_bin_large=false
|
||||
trash_bin_visible=false
|
||||
|
||||
House.body.save_all_entities()
|
||||
)
|
||||
|
||||
func _get_entity(node: Node):
|
||||
if node is Entity:
|
||||
return node
|
||||
|
||||
if node.get_parent() == null:
|
||||
return null
|
||||
|
||||
return _get_entity(node.get_parent())
|
93
app/content/system/trash_bin/trash_bin.tscn
Normal file
93
app/content/system/trash_bin/trash_bin.tscn
Normal file
|
@ -0,0 +1,93 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://cfsnkoxb7mtok"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dqjcqdhe3rbtn" path="res://assets/models/trash_bin/trash_bin.gltf" id="1_g2oxl"]
|
||||
[ext_resource type="Script" path="res://content/system/trash_bin/trash_bin.gd" id="1_krk5w"]
|
||||
[ext_resource type="AudioStream" uid="uid://bm2uxwqfmnvs6" path="res://assets/sound/crumple.mp3" id="3_p7u0v"]
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_fmaps"]
|
||||
height = 0.105954
|
||||
radius = 0.0447927
|
||||
|
||||
[sub_resource type="Animation" id="Animation_wg64y"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("trash_bin:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0.03, 0.03, 0.03)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("trash_bin:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, -0.02, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_cxelh"]
|
||||
resource_name = "add_trashbin"
|
||||
length = 0.4
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("trash_bin:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0.03, 0.03, 0.03), Vector3(0.04, 0.04, 0.04)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("trash_bin:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(0, -0.02, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_hrejr"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_wg64y"),
|
||||
"add_trashbin": SubResource("Animation_cxelh")
|
||||
}
|
||||
|
||||
[node name="TrashBin" type="Node3D"]
|
||||
script = ExtResource("1_krk5w")
|
||||
|
||||
[node name="trash_bin" parent="." instance=ExtResource("1_g2oxl")]
|
||||
transform = Transform3D(0.03, 0, 0, 0, 0.03, 0, 0, 0, 0.03, 0, -0.02, 0)
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="trash_bin"]
|
||||
transform = Transform3D(25, 0, 0, 0, 25, 0, 0, 0, 25, 0, 0, 0)
|
||||
collision_layer = 0
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="trash_bin/Area3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0542412, 0)
|
||||
shape = SubResource("CylinderShape3D_fmaps")
|
||||
|
||||
[node name="DeleteSound" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("3_p7u0v")
|
||||
volume_db = -10.0
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_hrejr")
|
||||
}
|
|
@ -19,6 +19,7 @@ const ECHO_WAIT_REPEAT = 0.1
|
|||
@onready var finger_area_collision: CollisionShape3D = $FingerArea/CollisionShape3D
|
||||
@onready var touch_collision: CollisionShape3D = $TouchBody/CollisionShape3D
|
||||
@onready var touch: StaticBody3D = $TouchBody
|
||||
@onready var click_sound = $ClickSound
|
||||
|
||||
@export var focusable: bool = true:
|
||||
set(value):
|
||||
|
@ -115,7 +116,7 @@ func _on_press_down(event):
|
|||
event.bubbling = false
|
||||
return
|
||||
|
||||
AudioPlayer.play_effect("click")
|
||||
click_sound.play()
|
||||
|
||||
if toggleable:
|
||||
return
|
||||
|
@ -163,7 +164,7 @@ func _on_touch_enter(event: EventTouch):
|
|||
event.bubbling = false
|
||||
return
|
||||
|
||||
AudioPlayer.play_effect("click")
|
||||
click_sound.play()
|
||||
|
||||
if toggleable:
|
||||
active = !active
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://bsjqdvkt0u87c"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bsjqdvkt0u87c"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/ui/components/button/button.gd" id="1_74x7g"]
|
||||
[ext_resource type="Shader" path="res://content/ui/components/panel/glass.gdshader" id="2_db5by"]
|
||||
[ext_resource type="Script" path="res://content/ui/components/panel/panel.gd" id="3_skm86"]
|
||||
[ext_resource type="AudioStream" uid="uid://c1yu80uj3fsn7" path="res://assets/sound/click.wav" id="4_51sb0"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_n8om1"]
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_826v7"]
|
||||
resource_local_to_scene = true
|
||||
render_priority = 10
|
||||
shader = ExtResource("2_db5by")
|
||||
|
@ -19,7 +20,7 @@ shader_parameter/corner_radius = 0.2
|
|||
shader_parameter/roughness = 0.3
|
||||
shader_parameter/grain_amount = 0.02
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_dxm1i"]
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_02501"]
|
||||
size = Vector2(0.04, 0.04)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xwopm"]
|
||||
|
@ -42,8 +43,8 @@ collision_mask = 0
|
|||
|
||||
[node name="Panel3D" type="MeshInstance3D" parent="Body"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.005)
|
||||
material_override = SubResource("ShaderMaterial_n8om1")
|
||||
mesh = SubResource("QuadMesh_dxm1i")
|
||||
material_override = SubResource("ShaderMaterial_826v7")
|
||||
mesh = SubResource("QuadMesh_02501")
|
||||
skeleton = NodePath("../..")
|
||||
script = ExtResource("3_skm86")
|
||||
size = Vector2(0.04, 0.04)
|
||||
|
@ -78,3 +79,7 @@ collision_mask = 0
|
|||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="TouchBody"]
|
||||
shape = SubResource("BoxShape3D_xwopm")
|
||||
|
||||
[node name="ClickSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("4_51sb0")
|
||||
volume_db = -18.0
|
||||
|
|
|
@ -13,6 +13,7 @@ signal on_text_changed(text: String)
|
|||
@onready var animation: AnimationPlayer = $AnimationPlayer
|
||||
@onready var label: Label3D = $Body/Label
|
||||
@onready var placeholder_label: Label3D = $Body/Placeholder
|
||||
@onready var snap_sound = $SnapSound
|
||||
|
||||
@export var placeholder: String = "":
|
||||
set(value):
|
||||
|
@ -135,6 +136,7 @@ func _on_focus_in(_event):
|
|||
caret.visible = true
|
||||
panel.active = true
|
||||
animation.play("blink")
|
||||
snap_sound.play()
|
||||
_update_placeholder()
|
||||
|
||||
func update_caret_position(event):
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
[ext_resource type="FontVariation" uid="uid://d2ofyimg5s65q" path="res://assets/fonts/ui_font_500.tres" id="3_ij5fh"]
|
||||
[ext_resource type="Shader" path="res://content/ui/components/panel/glass.gdshader" id="3_nl02b"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_a00dk"]
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_46adm"]
|
||||
resource_local_to_scene = true
|
||||
render_priority = 10
|
||||
shader = ExtResource("3_nl02b")
|
||||
|
@ -20,7 +20,7 @@ shader_parameter/corner_radius = 0.2
|
|||
shader_parameter/roughness = 0.3
|
||||
shader_parameter/grain_amount = 0.02
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_har6y"]
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_1me1o"]
|
||||
size = Vector2(0.15, 0.03)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_x4yp8"]
|
||||
|
@ -83,8 +83,8 @@ collision_mask = 6
|
|||
|
||||
[node name="Panel3D" type="MeshInstance3D" parent="Body"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.005)
|
||||
material_override = SubResource("ShaderMaterial_a00dk")
|
||||
mesh = SubResource("QuadMesh_har6y")
|
||||
material_override = SubResource("ShaderMaterial_46adm")
|
||||
mesh = SubResource("QuadMesh_1me1o")
|
||||
script = ExtResource("3_3bvrj")
|
||||
size = Vector2(0.15, 0.03)
|
||||
|
||||
|
@ -128,3 +128,5 @@ root_node = NodePath("../Body")
|
|||
libraries = {
|
||||
"": SubResource("AnimationLibrary_1sy4t")
|
||||
}
|
||||
|
||||
[node name="SnapSound" type="AudioStreamPlayer" parent="."]
|
||||
|
|
|
@ -4,6 +4,7 @@ const ButtonScene = preload ("res://content/ui/components/button/button.tscn")
|
|||
|
||||
@onready var devices_page = $Devices
|
||||
@onready var entities_page = $Entities
|
||||
@onready var spawn_sound = $SpawnSound
|
||||
|
||||
var selected_device = R.state(null)
|
||||
|
||||
|
@ -17,7 +18,7 @@ func _ready():
|
|||
)
|
||||
|
||||
entities_page.on_select_entity.connect(func(entity_name):
|
||||
AudioPlayer.play_effect("spawn")
|
||||
spawn_sound.play()
|
||||
|
||||
var entity=House.body.create_entity(entity_name, global_position)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=13 format=3 uid="uid://crrb0l3ekuotj"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://crrb0l3ekuotj"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/ui/menu/edit/edit_menu.gd" id="1_34cbn"]
|
||||
[ext_resource type="Script" path="res://content/ui/menu/edit/devices.gd" id="2_rkvf4"]
|
||||
|
@ -10,6 +10,7 @@
|
|||
[ext_resource type="Script" path="res://content/ui/menu/edit/entities.gd" id="5_t34xe"]
|
||||
[ext_resource type="Script" path="res://content/ui/components/flex_container/flex_container.gd" id="6_cr6p6"]
|
||||
[ext_resource type="PackedScene" uid="uid://blrhy2uccrdn4" path="res://content/ui/components/input/input.tscn" id="6_evh58"]
|
||||
[ext_resource type="AudioStream" uid="uid://cn2qohl6abgeu" path="res://assets/sound/spawn.wav" id="11_7qxwt"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hstwo"]
|
||||
render_priority = -3
|
||||
|
@ -131,3 +132,7 @@ visible = false
|
|||
material_override = SubResource("ShaderMaterial_hstwo")
|
||||
mesh = SubResource("QuadMesh_4pj6f")
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="SpawnSound" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("11_7qxwt")
|
||||
volume_db = -10.0
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user