Compare commits

...

5 Commits

Author SHA1 Message Date
c3ff6294c8 fix ord 2026-03-02 17:28:23 +01:00
c15c037771 automatically connect and reconnect to otdipc 2026-02-26 20:46:45 +01:00
79a19a5748 Merge pull request 'og-openxr-repo' (#1) from og-openxr-repo into main
Reviewed-on: #1
2026-02-25 23:36:01 +00:00
fecc9c4de5 More basic controller profile 2026-02-25 23:39:38 +01:00
ebcde11632 why did we fork again? 2026-02-25 23:19:17 +01:00
8 changed files with 256 additions and 101 deletions

170
Cargo.lock generated
View File

@@ -203,7 +203,7 @@ version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
dependencies = [ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
@@ -214,7 +214,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"once_cell_polyfill", "once_cell_polyfill",
"windows-sys 0.61.2", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
@@ -248,7 +248,7 @@ dependencies = [
"objc2-foundation 0.3.2", "objc2-foundation 0.3.2",
"parking_lot", "parking_lot",
"percent-encoding", "percent-encoding",
"windows-sys 0.59.0", "windows-sys 0.60.2",
"x11rb", "x11rb",
] ]
@@ -1139,7 +1139,7 @@ checksum = "7ef8e4b7e61dfe7719bb03c884dc270cd46a82efb40f93e9933b990c5c190c59"
[[package]] [[package]]
name = "bevy_mod_openxr" name = "bevy_mod_openxr"
version = "0.5.0" version = "0.5.0"
source = "git+https://git.avii.nl/Avii/bevy_oxr.git#aca40a0761d9a09111431b83a3ee2269bf3c55df" source = "git+https://github.com/awtterpip/bevy_oxr.git#93fe370f1203fab0c37e9ab5c393129111828466"
dependencies = [ dependencies = [
"android_system_properties", "android_system_properties",
"ash", "ash",
@@ -1164,7 +1164,7 @@ dependencies = [
[[package]] [[package]]
name = "bevy_mod_xr" name = "bevy_mod_xr"
version = "0.5.0" version = "0.5.0"
source = "git+https://git.avii.nl/Avii/bevy_oxr.git#aca40a0761d9a09111431b83a3ee2269bf3c55df" source = "git+https://github.com/awtterpip/bevy_oxr.git#93fe370f1203fab0c37e9ab5c393129111828466"
dependencies = [ dependencies = [
"bevy_app", "bevy_app",
"bevy_camera", "bevy_camera",
@@ -2403,7 +2403,7 @@ dependencies = [
"libc", "libc",
"option-ext", "option-ext",
"redox_users", "redox_users",
"windows-sys 0.61.2", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@@ -2650,7 +2650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -3474,9 +3474,9 @@ dependencies = [
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.89" version = "0.3.90"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4eacb0641a310445a4c513f2a5e23e19952e269c6a38887254d5f837a305506" checksum = "14dc6f6450b3f6d4ed5b16327f38fed626d375a886159ca555bd7822c0c3a5a6"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"wasm-bindgen", "wasm-bindgen",
@@ -3592,7 +3592,7 @@ checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616"
dependencies = [ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
"libc", "libc",
"redox_syscall 0.7.1", "redox_syscall 0.7.2",
] ]
[[package]] [[package]]
@@ -3692,6 +3692,15 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "memoffset"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
dependencies = [
"autocfg",
]
[[package]] [[package]]
name = "metal" name = "metal"
version = "0.32.0" version = "0.32.0"
@@ -3915,7 +3924,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@@ -4356,13 +4365,14 @@ dependencies = [
[[package]] [[package]]
name = "otd-ipc" name = "otd-ipc"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.avii.nl/Avii/otd-ipc-rs.git#e705b3e8391e6afa411cba4b6238083fb452d5e3" source = "git+https://git.avii.nl/Avii/otd-ipc-rs.git#bb3892a239412d95b954adb795407d6d0a244f07"
dependencies = [ dependencies = [
"bytes", "bytes",
"dirs", "dirs",
"serde", "serde",
"serde_bytes", "serde_bytes",
"slug", "slug",
"uds_windows",
] ]
[[package]] [[package]]
@@ -4797,9 +4807,9 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.7.1" version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35985aa610addc02e24fc232012c86fd11f14111180f902b67e2d5331f8ebf2b" checksum = "6d94dd2f7cd932d4dc02cc8b2b50dfd38bd079a4e5d79198b99743d7fcf9a4b4"
dependencies = [ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
] ]
@@ -4840,9 +4850,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.8.9" version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
[[package]] [[package]]
name = "renderdoc-sys" name = "renderdoc-sys"
@@ -4943,7 +4953,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.11.0", "linux-raw-sys 0.11.0",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -5303,6 +5313,19 @@ dependencies = [
"slotmap", "slotmap",
] ]
[[package]]
name = "tempfile"
version = "3.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1"
dependencies = [
"fastrand",
"getrandom 0.3.4",
"once_cell",
"rustix 1.1.3",
"windows-sys 0.52.0",
]
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.4.1" version = "1.4.1"
@@ -5575,6 +5598,17 @@ version = "1.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8c1ae7cc0fdb8b842d65d127cb981574b0d2b249b74d1c7a2986863dc134f71" checksum = "f8c1ae7cc0fdb8b842d65d127cb981574b0d2b249b74d1c7a2986863dc134f71"
[[package]]
name = "uds_windows"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"
dependencies = [
"memoffset",
"tempfile",
"winapi",
]
[[package]] [[package]]
name = "unicase" name = "unicase"
version = "2.9.0" version = "2.9.0"
@@ -5724,9 +5758,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.112" version = "0.2.113"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d7d0fce354c88b7982aec4400b3e7fcf723c32737cef571bd165f7613557ee" checksum = "60722a937f594b7fde9adb894d7c092fc1bb6612897c46368d18e7a20208eff2"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
@@ -5737,9 +5771,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-futures" name = "wasm-bindgen-futures"
version = "0.4.62" version = "0.4.63"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee85afca410ac4abba5b584b12e77ea225db6ee5471d0aebaae0861166f9378a" checksum = "8a89f4650b770e4521aa6573724e2aed4704372151bd0de9d16a3bbabb87441a"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"futures-util", "futures-util",
@@ -5751,9 +5785,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.112" version = "0.2.113"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55839b71ba921e4f75b674cb16f843f4b1f3b26ddfcb3454de1cf65cc021ec0f" checksum = "0fac8c6395094b6b91c4af293f4c79371c163f9a6f56184d2c9a85f5a95f3950"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@@ -5761,9 +5795,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.112" version = "0.2.113"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "caf2e969c2d60ff52e7e98b7392ff1588bffdd1ccd4769eba27222fd3d621571" checksum = "ab3fabce6159dc20728033842636887e4877688ae94382766e00b180abac9d60"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"proc-macro2", "proc-macro2",
@@ -5774,9 +5808,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.112" version = "0.2.113"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0861f0dcdf46ea819407495634953cdcc8a8c7215ab799a7a7ce366be71c7b30" checksum = "de0e091bdb824da87dc01d967388880d017a0a9bc4f3bdc0d86ee9f9336e3bb5"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@@ -5925,9 +5959,9 @@ dependencies = [
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.89" version = "0.3.90"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10053fbf9a374174094915bbce141e87a6bf32ecd9a002980db4b638405e8962" checksum = "705eceb4ce901230f8625bd1d665128056ccbe4b7408faa625eec1ba80f59a97"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@@ -6149,7 +6183,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -6459,6 +6493,15 @@ dependencies = [
"windows-targets 0.52.6", "windows-targets 0.52.6",
] ]
[[package]]
name = "windows-sys"
version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
dependencies = [
"windows-targets 0.53.5",
]
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.61.2" version = "0.61.2"
@@ -6492,13 +6535,30 @@ dependencies = [
"windows_aarch64_gnullvm 0.52.6", "windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6", "windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6", "windows_i686_gnu 0.52.6",
"windows_i686_gnullvm", "windows_i686_gnullvm 0.52.6",
"windows_i686_msvc 0.52.6", "windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6", "windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6", "windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6", "windows_x86_64_msvc 0.52.6",
] ]
[[package]]
name = "windows-targets"
version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
"windows-link 0.2.1",
"windows_aarch64_gnullvm 0.53.1",
"windows_aarch64_msvc 0.53.1",
"windows_i686_gnu 0.53.1",
"windows_i686_gnullvm 0.53.1",
"windows_i686_msvc 0.53.1",
"windows_x86_64_gnu 0.53.1",
"windows_x86_64_gnullvm 0.53.1",
"windows_x86_64_msvc 0.53.1",
]
[[package]] [[package]]
name = "windows-threading" name = "windows-threading"
version = "0.1.0" version = "0.1.0"
@@ -6529,6 +6589,12 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.42.2" version = "0.42.2"
@@ -6541,6 +6607,12 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_aarch64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.42.2" version = "0.42.2"
@@ -6553,12 +6625,24 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
[[package]] [[package]]
name = "windows_i686_gnullvm" name = "windows_i686_gnullvm"
version = "0.52.6" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.42.2" version = "0.42.2"
@@ -6571,6 +6655,12 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_i686_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.42.2" version = "0.42.2"
@@ -6583,6 +6673,12 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
version = "0.42.2" version = "0.42.2"
@@ -6595,6 +6691,12 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.42.2" version = "0.42.2"
@@ -6607,6 +6709,12 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "windows_x86_64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
[[package]] [[package]]
name = "winit" name = "winit"
version = "0.30.12" version = "0.30.12"

View File

@@ -8,8 +8,8 @@ license = "MIT/Apache-2.0"
[dependencies] [dependencies]
bevy = { version = "0.18", features = ["debug"] } bevy = { version = "0.18", features = ["debug"] }
# bevy_cef = { path = "../bevy_cef" } # bevy_cef = { path = "../bevy_cef" }
bevy_mod_xr = { git = "https://git.avii.nl/Avii/bevy_oxr.git", version = "0.5.0" } bevy_mod_xr = { git = "https://github.com/awtterpip/bevy_oxr.git", version = "0.5.0" }
bevy_mod_openxr = { git = "https://git.avii.nl/Avii/bevy_oxr.git", version = "0.5.0" } bevy_mod_openxr = { git = "https://github.com/awtterpip/bevy_oxr.git", version = "0.5.0" }
#bevy_mod_xr = { path = "../bevy_oxr/crates/bevy_xr" } #bevy_mod_xr = { path = "../bevy_oxr/crates/bevy_xr" }
#bevy_mod_openxr = { path = "../bevy_oxr/crates/bevy_openxr" } #bevy_mod_openxr = { path = "../bevy_oxr/crates/bevy_openxr" }

View File

@@ -1,13 +1,15 @@
use bevy::{ use bevy::{
asset::{Asset, Handle}, asset::{Asset, Handle, uuid_handle},
image::Image, image::Image,
pbr::{ExtendedMaterial, MaterialExtension, StandardMaterial}, pbr::{ExtendedMaterial, MaterialExtension, StandardMaterial},
reflect::TypePath, reflect::TypePath,
render::render_resource::AsBindGroup, render::render_resource::AsBindGroup,
shader::ShaderRef, shader::{Shader, ShaderRef},
}; };
const SHADER_ASSET_PATH: &str = "shaders/shader.wgsl"; // const SHADER_ASSET_PATH: &str = "shaders/shader.wgsl";
pub const FRAGMENT_SHADER_HANDLE: Handle<Shader> =
uuid_handle!("b70d4f0f-8873-4b2a-bc6f-35b0e3e25e02");
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)] #[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
pub struct CustomMaterial { pub struct CustomMaterial {
@@ -24,7 +26,7 @@ pub struct CustomMaterial {
/// You only need to implement functions for features that need non-default behavior. See the Material api docs for details! /// You only need to implement functions for features that need non-default behavior. See the Material api docs for details!
impl MaterialExtension for CustomMaterial { impl MaterialExtension for CustomMaterial {
fn fragment_shader() -> ShaderRef { fn fragment_shader() -> ShaderRef {
SHADER_ASSET_PATH.into() FRAGMENT_SHADER_HANDLE.into()
} }
} }

View File

@@ -6,7 +6,7 @@ use std::f32::consts::{FRAC_PI_2, PI};
use bevy::{ use bevy::{
app::{App, Plugin, Startup, Update}, app::{App, Plugin, Startup, Update},
asset::{Assets, Handle}, asset::{Assets, Handle, load_internal_asset},
camera::{Camera, Camera3d, RenderTarget, visibility::RenderLayers}, camera::{Camera, Camera3d, RenderTarget, visibility::RenderLayers},
color::{Color, palettes::css}, color::{Color, palettes::css},
ecs::{ ecs::{
@@ -24,6 +24,7 @@ use bevy::{
pbr::{MaterialPlugin, MeshMaterial3d, StandardMaterial}, pbr::{MaterialPlugin, MeshMaterial3d, StandardMaterial},
prelude::{Deref, DerefMut}, prelude::{Deref, DerefMut},
render::render_resource::{Extent3d, TextureUsages}, render::render_resource::{Extent3d, TextureUsages},
shader::Shader,
transform::components::Transform, transform::components::Transform,
utils::default, utils::default,
}; };
@@ -45,7 +46,7 @@ pub use crate::apad::otdipcplugin::TabletRotation;
use crate::{ use crate::{
MainCamera, MainCamera,
apad::{ apad::{
custom_material::{CustomMaterial, MyCustomMaterial}, custom_material::{CustomMaterial, FRAGMENT_SHADER_HANDLE, MyCustomMaterial},
keyboard::VirtualKeyboard, keyboard::VirtualKeyboard,
otdipcplugin::{OtdIpcPlugin, PenButtons, PenDelta, PenPosition}, otdipcplugin::{OtdIpcPlugin, PenButtons, PenDelta, PenPosition},
}, },
@@ -119,7 +120,6 @@ impl Plugin for APadPlugin {
.init_persistent_resource::<KneeboardNotepad>(); .init_persistent_resource::<KneeboardNotepad>();
app.insert_resource(TabletSize(Vec2::new(210.0, 279.0))); app.insert_resource(TabletSize(Vec2::new(210.0, 279.0)));
// app.insert_resource(TabletResolutionScale(2.25));
app.insert_resource(TabletResolutionScale(2.5)); app.insert_resource(TabletResolutionScale(2.5));
app.insert_resource(PointerImage(None)); app.insert_resource(PointerImage(None));
app.insert_resource(Name("".to_string())); app.insert_resource(Name("".to_string()));
@@ -141,6 +141,13 @@ impl Plugin for APadPlugin {
.add_systems(Update, update_pointer.in_set(EguiInputSet::WriteEguiEvents)) .add_systems(Update, update_pointer.in_set(EguiInputSet::WriteEguiEvents))
.add_systems(Update, render_pointer) .add_systems(Update, render_pointer)
.add_systems(WorldspaceContextPass, update); .add_systems(WorldspaceContextPass, update);
load_internal_asset!(
app,
FRAGMENT_SHADER_HANDLE,
"../../assets/shaders/shader.wgsl",
Shader::from_wgsl
);
} }
} }
@@ -566,8 +573,8 @@ fn move_kneeboard(
let rot_offset: Quat = Quat::from_axis_angle(Vec3::new(1.0, 0.0, 0.0), FRAC_PI_2) let rot_offset: Quat = Quat::from_axis_angle(Vec3::new(1.0, 0.0, 0.0), FRAC_PI_2)
* Quat::from_axis_angle(Vec3::new(0.0, 0.0, 1.0), PI); * Quat::from_axis_angle(Vec3::new(0.0, 0.0, 1.0), PI);
if let Ok(trigger_state) = left.squeeze_click.state(&session, Path::NULL) if let Ok(trigger_state) = left.squeeze.state(&session, Path::NULL)
&& trigger_state.current_state && trigger_state.current_state >= 1.0
{ {
let Ok(transform) = left_transform.single() else { let Ok(transform) = left_transform.single() else {
return; return;
@@ -578,8 +585,8 @@ fn move_kneeboard(
kneeboard.rotation = transform.rotation * rot_offset; kneeboard.rotation = transform.rotation * rot_offset;
} }
if let Ok(trigger_state) = right.squeeze_click.state(&session, Path::NULL) if let Ok(trigger_state) = right.squeeze.state(&session, Path::NULL)
&& trigger_state.current_state && trigger_state.current_state >= 1.0
{ {
let Ok(transform) = right_transform.single() else { let Ok(transform) = right_transform.single() else {
return; return;

View File

@@ -1,5 +1,7 @@
#![allow(unused)] #![allow(unused)]
use std::{thread::sleep, time::Duration};
use bevy::{ use bevy::{
app::{App, Plugin, PreUpdate}, app::{App, Plugin, PreUpdate},
ecs::{ ecs::{
@@ -69,11 +71,22 @@ impl Plugin for OtdIpcPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
let (mut tx, rx) = triple_buffer(&None); let (mut tx, rx) = triple_buffer(&None);
std::thread::spawn(move || { std::thread::spawn(move || {
let otd_ipc = OtdIpc::new("Kneeboard", "master").unwrap(); loop {
let Ok(otd_ipc) = OtdIpc::new("Kneeboard", "master") else {
sleep(Duration::from_secs(1));
continue;
};
for msg in otd_ipc { for msg in otd_ipc {
let Ok(msg) = msg else {
break;
};
tx.write(Some(msg)); tx.write(Some(msg));
} }
sleep(Duration::from_secs(1));
}
}); });
app.add_message::<PenDelta>(); app.add_message::<PenDelta>();
app.add_message::<PenPosition>(); app.add_message::<PenPosition>();
@@ -88,7 +101,6 @@ impl Plugin for OtdIpcPlugin {
} }
} }
#[allow(clippy::too_many_arguments)]
fn reader( fn reader(
rotation: Res<TabletRotation>, rotation: Res<TabletRotation>,
mut last_position: ResMut<LastPosition>, mut last_position: ResMut<LastPosition>,

View File

@@ -26,9 +26,16 @@ pub fn ordnance(ui: &mut Ui, data: &Res<Ordnance>, overview: &Res<super::Overvie
.size .size
.max(ui.spacing().interact_size.y); .max(ui.spacing().interact_size.y);
let mut cols = Vec::new(); let mut amount_cols = 0;
for _ in &data.flights { for group in &data.flights {
if group.len() > amount_cols {
amount_cols = group.len();
}
}
let mut cols = Vec::new();
for _ in 0..amount_cols {
cols.push(("", Column::remainder())); cols.push(("", Column::remainder()));
} }

View File

@@ -1,5 +1,13 @@
use bevy::prelude::*; use bevy::prelude::*;
use bevy_mod_openxr::prelude::*; use bevy_mod_openxr::{
action_binding::{OxrSendActionBindings, OxrSuggestActionBinding},
action_set_attaching::OxrAttachActionSet,
action_set_syncing::{OxrActionSetSyncSet, OxrSyncActionSet},
openxr_session_running,
resources::OxrInstance,
session::OxrSession,
};
// use bevy_mod_openxr::prelude::*;
use bevy_mod_xr::session::{XrSessionCreated, session_available}; use bevy_mod_xr::session::{XrSessionCreated, session_available};
use openxr::{Action, Posef, Vector2f}; use openxr::{Action, Posef, Vector2f};
@@ -9,9 +17,9 @@ pub struct LeftControllerActions {
pose: Action<Posef>, pose: Action<Posef>,
pub thumbstick: Action<Vector2f>, pub thumbstick: Action<Vector2f>,
pub trigger: Action<f32>, pub trigger: Action<f32>,
pub trigger_click: Action<bool>, // pub trigger_click: Action<bool>,
pub squeeze: Action<f32>, pub squeeze: Action<f32>,
pub squeeze_click: Action<bool>, // pub squeeze_click: Action<bool>,
} }
#[derive(Resource)] #[derive(Resource)]
@@ -20,9 +28,9 @@ pub struct RightControllerActions {
pose: Action<Posef>, pose: Action<Posef>,
pub thumbstick: Action<Vector2f>, pub thumbstick: Action<Vector2f>,
pub trigger: Action<f32>, pub trigger: Action<f32>,
pub trigger_click: Action<bool>, // pub trigger_click: Action<bool>,
pub squeeze: Action<f32>, pub squeeze: Action<f32>,
pub squeeze_click: Action<bool>, // pub squeeze_click: Action<bool>,
} }
#[derive(Component)] #[derive(Component)]
@@ -84,37 +92,37 @@ fn suggest_action_bindings_left(
) { ) {
bindings.write(OxrSuggestActionBinding { bindings.write(OxrSuggestActionBinding {
action: actions.pose.as_raw(), action: actions.pose.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/left/input/grip/pose".into()], bindings: vec!["/user/hand/left/input/grip/pose".into()],
}); });
bindings.write(OxrSuggestActionBinding { bindings.write(OxrSuggestActionBinding {
action: actions.trigger.as_raw(), action: actions.trigger.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/left/input/trigger/value".into()], bindings: vec!["/user/hand/left/input/trigger/value".into()],
}); });
bindings.write(OxrSuggestActionBinding { // bindings.write(OxrSuggestActionBinding {
action: actions.trigger_click.as_raw(), // action: actions.trigger_click.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), // interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/left/input/trigger/click".into()], // bindings: vec!["/user/hand/left/input/trigger/click".into()],
}); // });
bindings.write(OxrSuggestActionBinding { bindings.write(OxrSuggestActionBinding {
action: actions.squeeze.as_raw(), action: actions.squeeze.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/left/input/squeeze/value".into()], bindings: vec!["/user/hand/left/input/squeeze/value".into()],
}); });
bindings.write(OxrSuggestActionBinding { // bindings.write(OxrSuggestActionBinding {
action: actions.squeeze_click.as_raw(), // action: actions.squeeze_click.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), // interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/left/input/squeeze/click".into()], // bindings: vec!["/user/hand/left/input/squeeze/click".into()],
}); // });
bindings.write(OxrSuggestActionBinding { bindings.write(OxrSuggestActionBinding {
action: actions.thumbstick.as_raw(), action: actions.thumbstick.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/left/input/thumbstick".into()], bindings: vec!["/user/hand/left/input/thumbstick".into()],
}); });
} }
@@ -125,37 +133,37 @@ fn suggest_action_bindings_right(
) { ) {
bindings.write(OxrSuggestActionBinding { bindings.write(OxrSuggestActionBinding {
action: actions.pose.as_raw(), action: actions.pose.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/right/input/grip/pose".into()], bindings: vec!["/user/hand/right/input/grip/pose".into()],
}); });
bindings.write(OxrSuggestActionBinding { bindings.write(OxrSuggestActionBinding {
action: actions.trigger.as_raw(), action: actions.trigger.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/right/input/trigger/value".into()], bindings: vec!["/user/hand/right/input/trigger/value".into()],
}); });
bindings.write(OxrSuggestActionBinding { // bindings.write(OxrSuggestActionBinding {
action: actions.trigger_click.as_raw(), // action: actions.trigger_click.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), // interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/right/input/trigger/click".into()], // bindings: vec!["/user/hand/right/input/trigger/click".into()],
}); // });
bindings.write(OxrSuggestActionBinding { bindings.write(OxrSuggestActionBinding {
action: actions.squeeze.as_raw(), action: actions.squeeze.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/right/input/squeeze/value".into()], bindings: vec!["/user/hand/right/input/squeeze/value".into()],
}); });
bindings.write(OxrSuggestActionBinding { // bindings.write(OxrSuggestActionBinding {
action: actions.squeeze_click.as_raw(), // action: actions.squeeze_click.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), // interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/right/input/squeeze/click".into()], // bindings: vec!["/user/hand/right/input/squeeze/click".into()],
}); // });
bindings.write(OxrSuggestActionBinding { bindings.write(OxrSuggestActionBinding {
action: actions.thumbstick.as_raw(), action: actions.thumbstick.as_raw(),
interaction_profile: "/interaction_profiles/bytedance/pico4_controller".into(), interaction_profile: "/interaction_profiles/oculus/touch_controller".into(),
bindings: vec!["/user/hand/right/input/thumbstick".into()], bindings: vec!["/user/hand/right/input/thumbstick".into()],
}); });
} }
@@ -166,13 +174,13 @@ fn create_actions_left(instance: Res<OxrInstance>, mut cmds: Commands) {
.unwrap(); .unwrap();
let pose = set.create_action("pose", "Grip Pose", &[]).unwrap(); let pose = set.create_action("pose", "Grip Pose", &[]).unwrap();
let trigger = set.create_action("trigger", "Trigger", &[]).unwrap(); let trigger = set.create_action("trigger", "Trigger", &[]).unwrap();
let trigger_click = set // let trigger_click = set
.create_action("trigger_click", "Trigger Click", &[]) // .create_action("trigger_click", "Trigger Click", &[])
.unwrap(); // .unwrap();
let squeeze = set.create_action("squeeze", "Squeeze", &[]).unwrap(); let squeeze = set.create_action("squeeze", "Squeeze", &[]).unwrap();
let squeeze_click = set // let squeeze_click = set
.create_action("squeeze_click", "Squeeze Click", &[]) // .create_action("squeeze_click", "Squeeze Click", &[])
.unwrap(); // .unwrap();
let thumbstick = set.create_action("thumbstick", "Thumbstick", &[]).unwrap(); let thumbstick = set.create_action("thumbstick", "Thumbstick", &[]).unwrap();
cmds.insert_resource(LeftControllerActions { cmds.insert_resource(LeftControllerActions {
@@ -180,9 +188,9 @@ fn create_actions_left(instance: Res<OxrInstance>, mut cmds: Commands) {
pose, pose,
thumbstick, thumbstick,
trigger, trigger,
trigger_click, // trigger_click,
squeeze, squeeze,
squeeze_click, // squeeze_click,
}) })
} }
@@ -192,13 +200,13 @@ fn create_actions_right(instance: Res<OxrInstance>, mut cmds: Commands) {
.unwrap(); .unwrap();
let pose = set.create_action("pose", "Grip Pose", &[]).unwrap(); let pose = set.create_action("pose", "Grip Pose", &[]).unwrap();
let trigger = set.create_action("trigger", "Trigger", &[]).unwrap(); let trigger = set.create_action("trigger", "Trigger", &[]).unwrap();
let trigger_click = set // let trigger_click = set
.create_action("trigger_click", "Trigger Click", &[]) // .create_action("trigger_click", "Trigger Click", &[])
.unwrap(); // .unwrap();
let squeeze = set.create_action("squeeze", "Squeeze", &[]).unwrap(); let squeeze = set.create_action("squeeze", "Squeeze", &[]).unwrap();
let squeeze_click = set // let squeeze_click = set
.create_action("squeeze_click", "Squeeze Click", &[]) // .create_action("squeeze_click", "Squeeze Click", &[])
.unwrap(); // .unwrap();
let thumbstick = set.create_action("thumbstick", "Thumbstick", &[]).unwrap(); let thumbstick = set.create_action("thumbstick", "Thumbstick", &[]).unwrap();
cmds.insert_resource(RightControllerActions { cmds.insert_resource(RightControllerActions {
@@ -206,9 +214,9 @@ fn create_actions_right(instance: Res<OxrInstance>, mut cmds: Commands) {
pose, pose,
thumbstick, thumbstick,
trigger, trigger,
trigger_click, // trigger_click,
squeeze, squeeze,
squeeze_click, // squeeze_click,
}) })
} }

View File

@@ -3,8 +3,13 @@ use bevy::{
render::render_resource::TextureFormat, render::render_resource::TextureFormat,
window::{PresentMode, WindowResolution}, window::{PresentMode, WindowResolution},
}; };
use bevy_mod_openxr::prelude::*; use bevy_mod_openxr::{
add_xr_plugins, exts::OxrExtensions, features::handtracking::HandTrackingPlugin,
init::OxrInitPlugin, resources::OxrSessionConfig, session::OxrSession,
};
// use bevy_mod_openxr::prelude::*;
use bevy_mod_xr::session::XrSessionCreated; use bevy_mod_xr::session::XrSessionCreated;
use openxr::EnvironmentBlendMode;
use crate::vrcontrollerplugin::VrControllersPlugin; use crate::vrcontrollerplugin::VrControllersPlugin;
@@ -31,7 +36,13 @@ impl Plugin for VrPlugin {
app.insert_resource(ClearColor(Color::NONE)) app.insert_resource(ClearColor(Color::NONE))
.insert_resource(OxrSessionConfig { .insert_resource(OxrSessionConfig {
blend_mode_preference: { vec![EnvironmentBlendMode::ALPHA_BLEND] }, blend_mode_preference: {
vec![
EnvironmentBlendMode::ALPHA_BLEND,
EnvironmentBlendMode::OPAQUE,
EnvironmentBlendMode::ADDITIVE,
]
},
formats: Some(vec![TextureFormat::Rgba8UnormSrgb]), formats: Some(vec![TextureFormat::Rgba8UnormSrgb]),
..Default::default() ..Default::default()
}); });