diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index d262b49..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build -on: - push: - branches: - - "main" - paths-ignore: - - "/docs" - - "README.md" - pull_request: - paths-ignore: - - "/docs" - - "README.md" -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: "Checkout" - uses: actions/checkout@v3 - - name: "Cache" - uses: Swatinem/rust-cache@v2 - - name: "External dependencies" - run: sudo apt-get update -y && sudo apt-get install -y libasound2-dev portaudio19-dev build-essential libpulse-dev libdbus-1-dev libudev-dev libopenxr-loader1 libopenxr-dev - - name: "Checks" - run: | - cargo fmt --check --all - #cargo clippy --no-deps --tests -- -D warnings - #cargo rustdoc -- -D warnings - - name: "Build" - run: | - cargo build - cargo build --examples - - name: "Test" - run: | - cargo test --verbose diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 3c58277..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,5758 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ab_glyph" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser", -] - -[[package]] -name = "ab_glyph_rasterizer" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" - -[[package]] -name = "accesskit" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb10ed32c63247e4e39a8f42e8e30fb9442fbf7878c8e4a9849e7e381619bea" - -[[package]] -name = "accesskit" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cf780eb737f2d4a49ffbd512324d53ad089070f813f7be7f99dbd5123a7f448" - -[[package]] -name = "accesskit_consumer" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" -dependencies = [ - "accesskit 0.12.2", -] - -[[package]] -name = "accesskit_consumer" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdfa1638ddd6eb9c752def95568df8b3ad832df252e9156d2eb783b201ca8a9" -dependencies = [ - "accesskit 0.14.0", - "immutable-chunkmap", -] - -[[package]] -name = "accesskit_macos" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" -dependencies = [ - "accesskit 0.12.2", - "accesskit_consumer 0.16.1", - "objc2 0.3.0-beta.3.patch-leaks.3", - "once_cell", -] - -[[package]] -name = "accesskit_macos" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c236a84ff1111defc280cee755eaa953d0b24398786851b9d28322c6d3bb1ebd" -dependencies = [ - "accesskit 0.14.0", - "accesskit_consumer 0.22.0", - "objc2 0.5.2", - "objc2-app-kit", - "objc2-foundation", - "once_cell", -] - -[[package]] -name = "accesskit_windows" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" -dependencies = [ - "accesskit 0.12.2", - "accesskit_consumer 0.16.1", - "once_cell", - "paste", - "static_assertions", - "windows 0.48.0", -] - -[[package]] -name = "accesskit_windows" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7f43d24b16b3e76bef248124fbfd2493c3a9860edb5aae1010c890e826de5e" -dependencies = [ - "accesskit 0.14.0", - "accesskit_consumer 0.22.0", - "paste", - "static_assertions", - "windows 0.54.0", -] - -[[package]] -name = "accesskit_winit" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f8f7c9f66d454d5fd8e344c8c8c7324b57194e1041b955519fc58a01e77a25" -dependencies = [ - "accesskit 0.12.2", - "accesskit_macos 0.10.1", - "accesskit_windows 0.15.1", - "raw-window-handle", - "winit 0.29.10", -] - -[[package]] -name = "accesskit_winit" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755535e6bf711a42dac28b888b884b10fc00ff4010d9d3bd871c5f5beae5aa78" -dependencies = [ - "accesskit 0.14.0", - "accesskit_macos 0.15.0", - "accesskit_windows 0.20.0", - "raw-window-handle", - "winit 0.30.3", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "alsa" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37fe60779335388a88c01ac6c3be40304d1e349de3ada3b15f7808bb90fa9dce" -dependencies = [ - "alsa-sys", - "bitflags 2.5.0", - "libc", -] - -[[package]] -name = "alsa-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "android-activity" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" -dependencies = [ - "android-properties", - "bitflags 2.5.0", - "cc", - "cesu8", - "jni 0.21.1", - "jni-sys", - "libc", - "log", - "ndk 0.8.0", - "ndk-context", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum", - "thiserror", -] - -[[package]] -name = "android-activity" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" -dependencies = [ - "android-properties", - "bitflags 2.5.0", - "cc", - "cesu8", - "jni 0.21.1", - "jni-sys", - "libc", - "log", - "ndk 0.9.0", - "ndk-context", - "ndk-sys 0.6.0+11769913", - "num_enum", - "thiserror", -] - -[[package]] -name = "android-properties" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" - -[[package]] -name = "android_log-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "as-raw-xcb-connection" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" - -[[package]] -name = "ash" -version = "0.37.3+1.3.251" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" -dependencies = [ - "libloading 0.7.4", -] - -[[package]] -name = "async-broadcast" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" -dependencies = [ - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" -dependencies = [ - "concurrent-queue", - "event-listener 5.1.0", - "event-listener-strategy 0.5.0", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "slab", -] - -[[package]] -name = "async-fs" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc19683171f287921f2405677dd2ed2549c3b3bda697a563ebc3a121ace2aba1" -dependencies = [ - "async-lock", - "blocking", - "futures-lite", -] - -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - -[[package]] -name = "async-task" -version = "4.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bevy" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611dd99f412e862610adb43e2243b16436c6d8009f6d9dbe8ce3d6d840b34029" -dependencies = [ - "bevy_internal 0.13.0", -] - -[[package]] -name = "bevy" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e938630e9f472b1899c78ef84aa907081b23bad8333140e2295c620485b6ee7" -dependencies = [ - "bevy_internal 0.14.0", -] - -[[package]] -name = "bevy_a11y" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8ef2795f7f5c816a4eda04834083eb5a92e8fef603bc21d2091c6e3b63621a" -dependencies = [ - "accesskit 0.12.2", - "bevy_app 0.13.2", - "bevy_derive 0.13.2", - "bevy_ecs 0.13.2", -] - -[[package]] -name = "bevy_a11y" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e613f0e7d5a92637e59744f7185e374c9a59654ecc6d7575adcec9581db1363" -dependencies = [ - "accesskit 0.14.0", - "bevy_app 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", -] - -[[package]] -name = "bevy_animation" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23aa4141df149b743e69c90244261c6372bafb70d9f115885de48a75fc28fd9b" -dependencies = [ - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_core 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_log 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_time 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "blake3", - "fixedbitset 0.5.7", - "petgraph", - "ron", - "serde", - "thiserror", - "thread_local", - "uuid", -] - -[[package]] -name = "bevy_app" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab348a32e46d21c5d61794294a92d415a770d26c7ba8951830b127b40b53ccc4" -dependencies = [ - "bevy_derive 0.13.2", - "bevy_ecs 0.13.2", - "bevy_reflect 0.13.2", - "bevy_tasks 0.13.2", - "bevy_utils 0.13.2", - "downcast-rs", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "bevy_app" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f548e9dab7d10c5f99e3b504c758c4bf87aa67df9bcb9cc8b317a0271770e72" -dependencies = [ - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_reflect 0.14.0", - "bevy_tasks 0.14.0", - "bevy_utils 0.14.0", - "console_error_panic_hook", - "downcast-rs", - "thiserror", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "bevy_asset" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50028e0d4f28a9f6aab48f61b688ba2793141188f88cdc9aa6c2bca2cc02ad35" -dependencies = [ - "async-broadcast", - "async-fs", - "async-lock", - "bevy_app 0.13.2", - "bevy_asset_macros 0.13.2", - "bevy_ecs 0.13.2", - "bevy_log 0.13.2", - "bevy_reflect 0.13.2", - "bevy_tasks 0.13.2", - "bevy_utils 0.13.2", - "bevy_winit 0.13.2", - "blake3", - "crossbeam-channel", - "downcast-rs", - "futures-io", - "futures-lite", - "js-sys", - "parking_lot", - "ron", - "serde", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "bevy_asset" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d198e4c3419215de2ad981d4e734bbfab46469b7575e3b7150c912b9ec5175" -dependencies = [ - "async-broadcast", - "async-fs", - "async-lock", - "bevy_app 0.14.0", - "bevy_asset_macros 0.14.0", - "bevy_ecs 0.14.0", - "bevy_reflect 0.14.0", - "bevy_tasks 0.14.0", - "bevy_utils 0.14.0", - "bevy_winit 0.14.0", - "blake3", - "crossbeam-channel", - "downcast-rs", - "futures-io", - "futures-lite", - "js-sys", - "parking_lot", - "ron", - "serde", - "thiserror", - "uuid", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "bevy_asset_macros" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6617475908368418d815360148fdbb82f879dc255a70d2d7baa3766f0cd4bfd7" -dependencies = [ - "bevy_macro_utils 0.13.2", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_asset_macros" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b2cbeba287a4b44e116c33dbaf37dce80a9d84477b2bb35ff459999d6c9e1b" -dependencies = [ - "bevy_macro_utils 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_audio" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e41ecf15d0aae31bdb6d2b5cc590f966451e9736ddfee634c8f1ca5af1ac4342" -dependencies = [ - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "cpal", - "rodio", -] - -[[package]] -name = "bevy_color" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a933306f5c7dc9568209180f482b28b5f40d2f8d5b361bc1b270c0a588752c0" -dependencies = [ - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bytemuck", - "encase 0.8.0", - "serde", - "thiserror", - "wgpu-types 0.20.0", -] - -[[package]] -name = "bevy_core" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b0042f241ba7cd61487aadd8addfb56f7eeb662d713ac1577026704508fc6c" -dependencies = [ - "bevy_app 0.13.2", - "bevy_ecs 0.13.2", - "bevy_math 0.13.2", - "bevy_reflect 0.13.2", - "bevy_tasks 0.13.2", - "bevy_utils 0.13.2", - "bytemuck", -] - -[[package]] -name = "bevy_core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ddeed5ebf2fa75a4d4f32e2da9c60f11037e36252695059a151c6685cd3d72b" -dependencies = [ - "bevy_app 0.14.0", - "bevy_ecs 0.14.0", - "bevy_reflect 0.14.0", - "bevy_tasks 0.14.0", - "bevy_utils 0.14.0", - "uuid", -] - -[[package]] -name = "bevy_core_pipeline" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626a5aaadbdd69eae020c5856575d2d0113423ae1ae1351377e20956d940052c" -dependencies = [ - "bevy_app 0.13.2", - "bevy_asset 0.13.2", - "bevy_core 0.13.2", - "bevy_derive 0.13.2", - "bevy_ecs 0.13.2", - "bevy_log 0.13.2", - "bevy_math 0.13.2", - "bevy_reflect 0.13.2", - "bevy_render 0.13.2", - "bevy_transform 0.13.2", - "bevy_utils 0.13.2", - "bitflags 2.5.0", - "radsort", - "serde", -] - -[[package]] -name = "bevy_core_pipeline" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b978220b5edc98f2c5cbbd14c118c74b3ec7216e5416d3c187c1097279b009b" -dependencies = [ - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_core 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "bitflags 2.5.0", - "nonmax", - "radsort", - "serde", - "smallvec", - "thiserror", -] - -[[package]] -name = "bevy_derive" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e01f8343f391e2d6a63b368b82fb5b252ed43c8713fc87f9a8f2d59407dd00" -dependencies = [ - "bevy_macro_utils 0.13.2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8a8173bad3ed53fa158806b1beda147263337d6ef71a093780dd141b74386b1" -dependencies = [ - "bevy_macro_utils 0.14.0", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_diagnostic" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a104acfdc5280accd01a3524810daf3bda72924e3da0c8a9ec816a57eef4e3" -dependencies = [ - "bevy_app 0.13.2", - "bevy_core 0.13.2", - "bevy_ecs 0.13.2", - "bevy_log 0.13.2", - "bevy_time 0.13.2", - "bevy_utils 0.13.2", - "const-fnv1a-hash", - "sysinfo", -] - -[[package]] -name = "bevy_diagnostic" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7f82011fd70048be282526a99756d54bf00e874edafa9664ba0dc247678f03" -dependencies = [ - "bevy_app 0.14.0", - "bevy_core 0.14.0", - "bevy_ecs 0.14.0", - "bevy_tasks 0.14.0", - "bevy_time 0.14.0", - "bevy_utils 0.14.0", - "const-fnv1a-hash", - "sysinfo", -] - -[[package]] -name = "bevy_ecs" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98e612a8e7962ead849e370f3a7e972b88df879ced05cd9dad6a0286d14650cf" -dependencies = [ - "async-channel", - "bevy_ecs_macros 0.13.2", - "bevy_ptr 0.13.2", - "bevy_reflect 0.13.2", - "bevy_tasks 0.13.2", - "bevy_utils 0.13.2", - "downcast-rs", - "fixedbitset 0.4.2", - "rustc-hash", - "serde", - "thiserror", - "thread_local", -] - -[[package]] -name = "bevy_ecs" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c77fdc3a7230eff2fcebe4bd17c155bd238c660a0089d0f98c39ba0d461b923" -dependencies = [ - "arrayvec", - "bevy_ecs_macros 0.14.0", - "bevy_ptr 0.14.0", - "bevy_reflect 0.14.0", - "bevy_tasks 0.14.0", - "bevy_utils 0.14.0", - "bitflags 2.5.0", - "concurrent-queue", - "fixedbitset 0.5.7", - "nonmax", - "petgraph", - "serde", - "thiserror", -] - -[[package]] -name = "bevy_ecs_macros" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807b5106c3410e58f4f523b55ea3c071e2a09e31e9510f3c22021c6a04732b5b" -dependencies = [ - "bevy_macro_utils 0.13.2", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_ecs_macros" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272b511958525306cd141726d3ca59740f79fc0707c439b55a007bcc3497308" -dependencies = [ - "bevy_macro_utils 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_encase_derive" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887087a5e522d9f20733a84dd7e6e9ca04cd8fdfac659220ed87d675eebc83a7" -dependencies = [ - "bevy_macro_utils 0.13.2", - "encase_derive_impl 0.7.0", -] - -[[package]] -name = "bevy_encase_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0452d8254c8bfae4bff6caca2a8be3b0c1b2e1a72b93e9b9f6a21c8dff807e0" -dependencies = [ - "bevy_macro_utils 0.14.0", - "encase_derive_impl 0.8.0", -] - -[[package]] -name = "bevy_gilrs" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbad8e59470c3d5cf25aa8c48462c4cf6f0c6314538c68ab2f5cf393146f0fc2" -dependencies = [ - "bevy_app 0.14.0", - "bevy_ecs 0.14.0", - "bevy_input 0.14.0", - "bevy_time 0.14.0", - "bevy_utils 0.14.0", - "gilrs", - "thiserror", -] - -[[package]] -name = "bevy_gizmos" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdca80b7b4db340eb666d69374a0195b3935759120d0b990fcef8b27d0fb3680" -dependencies = [ - "bevy_app 0.13.2", - "bevy_asset 0.13.2", - "bevy_core 0.13.2", - "bevy_core_pipeline 0.13.0", - "bevy_ecs 0.13.2", - "bevy_gizmos_macros 0.13.0", - "bevy_log 0.13.2", - "bevy_math 0.13.2", - "bevy_pbr 0.13.0", - "bevy_reflect 0.13.2", - "bevy_render 0.13.2", - "bevy_transform 0.13.2", - "bevy_utils 0.13.2", -] - -[[package]] -name = "bevy_gizmos" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbb0556f0c6e45f4a17aef9c708c06ebf15ae1bed4533d7eddb493409f9f025" -dependencies = [ - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_core_pipeline 0.14.0", - "bevy_ecs 0.14.0", - "bevy_gizmos_macros 0.14.0", - "bevy_math 0.14.0", - "bevy_pbr 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_sprite", - "bevy_time 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "bytemuck", -] - -[[package]] -name = "bevy_gizmos_macros" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a949eb8b4538a6e4d875321cda2b63dc0fb0317cf18c8245ca5a32f24f6d26d" -dependencies = [ - "bevy_macro_utils 0.13.2", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_gizmos_macros" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ef351a4b6498c197d1317c62f46ba84b69fbde3dbeb57beb2e744bbe5b7c3e0" -dependencies = [ - "bevy_macro_utils 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_gltf" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd7abeaf3f28afd1f8999c2169aa17b40a37ad11253cf7dd05017024b65adc6" -dependencies = [ - "base64 0.22.1", - "bevy_animation", - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_core 0.14.0", - "bevy_core_pipeline 0.14.0", - "bevy_ecs 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_math 0.14.0", - "bevy_pbr 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_scene 0.14.0", - "bevy_tasks 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "gltf", - "percent-encoding", - "serde", - "serde_json", - "smallvec", - "thiserror", -] - -[[package]] -name = "bevy_hierarchy" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb3dfad24866a6713dafa3065a91c5cf5e355f6e1b191c25d704ae54185246c" -dependencies = [ - "bevy_app 0.13.2", - "bevy_core 0.13.2", - "bevy_ecs 0.13.2", - "bevy_log 0.13.2", - "bevy_reflect 0.13.2", - "bevy_utils 0.13.2", -] - -[[package]] -name = "bevy_hierarchy" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802eca6f341d19ade790ccfaba7044be4d823b708087eb5ac4c1f74e4ea0916a" -dependencies = [ - "bevy_app 0.14.0", - "bevy_core 0.14.0", - "bevy_ecs 0.14.0", - "bevy_reflect 0.14.0", - "bevy_utils 0.14.0", - "smallvec", -] - -[[package]] -name = "bevy_input" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47f2b2b3df168c6ef661d25e09abf5bd4fecaacd400f27e5db650df1c3fa3a3b" -dependencies = [ - "bevy_app 0.13.2", - "bevy_ecs 0.13.2", - "bevy_math 0.13.2", - "bevy_reflect 0.13.2", - "bevy_utils 0.13.2", - "smol_str", - "thiserror", -] - -[[package]] -name = "bevy_input" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d050f1433f48ca23f1ea078734ebff119a3f76eb7d221725ab0f1fd9f81230b" -dependencies = [ - "bevy_app 0.14.0", - "bevy_ecs 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_utils 0.14.0", - "smol_str", - "thiserror", -] - -[[package]] -name = "bevy_internal" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7af89c7083830b1d65fcf0260c3d2537c397fe8ce871471b6e97198a4704f23e" -dependencies = [ - "bevy_a11y 0.13.2", - "bevy_app 0.13.2", - "bevy_asset 0.13.2", - "bevy_core 0.13.2", - "bevy_core_pipeline 0.13.0", - "bevy_derive 0.13.2", - "bevy_diagnostic 0.13.0", - "bevy_ecs 0.13.2", - "bevy_gizmos 0.13.0", - "bevy_hierarchy 0.13.2", - "bevy_input 0.13.2", - "bevy_log 0.13.2", - "bevy_math 0.13.2", - "bevy_pbr 0.13.0", - "bevy_ptr 0.13.2", - "bevy_reflect 0.13.2", - "bevy_render 0.13.2", - "bevy_scene 0.13.0", - "bevy_tasks 0.13.2", - "bevy_time 0.13.2", - "bevy_transform 0.13.2", - "bevy_utils 0.13.2", - "bevy_window 0.13.2", -] - -[[package]] -name = "bevy_internal" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ddd2b23e44d3a1f8ae547cbee5b6661f8135cc456c5de206e8648789944e7a1" -dependencies = [ - "bevy_a11y 0.14.0", - "bevy_animation", - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_audio", - "bevy_color", - "bevy_core 0.14.0", - "bevy_core_pipeline 0.14.0", - "bevy_derive 0.14.0", - "bevy_diagnostic 0.14.0", - "bevy_ecs 0.14.0", - "bevy_gilrs", - "bevy_gizmos 0.14.0", - "bevy_gltf", - "bevy_hierarchy 0.14.0", - "bevy_input 0.14.0", - "bevy_log 0.14.0", - "bevy_math 0.14.0", - "bevy_pbr 0.14.0", - "bevy_ptr 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_scene 0.14.0", - "bevy_sprite", - "bevy_state", - "bevy_tasks 0.14.0", - "bevy_text", - "bevy_time 0.14.0", - "bevy_transform 0.14.0", - "bevy_ui", - "bevy_utils 0.14.0", - "bevy_window 0.14.0", - "bevy_winit 0.14.0", -] - -[[package]] -name = "bevy_log" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5eea6c527fd828b7fef8d0f518167f27f405b904a16f227b644687d3f46a809" -dependencies = [ - "android_log-sys", - "bevy_app 0.13.2", - "bevy_ecs 0.13.2", - "bevy_utils 0.13.2", - "console_error_panic_hook", - "tracing-log 0.1.4", - "tracing-subscriber", - "tracing-wasm", -] - -[[package]] -name = "bevy_log" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab641fd0de254915ab746165a07677465b2d89b72f5b49367d73b9197548a35" -dependencies = [ - "android_log-sys", - "bevy_app 0.14.0", - "bevy_ecs 0.14.0", - "bevy_utils 0.14.0", - "tracing-log 0.2.0", - "tracing-subscriber", - "tracing-wasm", -] - -[[package]] -name = "bevy_macro_utils" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb270c98a96243b29465139ed10bda2f675d00a11904f6588a5f7fc4774119c7" -dependencies = [ - "proc-macro2", - "quote", - "rustc-hash", - "syn 2.0.50", - "toml_edit 0.21.1", -] - -[[package]] -name = "bevy_macro_utils" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ad860d35d74b35d4d6ae7f656d163b6f475aa2e64fc293ee86ac901977ddb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", - "toml_edit 0.22.12", -] - -[[package]] -name = "bevy_math" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f06daa26ffb82d90ba772256c0ba286f6c305c392f6976c9822717974805837c" -dependencies = [ - "glam 0.25.0", - "serde", -] - -[[package]] -name = "bevy_math" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bd6ce2174d3237d30e0ab5b2508480cc7593ca4d96ffb3a3095f9fc6bbc34c" -dependencies = [ - "bevy_reflect 0.14.0", - "glam 0.27.0", - "rand", - "smallvec", - "thiserror", -] - -[[package]] -name = "bevy_mikktspace" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d7ef7f2a826d0b19f059035831ce00a5e930435cc53c61e045773d0483f67a" -dependencies = [ - "glam 0.25.0", -] - -[[package]] -name = "bevy_mikktspace" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ce4266293629a2d10459cc112dffe3b3e9229a4f2b8a4d20061b8dd53316d0" -dependencies = [ - "glam 0.27.0", -] - -[[package]] -name = "bevy_openxr_android" -version = "0.1.0" -dependencies = [ - "bevy 0.14.0", - "bevy_oxr", - "openxr", -] - -[[package]] -name = "bevy_oxr" -version = "0.2.0" -dependencies = [ - "ash", - "bevy 0.14.0", - "color-eyre", - "d3d12 0.20.0", - "eyre", - "futures-lite", - "jni 0.20.0", - "mint", - "ndk-context", - "openxr", - "wgpu 0.20.1", - "wgpu-core 0.21.0", - "wgpu-hal 0.21.0", - "winapi", -] - -[[package]] -name = "bevy_pbr" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31c72bf12e50ff76c9ed9a7c51ceb88bfea9865d00f24d95b12344fffe1e270" -dependencies = [ - "bevy_app 0.13.2", - "bevy_asset 0.13.2", - "bevy_core_pipeline 0.13.0", - "bevy_derive 0.13.2", - "bevy_ecs 0.13.2", - "bevy_math 0.13.2", - "bevy_reflect 0.13.2", - "bevy_render 0.13.2", - "bevy_transform 0.13.2", - "bevy_utils 0.13.2", - "bevy_window 0.13.2", - "bitflags 2.5.0", - "bytemuck", - "fixedbitset 0.4.2", - "radsort", - "smallvec", - "thread_local", -] - -[[package]] -name = "bevy_pbr" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3effe8ff28899f14d250d0649ca9868dbe68b389d0f2b7af086759b8e16c6e3d" -dependencies = [ - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_core_pipeline 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "bevy_window 0.14.0", - "bitflags 2.5.0", - "bytemuck", - "fixedbitset 0.5.7", - "nonmax", - "radsort", - "smallvec", - "static_assertions", -] - -[[package]] -name = "bevy_ptr" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8050e2869fe341db6874203b5a01ff12673807a2c7c80cb829f6c7bea6997268" - -[[package]] -name = "bevy_ptr" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c115c97a5c8a263bd0aa7001b999772c744ac5ba797d07c86f25734ce381ea69" - -[[package]] -name = "bevy_rapier3d" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac2b344d110e8aff2dab7ca6ed428dfcbbfeeb8f20827825996538f24e7fcdf" -dependencies = [ - "bevy 0.13.0", - "bitflags 2.5.0", - "log", - "nalgebra", - "rapier3d", -] - -[[package]] -name = "bevy_reflect" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccbd7de21d586457a340a0962ad0747dc5098ff925eb6b27a918c4bdd8252f7b" -dependencies = [ - "bevy_math 0.13.2", - "bevy_ptr 0.13.2", - "bevy_reflect_derive 0.13.2", - "bevy_utils 0.13.2", - "downcast-rs", - "erased-serde", - "glam 0.25.0", - "serde", - "smol_str", - "thiserror", -] - -[[package]] -name = "bevy_reflect" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406ea0fce267169c2320c7302d97d09f605105686346762562c5f65960b5ca2f" -dependencies = [ - "bevy_ptr 0.14.0", - "bevy_reflect_derive 0.14.0", - "bevy_utils 0.14.0", - "downcast-rs", - "erased-serde", - "glam 0.27.0", - "petgraph", - "serde", - "smallvec", - "smol_str", - "thiserror", - "uuid", -] - -[[package]] -name = "bevy_reflect_derive" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce33051bd49036d4a5a62aa3f2068672ec55f3ebe92aa0d003a341f15cc37ac" -dependencies = [ - "bevy_macro_utils 0.13.2", - "proc-macro2", - "quote", - "syn 2.0.50", - "uuid", -] - -[[package]] -name = "bevy_reflect_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0427fdb4425fc72cc96d45e550df83ace6347f0503840de116c76a40843ba751" -dependencies = [ - "bevy_macro_utils 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.50", - "uuid", -] - -[[package]] -name = "bevy_render" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b2c4b644c739c0b474b6f8f7b0bc68ac13d83b59688781e9a7753c52780177" -dependencies = [ - "async-channel", - "bevy_app 0.13.2", - "bevy_asset 0.13.2", - "bevy_core 0.13.2", - "bevy_derive 0.13.2", - "bevy_ecs 0.13.2", - "bevy_encase_derive 0.13.2", - "bevy_hierarchy 0.13.2", - "bevy_log 0.13.2", - "bevy_math 0.13.2", - "bevy_mikktspace 0.13.2", - "bevy_reflect 0.13.2", - "bevy_render_macros 0.13.2", - "bevy_tasks 0.13.2", - "bevy_time 0.13.2", - "bevy_transform 0.13.2", - "bevy_utils 0.13.2", - "bevy_window 0.13.2", - "bitflags 2.5.0", - "bytemuck", - "codespan-reporting", - "downcast-rs", - "encase 0.7.0", - "futures-lite", - "hexasphere 10.0.0", - "image 0.24.8", - "js-sys", - "naga 0.19.0", - "naga_oil 0.13.0", - "serde", - "thiserror", - "thread_local", - "wasm-bindgen", - "web-sys", - "wgpu 0.19.4", -] - -[[package]] -name = "bevy_render" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c48acf1ff4267c231def4cbf573248d42ac60c9952108822d505019460bf36d" -dependencies = [ - "async-channel", - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_core 0.14.0", - "bevy_derive 0.14.0", - "bevy_diagnostic 0.14.0", - "bevy_ecs 0.14.0", - "bevy_encase_derive 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_math 0.14.0", - "bevy_mikktspace 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render_macros 0.14.0", - "bevy_tasks 0.14.0", - "bevy_time 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "bevy_window 0.14.0", - "bitflags 2.5.0", - "bytemuck", - "codespan-reporting", - "downcast-rs", - "encase 0.8.0", - "futures-lite", - "hexasphere 12.0.0", - "image 0.25.1", - "js-sys", - "ktx2", - "naga 0.20.0", - "naga_oil 0.14.0", - "nonmax", - "ruzstd", - "send_wrapper", - "serde", - "smallvec", - "thiserror", - "wasm-bindgen", - "web-sys", - "wgpu 0.20.1", -] - -[[package]] -name = "bevy_render_macros" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720b88406e786e378829b7d43c1ffb5300186912b99904d0d4d8ec6698a4f210" -dependencies = [ - "bevy_macro_utils 0.13.2", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_render_macros" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ddf4a96d71519c8eca3d74dabcb89a9c0d50ab5d9230638cb004145f46e9ed" -dependencies = [ - "bevy_macro_utils 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_scene" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3c82eaff0b22949183a75a7e2d7fc4ece808235918b34c5b282aab52c3563a" -dependencies = [ - "bevy_app 0.13.2", - "bevy_asset 0.13.2", - "bevy_derive 0.13.2", - "bevy_ecs 0.13.2", - "bevy_hierarchy 0.13.2", - "bevy_reflect 0.13.2", - "bevy_render 0.13.2", - "bevy_transform 0.13.2", - "bevy_utils 0.13.2", - "serde", - "thiserror", - "uuid", -] - -[[package]] -name = "bevy_scene" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7a9f0388612a116f02ab6187aeab66e52c9e91abbc21f919b8b50230c4d83e7" -dependencies = [ - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "serde", - "thiserror", - "uuid", -] - -[[package]] -name = "bevy_sprite" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d837e33ed27b9f2e5212eca4bdd5655a9ee64c52914112e6189c043cb25dd1ec" -dependencies = [ - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_core_pipeline 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "bitflags 2.5.0", - "bytemuck", - "fixedbitset 0.5.7", - "guillotiere", - "radsort", - "rectangle-pack", - "thiserror", -] - -[[package]] -name = "bevy_state" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0959984092d56885fd3b320ea84fb816821bad6bfa3040b9d4ee850d3273233d" -dependencies = [ - "bevy_app 0.14.0", - "bevy_ecs 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_reflect 0.14.0", - "bevy_state_macros", - "bevy_utils 0.14.0", -] - -[[package]] -name = "bevy_state_macros" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887a98bfa268258377cd073f5bb839518d3a1cd6b96ed81418145485b69378e6" -dependencies = [ - "bevy_macro_utils 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_tasks" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07fcc4969b357de143509925b39c9a2c56eaa8750828d97f319ca9ed41897cb" -dependencies = [ - "async-channel", - "async-executor", - "async-task", - "concurrent-queue", - "futures-lite", - "wasm-bindgen-futures", -] - -[[package]] -name = "bevy_tasks" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a8bfb8d484bdb1e9bec3789c75202adc5e608c4244347152e50fb31668a54f9" -dependencies = [ - "async-channel", - "async-executor", - "concurrent-queue", - "futures-lite", - "wasm-bindgen-futures", -] - -[[package]] -name = "bevy_text" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "454fd29b7828244356b2e0ce782e6d0a6f26b47f521456accde3a7191b121727" -dependencies = [ - "ab_glyph", - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_ecs 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_sprite", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "bevy_window 0.14.0", - "glyph_brush_layout", - "serde", - "thiserror", -] - -[[package]] -name = "bevy_time" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ea5ae9fe7f56f555dbb05a88d34931907873e3f0c7dc426591839eef72fe3e" -dependencies = [ - "bevy_app 0.13.2", - "bevy_ecs 0.13.2", - "bevy_reflect 0.13.2", - "bevy_utils 0.13.2", - "crossbeam-channel", - "thiserror", -] - -[[package]] -name = "bevy_time" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6c3d3d14ee8b0dbe4819fd516cc75509b61946134d78e0ee89ad3d1835ffe6c" -dependencies = [ - "bevy_app 0.14.0", - "bevy_ecs 0.14.0", - "bevy_reflect 0.14.0", - "bevy_utils 0.14.0", - "crossbeam-channel", - "thiserror", -] - -[[package]] -name = "bevy_transform" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d51a1f332cc00939d2f19ed6b909e5ed7037e39c7e25cc86930d79d432163e" -dependencies = [ - "bevy_app 0.13.2", - "bevy_ecs 0.13.2", - "bevy_hierarchy 0.13.2", - "bevy_math 0.13.2", - "bevy_reflect 0.13.2", - "thiserror", -] - -[[package]] -name = "bevy_transform" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97e8aa6b16be573277c6ceda30aebf1d78af7c6ede19b448dcb052fb8601d815" -dependencies = [ - "bevy_app 0.14.0", - "bevy_ecs 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "thiserror", -] - -[[package]] -name = "bevy_ui" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d9f864c646f3742ff77f67bcd89a13a7ab024b68ca2f1bfbab8245bcb1c06c" -dependencies = [ - "bevy_a11y 0.14.0", - "bevy_app 0.14.0", - "bevy_asset 0.14.0", - "bevy_color", - "bevy_core_pipeline 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_input 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_render 0.14.0", - "bevy_sprite", - "bevy_text", - "bevy_transform 0.14.0", - "bevy_utils 0.14.0", - "bevy_window 0.14.0", - "bytemuck", - "nonmax", - "smallvec", - "taffy", - "thiserror", -] - -[[package]] -name = "bevy_utils" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9f845a985c00e0ee8dc2d8af3f417be925fb52aad4bda5b96e2e58a2b4d2eb" -dependencies = [ - "ahash", - "bevy_utils_proc_macros 0.13.2", - "getrandom", - "hashbrown", - "nonmax", - "petgraph", - "smallvec", - "thiserror", - "tracing", - "uuid", - "web-time 0.2.4", -] - -[[package]] -name = "bevy_utils" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fab364910e8f5839578aba9cfda00a8388e9ebe352ceb8491a742ce6af9ec6e" -dependencies = [ - "ahash", - "bevy_utils_proc_macros 0.14.0", - "getrandom", - "hashbrown", - "thread_local", - "tracing", - "web-time 1.1.0", -] - -[[package]] -name = "bevy_utils_proc_macros" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef158627f30503d5c18c20c60b444829f698d343516eeaf6eeee078c9a45163" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_utils_proc_macros" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9db261ab33a046e1f54b35f885a44f21fcc80aa2bc9050319466b88fe58fe3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "bevy_window" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976202d2ed838176595b550ac654b15ae236e0178a6f19a94ca6d58f2a96ca60" -dependencies = [ - "bevy_a11y 0.13.2", - "bevy_app 0.13.2", - "bevy_ecs 0.13.2", - "bevy_input 0.13.2", - "bevy_math 0.13.2", - "bevy_reflect 0.13.2", - "bevy_utils 0.13.2", - "raw-window-handle", - "smol_str", -] - -[[package]] -name = "bevy_window" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ea5777f933bf7ecaeb3af1a30845720ec730e007972ca7d4aba2d3512abe24" -dependencies = [ - "bevy_a11y 0.14.0", - "bevy_app 0.14.0", - "bevy_ecs 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_utils 0.14.0", - "raw-window-handle", - "smol_str", -] - -[[package]] -name = "bevy_winit" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa66539aa93d8522b146bf82de429714ea6370a6061fc1f1ff7bcacd4e64c6c4" -dependencies = [ - "accesskit_winit 0.17.0", - "approx", - "bevy_a11y 0.13.2", - "bevy_app 0.13.2", - "bevy_derive 0.13.2", - "bevy_ecs 0.13.2", - "bevy_hierarchy 0.13.2", - "bevy_input 0.13.2", - "bevy_math 0.13.2", - "bevy_tasks 0.13.2", - "bevy_utils 0.13.2", - "bevy_window 0.13.2", - "crossbeam-channel", - "raw-window-handle", - "wasm-bindgen", - "web-sys", - "winit 0.29.10", -] - -[[package]] -name = "bevy_winit" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c2213bbf14debe819ec8ad4913f233c596002d087bc6f1f20d533e2ebaf8c6" -dependencies = [ - "accesskit_winit 0.20.4", - "approx", - "bevy_a11y 0.14.0", - "bevy_app 0.14.0", - "bevy_derive 0.14.0", - "bevy_ecs 0.14.0", - "bevy_hierarchy 0.14.0", - "bevy_input 0.14.0", - "bevy_log 0.14.0", - "bevy_math 0.14.0", - "bevy_reflect 0.14.0", - "bevy_tasks 0.14.0", - "bevy_utils 0.14.0", - "bevy_window 0.14.0", - "cfg-if", - "crossbeam-channel", - "raw-window-handle", - "wasm-bindgen", - "web-sys", - "winit 0.30.3", -] - -[[package]] -name = "bindgen" -version = "0.69.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" -dependencies = [ - "bitflags 2.5.0", - "cexpr", - "clang-sys", - "itertools", - "lazy_static", - "lazycell", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.50", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" -dependencies = [ - "serde", -] - -[[package]] -name = "blake3" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", -] - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "block-sys" -version = "0.1.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" -dependencies = [ - "objc-sys 0.2.0-beta.2", -] - -[[package]] -name = "block-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" -dependencies = [ - "objc-sys 0.3.5", -] - -[[package]] -name = "block2" -version = "0.2.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" -dependencies = [ - "block-sys 0.1.0-beta.1", - "objc2-encode 2.0.0-pre.2", -] - -[[package]] -name = "block2" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" -dependencies = [ - "block-sys 0.2.1", - "objc2 0.4.1", -] - -[[package]] -name = "block2" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" -dependencies = [ - "objc2 0.5.2", -] - -[[package]] -name = "blocking" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" -dependencies = [ - "async-channel", - "async-lock", - "async-task", - "fastrand", - "futures-io", - "futures-lite", - "piper", - "tracing", -] - -[[package]] -name = "bumpalo" -version = "3.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" - -[[package]] -name = "bytemuck" -version = "1.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "calloop" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" -dependencies = [ - "bitflags 2.5.0", - "log", - "polling", - "rustix", - "slab", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9fa1897e4325be0d68d48df6aa1a71ac2ed4d27723887e7754192705350730" -dependencies = [ - "libc", -] - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading 0.8.1", -] - -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - -[[package]] -name = "color-eyre" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", - "tracing-error", -] - -[[package]] -name = "color-spantrace" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" -dependencies = [ - "once_cell", - "owo-colors", - "tracing-core", - "tracing-error", -] - -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - -[[package]] -name = "com" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" -dependencies = [ - "com_macros", -] - -[[package]] -name = "com_macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" -dependencies = [ - "com_macros_support", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "com_macros_support" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "combine" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" -dependencies = [ - "bytes", - "memchr", -] - -[[package]] -name = "concurrent-queue" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if", - "wasm-bindgen", -] - -[[package]] -name = "const-fnv1a-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" - -[[package]] -name = "const_panic" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6051f239ecec86fde3410901ab7860d458d160371533842974fc61f96d15879b" - -[[package]] -name = "const_soft_float" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ca1caa64ef4ed453e68bb3db612e51cf1b2f5b871337f0fcab1c8f87cc3dff" - -[[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "constgebra" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1aaf9b65849a68662ac6c0810c8893a765c960b907dd7cfab9c4a50bf764fbc" -dependencies = [ - "const_soft_float", -] - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "core-graphics" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-graphics-types", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "libc", -] - -[[package]] -name = "coreaudio-rs" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace" -dependencies = [ - "bitflags 1.3.2", - "core-foundation-sys", - "coreaudio-sys", -] - -[[package]] -name = "coreaudio-sys" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f01585027057ff5f0a5bf276174ae4c1594a2c5bde93d5f46a016d76270f5a9" -dependencies = [ - "bindgen", -] - -[[package]] -name = "cpal" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" -dependencies = [ - "alsa", - "core-foundation-sys", - "coreaudio-rs", - "dasp_sample", - "jni 0.21.1", - "js-sys", - "libc", - "mach2", - "ndk 0.8.0", - "ndk-context", - "oboe", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows 0.54.0", -] - -[[package]] -name = "crc32fast" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "cursor-icon" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" - -[[package]] -name = "d3d12" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" -dependencies = [ - "bitflags 2.5.0", - "libloading 0.8.1", - "winapi", -] - -[[package]] -name = "d3d12" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b28bfe653d79bd16c77f659305b195b82bb5ce0c0eb2a4846b82ddbd77586813" -dependencies = [ - "bitflags 2.5.0", - "libloading 0.8.1", - "winapi", -] - -[[package]] -name = "dasp_sample" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" - -[[package]] -name = "data-encoding" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" - -[[package]] -name = "demo" -version = "0.1.0" -dependencies = [ - "bevy 0.14.0", - "bevy_oxr", - "bevy_rapier3d", - "color-eyre", -] - -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - -[[package]] -name = "dlib" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" -dependencies = [ - "libloading 0.8.1", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "dpi" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" - -[[package]] -name = "either" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" - -[[package]] -name = "encase" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ed933078d2e659745df651f4c180511cd582e5b9414ff896e7d50d207e3103" -dependencies = [ - "const_panic", - "encase_derive 0.7.0", - "glam 0.25.0", - "thiserror", -] - -[[package]] -name = "encase" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9299a95fa5671ddf29ecc22b00e121843a65cb9ff24911e394b4ae556baf36" -dependencies = [ - "const_panic", - "encase_derive 0.8.0", - "glam 0.27.0", - "thiserror", -] - -[[package]] -name = "encase_derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ce1449c7d19eba6cc0abd231150ad81620a8dce29601d7f8d236e5d431d72a" -dependencies = [ - "encase_derive_impl 0.7.0", -] - -[[package]] -name = "encase_derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e09decb3beb1fe2db6940f598957b2e1f7df6206a804d438ff6cb2a9cddc10" -dependencies = [ - "encase_derive_impl 0.8.0", -] - -[[package]] -name = "encase_derive_impl" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92959a9e8d13eaa13b8ae8c7b583c3bf1669ca7a8e7708a088d12587ba86effc" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "encase_derive_impl" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd31dbbd9743684d339f907a87fe212cb7b51d75b9e8e74181fe363199ee9b47" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "erased-serde" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388979d208a049ffdfb22fa33b9c81942215b940910bccfe258caeb25d125cb3" -dependencies = [ - "serde", -] - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "euclid" -version = "0.22.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f253bc5c813ca05792837a0ff4b3a580336b224512d48f7eda1d7dd9210787" -dependencies = [ - "num-traits", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ad6fd685ce13acd6d9541a30f6db6567a7a24c9ffd4ba2955d29e3f22c8b27" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" -dependencies = [ - "event-listener 5.1.0", - "pin-project-lite", -] - -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "fdeflate" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "fixedbitset" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "gethostname" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" -dependencies = [ - "libc", - "windows-targets 0.48.5", -] - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "gilrs" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b2e57a9cb946b5d04ae8638c5f554abb5a9f82c4c950fd5b1fee6d119592fb" -dependencies = [ - "fnv", - "gilrs-core", - "log", - "uuid", - "vec_map", -] - -[[package]] -name = "gilrs-core" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0af1827b7dd2f36d740ae804c1b3ea0d64c12533fb61ff91883005143a0e8c5a" -dependencies = [ - "core-foundation", - "inotify", - "io-kit-sys", - "js-sys", - "libc", - "libudev-sys", - "log", - "nix", - "uuid", - "vec_map", - "wasm-bindgen", - "web-sys", - "windows 0.52.0", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "gl_generator" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" -dependencies = [ - "khronos_api", - "log", - "xml-rs", -] - -[[package]] -name = "glam" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" -dependencies = [ - "bytemuck", - "serde", -] - -[[package]] -name = "glam" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9" -dependencies = [ - "bytemuck", - "rand", - "serde", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "glow" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" -dependencies = [ - "js-sys", - "slotmap", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "gltf" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b78f069cf941075835822953c345b9e1edd67ae347b81ace3aea9de38c2ef33" -dependencies = [ - "byteorder", - "gltf-json", - "lazy_static", - "serde_json", -] - -[[package]] -name = "gltf-derive" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "438ffe1a5540d75403feaf23636b164e816e93f6f03131674722b3886ce32a57" -dependencies = [ - "inflections", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "gltf-json" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655951ba557f2bc69ea4b0799446bae281fa78efae6319968bdd2c3e9a06d8e1" -dependencies = [ - "gltf-derive", - "serde", - "serde_derive", - "serde_json", -] - -[[package]] -name = "glutin_wgl_sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" -dependencies = [ - "gl_generator", -] - -[[package]] -name = "glyph_brush_layout" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc32c2334f00ca5ac3695c5009ae35da21da8c62d255b5b96d56e2597a637a38" -dependencies = [ - "ab_glyph", - "approx", - "xi-unicode", -] - -[[package]] -name = "gpu-alloc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" -dependencies = [ - "bitflags 2.5.0", - "gpu-alloc-types", -] - -[[package]] -name = "gpu-alloc-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "gpu-allocator" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" -dependencies = [ - "log", - "presser", - "thiserror", - "winapi", - "windows 0.52.0", -] - -[[package]] -name = "gpu-descriptor" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" -dependencies = [ - "bitflags 2.5.0", - "gpu-descriptor-types 0.1.2", - "hashbrown", -] - -[[package]] -name = "gpu-descriptor" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557" -dependencies = [ - "bitflags 2.5.0", - "gpu-descriptor-types 0.2.0", - "hashbrown", -] - -[[package]] -name = "gpu-descriptor-types" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "gpu-descriptor-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "grid" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be136d9dacc2a13cc70bb6c8f902b414fb2641f8db1314637c6b7933411a8f82" - -[[package]] -name = "guillotiere" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782" -dependencies = [ - "euclid", - "svg_fmt", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", - "serde", -] - -[[package]] -name = "hassle-rs" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" -dependencies = [ - "bitflags 2.5.0", - "com", - "libc", - "libloading 0.8.1", - "thiserror", - "widestring", - "winapi", -] - -[[package]] -name = "hexasphere" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f33ddb7f7143d9e703c072e88b98cd8b9719f174137a671429351bd2ee43c02a" -dependencies = [ - "constgebra", - "glam 0.25.0", -] - -[[package]] -name = "hexasphere" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd6b038160f086b0a7496edae34169ae22f328793cbe2b627a5a3d8373748ec" -dependencies = [ - "constgebra", - "glam 0.27.0", -] - -[[package]] -name = "hexf-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" - -[[package]] -name = "icrate" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" -dependencies = [ - "block2 0.3.0", - "dispatch", - "objc2 0.4.1", -] - -[[package]] -name = "image" -version = "0.24.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "num-traits", -] - -[[package]] -name = "image" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" -dependencies = [ - "bytemuck", - "byteorder", - "num-traits", - "png", -] - -[[package]] -name = "immutable-chunkmap" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4419f022e55cc63d5bbd6b44b71e1d226b9c9480a47824c706e9d54e5c40c5eb" -dependencies = [ - "arrayvec", -] - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "indexmap" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "inflections" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" - -[[package]] -name = "inotify" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd168d97690d0b8c412d6b6c10360277f4d7ee495c5d0d5d5fe0854923255cc" -dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - -[[package]] -name = "io-kit-sys" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4769cb30e5dcf1710fc6730d3e94f78c47723a014a567de385e113c737394640" -dependencies = [ - "core-foundation-sys", - "mach2", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "jni" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", - "windows-sys 0.45.0", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "khronos-egl" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" -dependencies = [ - "libc", - "libloading 0.8.1", - "pkg-config", -] - -[[package]] -name = "khronos_api" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" - -[[package]] -name = "ktx2" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87d65e08a9ec02e409d27a0139eaa6b9756b4d81fe7cde71f6941a83730ce838" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "lewton" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" -dependencies = [ - "byteorder", - "ogg", - "tinyvec", -] - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libloading" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libredox" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" -dependencies = [ - "bitflags 2.5.0", - "libc", - "redox_syscall 0.4.1", -] - -[[package]] -name = "libudev-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "mach2" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" -dependencies = [ - "libc", -] - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "matrixmultiply" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "metal" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" -dependencies = [ - "bitflags 2.5.0", - "block", - "core-graphics-types", - "foreign-types", - "log", - "objc", - "paste", -] - -[[package]] -name = "metal" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5637e166ea14be6063a3f8ba5ccb9a4159df7d8f6d61c02fc3d480b1f90dcfcb" -dependencies = [ - "bitflags 2.5.0", - "block", - "core-graphics-types", - "foreign-types", - "log", - "objc", - "paste", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", - "simd-adler32", -] - -[[package]] -name = "mint" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" - -[[package]] -name = "naga" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8878eb410fc90853da3908aebfe61d73d26d4437ef850b70050461f939509899" -dependencies = [ - "bit-set", - "bitflags 2.5.0", - "codespan-reporting", - "hexf-parse", - "indexmap", - "log", - "num-traits", - "pp-rs", - "rustc-hash", - "spirv", - "termcolor", - "thiserror", - "unicode-xid", -] - -[[package]] -name = "naga" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e536ae46fcab0876853bd4a632ede5df4b1c2527a58f6c5a4150fe86be858231" -dependencies = [ - "arrayvec", - "bit-set", - "bitflags 2.5.0", - "codespan-reporting", - "hexf-parse", - "indexmap", - "log", - "num-traits", - "pp-rs", - "rustc-hash", - "spirv", - "termcolor", - "thiserror", - "unicode-xid", -] - -[[package]] -name = "naga_oil" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ea62ae0f2787456afca7209ca180522b41f00cbe159ee369eba1e07d365cd1" -dependencies = [ - "bit-set", - "codespan-reporting", - "data-encoding", - "indexmap", - "naga 0.19.0", - "once_cell", - "regex", - "regex-syntax 0.8.2", - "rustc-hash", - "thiserror", - "tracing", - "unicode-ident", -] - -[[package]] -name = "naga_oil" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "275d9720a7338eedac966141089232514c84d76a246a58ef501af88c5edf402f" -dependencies = [ - "bit-set", - "codespan-reporting", - "data-encoding", - "indexmap", - "naga 0.20.0", - "once_cell", - "regex", - "regex-syntax 0.8.2", - "rustc-hash", - "thiserror", - "tracing", - "unicode-ident", -] - -[[package]] -name = "nalgebra" -version = "0.32.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4541eb06dce09c0241ebbaab7102f0a01a0c8994afed2e5d0d66775016e25ac2" -dependencies = [ - "approx", - "glam 0.25.0", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational", - "num-traits", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ndk" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" -dependencies = [ - "bitflags 2.5.0", - "jni-sys", - "log", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum", - "raw-window-handle", - "thiserror", -] - -[[package]] -name = "ndk" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" -dependencies = [ - "bitflags 2.5.0", - "jni-sys", - "log", - "ndk-sys 0.6.0+11769913", - "num_enum", - "raw-window-handle", - "thiserror", -] - -[[package]] -name = "ndk-context" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" - -[[package]] -name = "ndk-sys" -version = "0.5.0+25.2.9519653" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "ndk-sys" -version = "0.6.0+11769913" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "nix" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" -dependencies = [ - "bitflags 2.5.0", - "cfg-if", - "libc", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nonmax" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" - -[[package]] -name = "ntapi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" -dependencies = [ - "winapi", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-complex" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_enum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc-sys" -version = "0.2.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" - -[[package]] -name = "objc-sys" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" - -[[package]] -name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" -dependencies = [ - "block2 0.2.0-alpha.6", - "objc-sys 0.2.0-beta.2", - "objc2-encode 2.0.0-pre.2", -] - -[[package]] -name = "objc2" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" -dependencies = [ - "objc-sys 0.3.5", - "objc2-encode 3.0.0", -] - -[[package]] -name = "objc2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" -dependencies = [ - "objc-sys 0.3.5", - "objc2-encode 4.0.3", -] - -[[package]] -name = "objc2-app-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "libc", - "objc2 0.5.2", - "objc2-core-data", - "objc2-core-image", - "objc2-foundation", - "objc2-quartz-core", -] - -[[package]] -name = "objc2-cloud-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-core-location", - "objc2-foundation", -] - -[[package]] -name = "objc2-contacts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-data" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-image" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", - "objc2-metal", -] - -[[package]] -name = "objc2-core-location" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-contacts", - "objc2-foundation", -] - -[[package]] -name = "objc2-encode" -version = "2.0.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" -dependencies = [ - "objc-sys 0.2.0-beta.2", -] - -[[package]] -name = "objc2-encode" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" - -[[package]] -name = "objc2-encode" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" - -[[package]] -name = "objc2-foundation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "dispatch", - "libc", - "objc2 0.5.2", -] - -[[package]] -name = "objc2-link-presentation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-app-kit", - "objc2-foundation", -] - -[[package]] -name = "objc2-metal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", - "objc2-metal", -] - -[[package]] -name = "objc2-symbols" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" -dependencies = [ - "objc2 0.5.2", - "objc2-foundation", -] - -[[package]] -name = "objc2-ui-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-cloud-kit", - "objc2-core-data", - "objc2-core-image", - "objc2-core-location", - "objc2-foundation", - "objc2-link-presentation", - "objc2-quartz-core", - "objc2-symbols", - "objc2-uniform-type-identifiers", - "objc2-user-notifications", -] - -[[package]] -name = "objc2-uniform-type-identifiers" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", -] - -[[package]] -name = "objc2-user-notifications" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-core-location", - "objc2-foundation", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "oboe" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" -dependencies = [ - "jni 0.21.1", - "ndk 0.8.0", - "ndk-context", - "num-derive", - "num-traits", - "oboe-sys", -] - -[[package]] -name = "oboe-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bb09a4a2b1d668170cfe0a7d5bc103f8999fb316c98099b6a9939c9f2e79d" -dependencies = [ - "cc", -] - -[[package]] -name = "ogg" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e" -dependencies = [ - "byteorder", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "openxr" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a03958eb34719625119448d483ebd2fe008a2128b6286f2a7138b7e48072053" -dependencies = [ - "libc", - "libloading 0.8.1", - "ndk-context", - "openxr-sys", -] - -[[package]] -name = "openxr-sys" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1534b2c14b56564e58b91f5015817e1d87bd43ca12a188eda6a9ea3859b0ec25" -dependencies = [ - "cmake", - "libc", - "mint", -] - -[[package]] -name = "orbclient" -version = "0.3.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" -dependencies = [ - "libredox", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "owned_ttf_parser" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" -dependencies = [ - "ttf-parser", -] - -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "smallvec", - "windows-targets 0.48.5", -] - -[[package]] -name = "parry3d" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d0bdaf533851feec5cba9af11cefcc753ecefba05f758cf6abe886086bc3f5" -dependencies = [ - "approx", - "arrayvec", - "bitflags 1.3.2", - "downcast-rs", - "either", - "nalgebra", - "num-derive", - "num-traits", - "rustc-hash", - "simba", - "slab", - "smallvec", - "spade", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset 0.4.2", - "indexmap", - "serde", - "serde_derive", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "png" -version = "0.17.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "polling" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" -dependencies = [ - "cfg-if", - "concurrent-queue", - "pin-project-lite", - "rustix", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "pp-rs" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb458bb7f6e250e6eb79d5026badc10a3ebb8f9a15d1fff0f13d17c71f4d6dee" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "presser" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "profiling" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radsort" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fd96390ed3feda12e1dfe2645ed587e0bea749e319333f104a33ff62f77a0b" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "range-alloc" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" - -[[package]] -name = "rapier3d" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d07a833e0aa3bc57010caaa50bf75fa78afc03a74207607db740da4e4579a1" -dependencies = [ - "approx", - "arrayvec", - "bit-vec", - "bitflags 1.3.2", - "crossbeam", - "downcast-rs", - "nalgebra", - "num-derive", - "num-traits", - "parry3d", - "rustc-hash", - "simba", -] - -[[package]] -name = "raw-window-handle" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "rectangle-pack" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d463f2884048e7153449a55166f91028d5b0ea53c79377099ce4e8cf0cf9bb" - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.2", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "renderdoc-sys" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" - -[[package]] -name = "robust" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf4a6aa5f6d6888f39e980649f3ad6b666acdce1d78e95b8a2cb076e687ae30" - -[[package]] -name = "rodio" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1fceb9d127d515af1586d8d0cc601e1245bdb0af38e75c865a156290184f5b3" -dependencies = [ - "cpal", - "lewton", - "thiserror", -] - -[[package]] -name = "ron" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" -dependencies = [ - "base64 0.21.7", - "bitflags 2.5.0", - "serde", - "serde_derive", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.38.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" -dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "ruzstd" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5022b253619b1ba797f243056276bed8ed1a73b0f5a7ce7225d524067644bf8f" -dependencies = [ - "byteorder", - "twox-hash", -] - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "safe_arch" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - -[[package]] -name = "serde" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "serde_json" -version = "1.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "simba" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", -] - -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "slotmap" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" -dependencies = [ - "version_check", -] - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" -dependencies = [ - "serde", -] - -[[package]] -name = "smol_str" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" -dependencies = [ - "serde", -] - -[[package]] -name = "spade" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61addf9117b11d1f5b4bf6fe94242ba25f59d2d4b2080544b771bd647024fd00" -dependencies = [ - "hashbrown", - "num-traits", - "robust", - "smallvec", -] - -[[package]] -name = "spirv" -version = "0.3.0+sdk-1.3.268.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "svg_fmt" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sysinfo" -version = "0.30.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2" -dependencies = [ - "cfg-if", - "core-foundation-sys", - "libc", - "ntapi", - "once_cell", - "windows 0.52.0", -] - -[[package]] -name = "taffy" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8b61630cba2afd2c851821add2e1bb1b7851a2436e839ab73b56558b009035e" -dependencies = [ - "arrayvec", - "grid", - "num-traits", - "serde", - "slotmap", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "toml_datetime" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.6.13", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log 0.2.0", -] - -[[package]] -name = "tracing-wasm" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" -dependencies = [ - "tracing", - "tracing-subscriber", - "wasm-bindgen", -] - -[[package]] -name = "ttf-parser" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "uuid" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" -dependencies = [ - "getrandom", - "serde", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "walkdir" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.50", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wgpu" -version = "0.19.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" -dependencies = [ - "arrayvec", - "cfg-if", - "cfg_aliases 0.1.1", - "js-sys", - "log", - "naga 0.19.0", - "parking_lot", - "profiling", - "raw-window-handle", - "smallvec", - "static_assertions", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "wgpu-core 0.19.0", - "wgpu-hal 0.19.1", - "wgpu-types 0.19.0", -] - -[[package]] -name = "wgpu" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e37c7b9921b75dfd26dd973fdcbce36f13dfa6e2dc82aece584e0ed48c355c" -dependencies = [ - "arrayvec", - "cfg-if", - "cfg_aliases 0.1.1", - "document-features", - "js-sys", - "log", - "naga 0.20.0", - "parking_lot", - "profiling", - "raw-window-handle", - "smallvec", - "static_assertions", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "wgpu-core 0.21.0", - "wgpu-hal 0.21.0", - "wgpu-types 0.20.0", -] - -[[package]] -name = "wgpu-core" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b15e451d4060ada0d99a64df44e4d590213496da7c4f245572d51071e8e30ed" -dependencies = [ - "arrayvec", - "bit-vec", - "bitflags 2.5.0", - "cfg_aliases 0.1.1", - "codespan-reporting", - "indexmap", - "log", - "naga 0.19.0", - "once_cell", - "parking_lot", - "profiling", - "raw-window-handle", - "rustc-hash", - "smallvec", - "thiserror", - "web-sys", - "wgpu-hal 0.19.1", - "wgpu-types 0.19.0", -] - -[[package]] -name = "wgpu-core" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59e0d5fc509601c69e4e1fa06c1eb3c4c9f12956a5e30c79b61ef1c1be7daf0" -dependencies = [ - "arrayvec", - "bit-vec", - "bitflags 2.5.0", - "cfg_aliases 0.1.1", - "codespan-reporting", - "document-features", - "indexmap", - "log", - "naga 0.20.0", - "once_cell", - "parking_lot", - "profiling", - "raw-window-handle", - "rustc-hash", - "smallvec", - "thiserror", - "web-sys", - "wgpu-hal 0.21.0", - "wgpu-types 0.20.0", -] - -[[package]] -name = "wgpu-hal" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bb47856236bfafc0bc591a925eb036ac19cd987624a447ff353e7a7e7e6f72" -dependencies = [ - "android_system_properties", - "arrayvec", - "ash", - "bit-set", - "bitflags 2.5.0", - "block", - "cfg_aliases 0.1.1", - "core-graphics-types", - "d3d12 0.19.0", - "glow", - "glutin_wgl_sys", - "gpu-alloc", - "gpu-allocator", - "gpu-descriptor 0.2.4", - "hassle-rs", - "js-sys", - "khronos-egl", - "libc", - "libloading 0.8.1", - "log", - "metal 0.27.0", - "naga 0.19.0", - "objc", - "once_cell", - "parking_lot", - "profiling", - "range-alloc", - "raw-window-handle", - "renderdoc-sys", - "rustc-hash", - "smallvec", - "thiserror", - "wasm-bindgen", - "web-sys", - "wgpu-types 0.19.0", - "winapi", -] - -[[package]] -name = "wgpu-hal" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aa24c3889f885a3fb9133b454c8418bfcfaadcfe4ed3be96ac80e76703b863b" -dependencies = [ - "android_system_properties", - "arrayvec", - "ash", - "bit-set", - "bitflags 2.5.0", - "block", - "cfg_aliases 0.1.1", - "core-graphics-types", - "d3d12 0.20.0", - "glow", - "glutin_wgl_sys", - "gpu-alloc", - "gpu-allocator", - "gpu-descriptor 0.3.0", - "hassle-rs", - "js-sys", - "khronos-egl", - "libc", - "libloading 0.8.1", - "log", - "metal 0.28.0", - "naga 0.20.0", - "ndk-sys 0.5.0+25.2.9519653", - "objc", - "once_cell", - "parking_lot", - "profiling", - "range-alloc", - "raw-window-handle", - "renderdoc-sys", - "rustc-hash", - "smallvec", - "thiserror", - "wasm-bindgen", - "web-sys", - "wgpu-types 0.20.0", - "winapi", -] - -[[package]] -name = "wgpu-types" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "895fcbeb772bfb049eb80b2d6e47f6c9af235284e9703c96fc0218a42ffd5af2" -dependencies = [ - "bitflags 2.5.0", - "js-sys", - "web-sys", -] - -[[package]] -name = "wgpu-types" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1353d9a46bff7f955a680577f34c69122628cc2076e1d6f3a9be6ef00ae793ef" -dependencies = [ - "bitflags 2.5.0", - "js-sys", - "web-sys", -] - -[[package]] -name = "wide" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" -dependencies = [ - "bytemuck", - "safe_arch", -] - -[[package]] -name = "widestring" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-implement 0.48.0", - "windows-interface 0.48.0", - "windows-targets 0.48.5", -] - -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.3", -] - -[[package]] -name = "windows" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" -dependencies = [ - "windows-core 0.54.0", - "windows-implement 0.53.0", - "windows-interface 0.53.0", - "windows-targets 0.52.3", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.3", -] - -[[package]] -name = "windows-core" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" -dependencies = [ - "windows-result", - "windows-targets 0.52.3", -] - -[[package]] -name = "windows-implement" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "windows-implement" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "windows-interface" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "windows-interface" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "windows-result" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" -dependencies = [ - "windows-targets 0.52.3", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.3", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" -dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" - -[[package]] -name = "winit" -version = "0.29.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" -dependencies = [ - "android-activity 0.5.2", - "atomic-waker", - "bitflags 2.5.0", - "calloop", - "cfg_aliases 0.1.1", - "core-foundation", - "core-graphics", - "cursor-icon", - "icrate", - "js-sys", - "libc", - "log", - "ndk 0.8.0", - "ndk-sys 0.5.0+25.2.9519653", - "objc2 0.4.1", - "once_cell", - "orbclient", - "raw-window-handle", - "redox_syscall 0.3.5", - "rustix", - "smol_str", - "unicode-segmentation", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "web-time 0.2.4", - "windows-sys 0.48.0", - "xkbcommon-dl", -] - -[[package]] -name = "winit" -version = "0.30.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f45a7b7e2de6af35448d7718dab6d95acec466eb3bb7a56f4d31d1af754004" -dependencies = [ - "android-activity 0.6.0", - "atomic-waker", - "bitflags 2.5.0", - "block2 0.5.1", - "bytemuck", - "calloop", - "cfg_aliases 0.2.1", - "concurrent-queue", - "core-foundation", - "core-graphics", - "cursor-icon", - "dpi", - "js-sys", - "libc", - "ndk 0.9.0", - "objc2 0.5.2", - "objc2-app-kit", - "objc2-foundation", - "objc2-ui-kit", - "orbclient", - "percent-encoding", - "pin-project", - "raw-window-handle", - "redox_syscall 0.4.1", - "rustix", - "smol_str", - "tracing", - "unicode-segmentation", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "web-time 1.1.0", - "windows-sys 0.52.0", - "x11-dl", - "x11rb", - "xkbcommon-dl", -] - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" -dependencies = [ - "memchr", -] - -[[package]] -name = "x11-dl" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" -dependencies = [ - "libc", - "once_cell", - "pkg-config", -] - -[[package]] -name = "x11rb" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" -dependencies = [ - "as-raw-xcb-connection", - "gethostname", - "libc", - "libloading 0.8.1", - "once_cell", - "rustix", - "x11rb-protocol", -] - -[[package]] -name = "x11rb-protocol" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" - -[[package]] -name = "xi-unicode" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" - -[[package]] -name = "xkbcommon-dl" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" -dependencies = [ - "bitflags 2.5.0", - "dlib", - "log", - "once_cell", - "xkeysym", -] - -[[package]] -name = "xkeysym" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" - -[[package]] -name = "xml-rs" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 3b1acb4..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,71 +0,0 @@ -[workspace] -resolver = "2" -members = [ - "examples/android", - "examples/demo", -] - -[workspace.package] -edition = "2021" -license = "MIT OR Apache-2.0" -repository = "https://github.com/awtterpip/bevy_oxr" - -[workspace.dependencies] -eyre = "0.6.2" -bevy = "0.14.0" -openxr = "0.18" -color-eyre = "0.6.2" - -[package] -name = "bevy_oxr" -version = "0.2.0" -description = "Community crate for OpenXR in Bevy" -edition.workspace = true -license.workspace = true -repository.workspace = true - -[features] -default = ["vulkan", "d3d12"] -force-link = ["openxr/linked"] -vulkan = ["wgpu-core/vulkan"] -d3d12 = ["wgpu-core/dx12", "dep:winapi", "dep:d3d12"] - -[dependencies] -ash = "0.37.3" -bevy.workspace = true -eyre.workspace = true -futures-lite = "2.0.1" -mint = "0.5.9" -wgpu = "0.20" -wgpu-core = "0.21" -wgpu-hal = "0.21" - -[target.'cfg(windows)'.dependencies] -openxr = { workspace = true, features = [ "linked", "static", "mint" ] } -winapi = { version = "0.3.9", optional = true } -d3d12 = { version = "0.20", features = ["libloading"], optional = true } - -[target.'cfg(all(target_family = "unix", not(target_arch = "wasm32")) )'.dependencies] -openxr = { workspace = true, features = [ "mint" ] } - -[target.'cfg(all(not(target_family = "unix"), not(target_arch = "wasm32")))'.dependencies] -openxr = { workspace = true, features = [ "mint", "static" ] } - -[target.'cfg(target_os = "android")'.dependencies] -ndk-context = "0.1" -jni = "0.20" - -[dev-dependencies] -color-eyre.workspace = true - -[[example]] -name = "xr" -path = "examples/xr.rs" - -[profile.release] -debug = true - -[package.metadata.docs.rs] -rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"] -all-features = true -cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/LICENSE-APACHE b/LICENSE-APACHE deleted file mode 100644 index d9a10c0..0000000 --- a/LICENSE-APACHE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/LICENSE-MIT b/LICENSE-MIT deleted file mode 100644 index 9cf1062..0000000 --- a/LICENSE-MIT +++ /dev/null @@ -1,19 +0,0 @@ -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index f0cad42..0000000 --- a/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Bevy OpenXR - -A crate for adding openxr support to Bevy ( planned to be upstreamed ). - -To see it in action run the example in `examples` with `cargo run --example xr` - -## This crate will not recive any feature or performance updates -the current implementation will not be updated! -we will release a version for bevy 0.14 once that releases but no further version will be supported! -there is a new rewrite that will be upstreamed into bevy in the future. -you can use that from this git repo if you want, but be warned it has a completly different public api. - -## Discord - -Come hang out if you have questions or issues -https://discord.gg/sqMw7UJhNc - -![](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY2FlOXJrOG1pbzFkYTVjZHIybndqamF1a2YwZHU3dXgyZGcwdmFzMiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/CHbQyXOT5yZZ1VQRh7/giphy-downsized-large.gif) -![](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExbHVmZXc2b3VhcGE2eHE2c2Y3NDR6cXNibHdjNjk5MmtyOHlkMXkwZyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/Hsvp5el2o7tzgOf9GQ/giphy-downsized-large.gif) - -## Troubleshooting - -- Make sure, if you're on Linux, that you have the `openxr` package installed on your system. -- I'm getting poor performance. - - Like other bevy projects, make sure you're building in release (example: `cargo run --example xr --release`) - -## License - -Unless otherwise specified, all code in this repository is dual-licensed under -either: - -- MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) -- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) - -at your option. This means you can select the license you prefer! - -### Your contributions - -Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in the work by you, as defined in the Apache-2.0 license, shall -be dual licensed as above, without any additional terms or conditions. diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index 346dafd..0000000 --- a/rustfmt.toml +++ /dev/null @@ -1 +0,0 @@ -# Use defaults diff --git a/src/graphics/d3d12.rs b/src/graphics/d3d12.rs deleted file mode 100644 index 8746d39..0000000 --- a/src/graphics/d3d12.rs +++ /dev/null @@ -1,476 +0,0 @@ -use std::sync::atomic::AtomicBool; -use std::sync::{Arc, Mutex}; - -// use anyhow::Context; -use bevy::math::uvec2; -use bevy::prelude::*; -use bevy::render::renderer::{ - RenderAdapter, RenderAdapterInfo, RenderDevice, RenderQueue, WgpuWrapper, -}; -use bevy::window::RawHandleWrapper; -use eyre::{Context, ContextCompat}; -use openxr as xr; -use wgpu::Instance; -use wgpu_hal::{api::Dx12, Api}; -use wgpu_hal::{Adapter as HalAdapter, Instance as HalInstance}; -use winapi::shared::dxgiformat::{self, DXGI_FORMAT}; -use winapi::um::{d3d12 as winapi_d3d12, d3dcommon}; -use xr::EnvironmentBlendMode; - -use crate::graphics::extensions::XrExtensions; -use crate::input::XrInput; - -use crate::resources::{ - OXrSessionSetupInfo, Swapchain, SwapchainInner, XrEnvironmentBlendMode, XrFormat, XrFrameState, - XrFrameWaiter, XrInstance, XrResolution, XrSession, XrSessionRunning, XrSwapchain, XrViews, -}; - -#[cfg(all(feature = "d3d12", windows))] -use crate::resources::D3D12OXrSessionSetupInfo; -#[cfg(feature = "vulkan")] -use crate::resources::VulkanOXrSessionSetupInfo; - -use super::{XrAppInfo, XrPreferdBlendMode}; -use crate::VIEW_TYPE; - -pub fn initialize_xr_instance( - window: Option, - xr_entry: xr::Entry, - reqeusted_extensions: XrExtensions, - available_extensions: XrExtensions, - prefered_blend_mode: XrPreferdBlendMode, - app_info: XrAppInfo, -) -> eyre::Result<( - XrInstance, - OXrSessionSetupInfo, - XrEnvironmentBlendMode, - RenderDevice, - RenderQueue, - RenderAdapterInfo, - RenderAdapter, - Instance, -)> { - #[cfg(target_os = "android")] - xr_entry.initialize_android_loader()?; - - assert!(available_extensions.raw().khr_d3d12_enable); - //info!("available xr exts: {:#?}", available_extensions); - - let mut enabled_extensions: xr::ExtensionSet = - (available_extensions & reqeusted_extensions).into(); - enabled_extensions.khr_d3d12_enable = true; - - let available_layers = xr_entry.enumerate_layers()?; - //info!("available xr layers: {:#?}", available_layers); - - let xr_instance = xr_entry.create_instance( - &xr::ApplicationInfo { - application_name: &app_info.name, - engine_name: "Bevy", - ..Default::default() - }, - &enabled_extensions, - &[], - )?; - info!("created OpenXR instance"); - let instance_props = xr_instance.properties()?; - let xr_system_id = xr_instance.system(xr::FormFactor::HEAD_MOUNTED_DISPLAY)?; - info!("created OpenXR system"); - let system_props = xr_instance.system_properties(xr_system_id).unwrap(); - info!( - "loaded OpenXR runtime: {} {} {}", - instance_props.runtime_name, - instance_props.runtime_version, - if system_props.system_name.is_empty() { - "" - } else { - &system_props.system_name - } - ); - - let blend_modes = xr_instance.enumerate_environment_blend_modes(xr_system_id, VIEW_TYPE)?; - let blend_mode: EnvironmentBlendMode = match prefered_blend_mode { - XrPreferdBlendMode::Opaque if blend_modes.contains(&EnvironmentBlendMode::OPAQUE) => { - bevy::log::info!("Using Opaque"); - EnvironmentBlendMode::OPAQUE - } - XrPreferdBlendMode::Additive if blend_modes.contains(&EnvironmentBlendMode::ADDITIVE) => { - bevy::log::info!("Using Additive"); - EnvironmentBlendMode::ADDITIVE - } - XrPreferdBlendMode::AlphaBlend - if blend_modes.contains(&EnvironmentBlendMode::ALPHA_BLEND) => - { - bevy::log::info!("Using AlphaBlend"); - EnvironmentBlendMode::ALPHA_BLEND - } - _ => { - bevy::log::info!("Using Opaque"); - EnvironmentBlendMode::OPAQUE - } - }; - - let reqs = xr_instance.graphics_requirements::(xr_system_id)?; - - let instance_descriptor = &wgpu_hal::InstanceDescriptor { - name: &app_info.name, - dx12_shader_compiler: wgpu::util::dx12_shader_compiler_from_env().unwrap_or( - wgpu::Dx12Compiler::Dxc { - dxil_path: None, - dxc_path: None, - }, - ), - flags: wgpu::InstanceFlags::from_build_config().with_env(), - gles_minor_version: Default::default(), - }; - let wgpu_raw_instance: wgpu_hal::dx12::Instance = - unsafe { wgpu_hal::dx12::Instance::init(instance_descriptor)? }; - let wgpu_adapters: Vec> = - unsafe { wgpu_raw_instance.enumerate_adapters() }; - let wgpu_exposed_adapter = wgpu_adapters - .into_iter() - .find(|a| { - let mut desc = unsafe { std::mem::zeroed() }; - unsafe { a.adapter.raw_adapter().GetDesc1(&mut desc) }; - desc.AdapterLuid.HighPart == reqs.adapter_luid.HighPart - && desc.AdapterLuid.LowPart == reqs.adapter_luid.LowPart - }) - .context("failed to find DXGI adapter matching LUID provided by runtime")?; - - let wgpu_instance = - unsafe { wgpu::Instance::from_hal::(wgpu_raw_instance) }; - - let wgpu_features = wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES - | wgpu::Features::MULTIVIEW - | wgpu::Features::MULTI_DRAW_INDIRECT_COUNT - | wgpu::Features::MULTI_DRAW_INDIRECT; - - let wgpu_limits = wgpu::Limits { - max_bind_groups: 8, - max_storage_buffer_binding_size: wgpu_exposed_adapter - .capabilities - .limits - .max_storage_buffer_binding_size, - max_push_constant_size: 4, - ..Default::default() - }; - - let wgpu_open_device = unsafe { - wgpu_exposed_adapter - .adapter - .open(wgpu_features, &wgpu_limits)? - }; - - let device_supported_feature_level: d3d12::FeatureLevel = - get_device_feature_level(wgpu_open_device.device.raw_device()); - - if (device_supported_feature_level as u32) < (reqs.min_feature_level as u32) { - panic!( - "OpenXR runtime requires D3D12 feature level >= {}", - reqs.min_feature_level - ); - } - - let (session, frame_wait, frame_stream) = unsafe { - xr_instance.create_session::( - xr_system_id, - &xr::d3d::SessionCreateInfoD3D12 { - device: wgpu_open_device.device.raw_device().as_mut_ptr().cast(), - queue: wgpu_open_device.device.raw_queue().as_mut_ptr().cast(), - }, - ) - }?; - - let wgpu_adapter = unsafe { wgpu_instance.create_adapter_from_hal(wgpu_exposed_adapter) }; - let raw_device = wgpu_open_device.device.raw_device().as_mut_ptr(); - let raw_queue = wgpu_open_device.device.raw_queue().as_mut_ptr(); - let (wgpu_device, wgpu_queue) = unsafe { - wgpu_adapter.create_device_from_hal( - wgpu_open_device, - &wgpu::DeviceDescriptor { - label: Some("bevy_oxr device"), - required_features: wgpu_features, - required_limits: wgpu_limits, - }, - None, - )? - }; - - Ok(( - xr_instance.into(), - OXrSessionSetupInfo::D3D12(D3D12OXrSessionSetupInfo { - raw_device, - raw_queue, - xr_system_id, - }), - blend_mode.into(), - wgpu_device.into(), - RenderQueue(Arc::new(WgpuWrapper::new(wgpu_queue))), - RenderAdapterInfo(WgpuWrapper::new(wgpu_adapter.get_info())), - RenderAdapter(Arc::new(WgpuWrapper::new(wgpu_adapter))), - wgpu_instance.into(), - )) -} - -pub fn start_xr_session( - window: Option, - ptrs: &OXrSessionSetupInfo, - xr_instance: &XrInstance, - render_device: &RenderDevice, - render_adapter: &RenderAdapter, - wgpu_instance: &Instance, -) -> eyre::Result<( - XrSession, - XrResolution, - XrFormat, - XrSessionRunning, - XrFrameWaiter, - XrSwapchain, - XrInput, - XrViews, - XrFrameState, -)> { - let wgpu_device = render_device.wgpu_device(); - let wgpu_adapter = &render_adapter.0; - - #[allow(unreachable_patterns)] - let setup_info = match ptrs { - OXrSessionSetupInfo::D3D12(v) => v, - _ => eyre::bail!("Wrong Graphics Api"), - }; - let (session, frame_wait, frame_stream) = unsafe { - xr_instance.create_session::( - setup_info.xr_system_id, - &xr::d3d::SessionCreateInfoD3D12 { - device: setup_info.raw_device.cast(), - queue: setup_info.raw_queue.cast(), - }, - ) - }?; - - let views = - xr_instance.enumerate_view_configuration_views(setup_info.xr_system_id, VIEW_TYPE)?; - let surface = window.map(|wrapper| unsafe { - // SAFETY: Plugins should be set up on the main thread. - let handle = wrapper.get_handle(); - wgpu_instance - .create_surface(handle) - .expect("Failed to create wgpu surface") - }); - let swapchain_format = surface - .as_ref() - .map(|surface| surface.get_capabilities(wgpu_adapter).formats[0]) - .unwrap_or(wgpu::TextureFormat::Rgba8UnormSrgb); - - // TODO: Log swapchain format - - let resolution = uvec2( - views[0].recommended_image_rect_width, - views[0].recommended_image_rect_height, - ); - - let handle = session - .create_swapchain(&xr::SwapchainCreateInfo { - create_flags: xr::SwapchainCreateFlags::EMPTY, - usage_flags: xr::SwapchainUsageFlags::COLOR_ATTACHMENT - | xr::SwapchainUsageFlags::SAMPLED, - format: wgpu_to_d3d12(swapchain_format).expect("Unsupported texture format"), - // The Vulkan graphics pipeline we create is not set up for multisampling, - // so we hardcode this to 1. If we used a proper multisampling setup, we - // could set this to `views[0].recommended_swapchain_sample_count`. - sample_count: 1, - width: resolution.x, - height: resolution.y, - face_count: 1, - array_size: 2, - mip_count: 1, - }) - .unwrap(); - - let images = handle.enumerate_images().unwrap(); - - let buffers = images - .into_iter() - .map(|color_image| { - info!("image map swapchain"); - let wgpu_hal_texture = unsafe { - ::Device::texture_from_raw( - d3d12::ComPtr::from_raw(color_image as *mut _), - swapchain_format, - wgpu::TextureDimension::D2, - wgpu::Extent3d { - width: resolution.x, - height: resolution.y, - depth_or_array_layers: 2, - }, - 1, - 1, - ) - }; - let texture = unsafe { - wgpu_device.create_texture_from_hal::( - wgpu_hal_texture, - &wgpu::TextureDescriptor { - label: Some("bevy_openxr swapchain"), - size: wgpu::Extent3d { - width: resolution.x, - height: resolution.y, - depth_or_array_layers: 2, - }, - mip_level_count: 1, - sample_count: 1, - dimension: wgpu::TextureDimension::D2, - format: swapchain_format, - usage: wgpu::TextureUsages::RENDER_ATTACHMENT - | wgpu::TextureUsages::COPY_DST, - view_formats: &[], - }, - ) - }; - texture - }) - .collect(); - - Ok(( - XrSession::D3D12(session.clone()), - resolution.into(), - swapchain_format.into(), - // TODO: this shouldn't be in here - AtomicBool::new(false).into(), - frame_wait.into(), - Swapchain::D3D12(SwapchainInner { - stream: Mutex::new(frame_stream), - handle: Mutex::new(handle), - buffers, - image_index: Mutex::new(0), - }) - .into(), - XrInput::new(xr_instance, &session.into_any_graphics())?, - Vec::default().into(), - // TODO: Feels wrong to return a FrameState here, we probably should just wait for the next frame - xr::FrameState { - predicted_display_time: xr::Time::from_nanos(1), - predicted_display_period: xr::Duration::from_nanos(1), - should_render: true, - } - .into(), - )) -} - -// Extracted from https://github.com/gfx-rs/wgpu/blob/1161a22f4fbb4fc204eb06f2ac4243f83e0e980d/wgpu-hal/src/dx12/adapter.rs#L73-L94 -// license: MIT OR Apache-2.0 -fn get_device_feature_level( - device: &d3d12::ComPtr, -) -> d3d12::FeatureLevel { - // Detect the highest supported feature level. - let d3d_feature_level = [ - d3d12::FeatureLevel::L12_1, - d3d12::FeatureLevel::L12_0, - d3d12::FeatureLevel::L11_1, - d3d12::FeatureLevel::L11_0, - ]; - type FeatureLevelsInfo = winapi_d3d12::D3D12_FEATURE_DATA_FEATURE_LEVELS; - let mut device_levels: FeatureLevelsInfo = unsafe { std::mem::zeroed() }; - device_levels.NumFeatureLevels = d3d_feature_level.len() as u32; - device_levels.pFeatureLevelsRequested = d3d_feature_level.as_ptr().cast(); - unsafe { - device.CheckFeatureSupport( - winapi_d3d12::D3D12_FEATURE_FEATURE_LEVELS, - (&mut device_levels as *mut FeatureLevelsInfo).cast(), - std::mem::size_of::() as _, - ) - }; - // This cast should never fail because we only requested feature levels that are already in the enum. - let max_feature_level = d3d12::FeatureLevel::try_from(device_levels.MaxSupportedFeatureLevel) - .expect("Unexpected feature level"); - max_feature_level -} - -fn wgpu_to_d3d12(format: wgpu::TextureFormat) -> Option { - // Copied wholesale from: - // https://github.com/gfx-rs/wgpu/blob/v0.19/wgpu-hal/src/auxil/dxgi/conv.rs#L12-L94 - // license: MIT OR Apache-2.0 - use wgpu::TextureFormat as Tf; - use winapi::shared::dxgiformat::*; - - Some(match format { - Tf::R8Unorm => DXGI_FORMAT_R8_UNORM, - Tf::R8Snorm => DXGI_FORMAT_R8_SNORM, - Tf::R8Uint => DXGI_FORMAT_R8_UINT, - Tf::R8Sint => DXGI_FORMAT_R8_SINT, - Tf::R16Uint => DXGI_FORMAT_R16_UINT, - Tf::R16Sint => DXGI_FORMAT_R16_SINT, - Tf::R16Unorm => DXGI_FORMAT_R16_UNORM, - Tf::R16Snorm => DXGI_FORMAT_R16_SNORM, - Tf::R16Float => DXGI_FORMAT_R16_FLOAT, - Tf::Rg8Unorm => DXGI_FORMAT_R8G8_UNORM, - Tf::Rg8Snorm => DXGI_FORMAT_R8G8_SNORM, - Tf::Rg8Uint => DXGI_FORMAT_R8G8_UINT, - Tf::Rg8Sint => DXGI_FORMAT_R8G8_SINT, - Tf::Rg16Unorm => DXGI_FORMAT_R16G16_UNORM, - Tf::Rg16Snorm => DXGI_FORMAT_R16G16_SNORM, - Tf::R32Uint => DXGI_FORMAT_R32_UINT, - Tf::R32Sint => DXGI_FORMAT_R32_SINT, - Tf::R32Float => DXGI_FORMAT_R32_FLOAT, - Tf::Rg16Uint => DXGI_FORMAT_R16G16_UINT, - Tf::Rg16Sint => DXGI_FORMAT_R16G16_SINT, - Tf::Rg16Float => DXGI_FORMAT_R16G16_FLOAT, - Tf::Rgba8Unorm => DXGI_FORMAT_R8G8B8A8_UNORM, - Tf::Rgba8UnormSrgb => DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, - Tf::Bgra8UnormSrgb => DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, - Tf::Rgba8Snorm => DXGI_FORMAT_R8G8B8A8_SNORM, - Tf::Bgra8Unorm => DXGI_FORMAT_B8G8R8A8_UNORM, - Tf::Rgba8Uint => DXGI_FORMAT_R8G8B8A8_UINT, - Tf::Rgba8Sint => DXGI_FORMAT_R8G8B8A8_SINT, - Tf::Rgb9e5Ufloat => DXGI_FORMAT_R9G9B9E5_SHAREDEXP, - Tf::Rgb10a2Uint => DXGI_FORMAT_R10G10B10A2_UINT, - Tf::Rgb10a2Unorm => DXGI_FORMAT_R10G10B10A2_UNORM, - Tf::Rg11b10Float => DXGI_FORMAT_R11G11B10_FLOAT, - Tf::Rg32Uint => DXGI_FORMAT_R32G32_UINT, - Tf::Rg32Sint => DXGI_FORMAT_R32G32_SINT, - Tf::Rg32Float => DXGI_FORMAT_R32G32_FLOAT, - Tf::Rgba16Uint => DXGI_FORMAT_R16G16B16A16_UINT, - Tf::Rgba16Sint => DXGI_FORMAT_R16G16B16A16_SINT, - Tf::Rgba16Unorm => DXGI_FORMAT_R16G16B16A16_UNORM, - Tf::Rgba16Snorm => DXGI_FORMAT_R16G16B16A16_SNORM, - Tf::Rgba16Float => DXGI_FORMAT_R16G16B16A16_FLOAT, - Tf::Rgba32Uint => DXGI_FORMAT_R32G32B32A32_UINT, - Tf::Rgba32Sint => DXGI_FORMAT_R32G32B32A32_SINT, - Tf::Rgba32Float => DXGI_FORMAT_R32G32B32A32_FLOAT, - Tf::Stencil8 => DXGI_FORMAT_D24_UNORM_S8_UINT, - Tf::Depth16Unorm => DXGI_FORMAT_D16_UNORM, - Tf::Depth24Plus => DXGI_FORMAT_D24_UNORM_S8_UINT, - Tf::Depth24PlusStencil8 => DXGI_FORMAT_D24_UNORM_S8_UINT, - Tf::Depth32Float => DXGI_FORMAT_D32_FLOAT, - Tf::Depth32FloatStencil8 => DXGI_FORMAT_D32_FLOAT_S8X24_UINT, - Tf::NV12 => DXGI_FORMAT_NV12, - Tf::Bc1RgbaUnorm => DXGI_FORMAT_BC1_UNORM, - Tf::Bc1RgbaUnormSrgb => DXGI_FORMAT_BC1_UNORM_SRGB, - Tf::Bc2RgbaUnorm => DXGI_FORMAT_BC2_UNORM, - Tf::Bc2RgbaUnormSrgb => DXGI_FORMAT_BC2_UNORM_SRGB, - Tf::Bc3RgbaUnorm => DXGI_FORMAT_BC3_UNORM, - Tf::Bc3RgbaUnormSrgb => DXGI_FORMAT_BC3_UNORM_SRGB, - Tf::Bc4RUnorm => DXGI_FORMAT_BC4_UNORM, - Tf::Bc4RSnorm => DXGI_FORMAT_BC4_SNORM, - Tf::Bc5RgUnorm => DXGI_FORMAT_BC5_UNORM, - Tf::Bc5RgSnorm => DXGI_FORMAT_BC5_SNORM, - Tf::Bc6hRgbUfloat => DXGI_FORMAT_BC6H_UF16, - Tf::Bc6hRgbFloat => DXGI_FORMAT_BC6H_SF16, - Tf::Bc7RgbaUnorm => DXGI_FORMAT_BC7_UNORM, - Tf::Bc7RgbaUnormSrgb => DXGI_FORMAT_BC7_UNORM_SRGB, - Tf::Etc2Rgb8Unorm - | Tf::Etc2Rgb8UnormSrgb - | Tf::Etc2Rgb8A1Unorm - | Tf::Etc2Rgb8A1UnormSrgb - | Tf::Etc2Rgba8Unorm - | Tf::Etc2Rgba8UnormSrgb - | Tf::EacR11Unorm - | Tf::EacR11Snorm - | Tf::EacRg11Unorm - | Tf::EacRg11Snorm - | Tf::Astc { - block: _, - channel: _, - } => return None, - }) -} diff --git a/src/graphics/extensions.rs b/src/graphics/extensions.rs deleted file mode 100644 index 81d8ca7..0000000 --- a/src/graphics/extensions.rs +++ /dev/null @@ -1,252 +0,0 @@ -use openxr::ExtensionSet; -use std::ops; - -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct XrExtensions(ExtensionSet); -impl XrExtensions { - pub fn raw_mut(&mut self) -> &mut ExtensionSet { - &mut self.0 - } - pub fn raw(&self) -> &ExtensionSet { - &self.0 - } - pub fn enable_fb_passthrough(&mut self) -> &mut Self { - self.0.fb_passthrough = true; - self - } - pub fn disable_fb_passthrough(&mut self) -> &mut Self { - self.0.fb_passthrough = false; - self - } - pub fn enable_hand_tracking(&mut self) -> &mut Self { - self.0.ext_hand_tracking = true; - self - } - pub fn disable_hand_tracking(&mut self) -> &mut Self { - self.0.ext_hand_tracking = false; - self - } - pub fn enable_local_floor(&mut self) -> &mut Self { - self.0.ext_local_floor = true; - self - } - pub fn disable_local_floor(&mut self) -> &mut Self { - self.0.ext_local_floor = false; - self - } -} -impl From for XrExtensions { - fn from(value: ExtensionSet) -> Self { - Self(value) - } -} -impl From for ExtensionSet { - fn from(val: XrExtensions) -> Self { - val.0 - } -} -impl Default for XrExtensions { - fn default() -> Self { - let mut exts = ExtensionSet::default(); - exts.ext_hand_tracking = true; - exts.ext_local_floor = true; - Self(exts) - } -} -impl ops::BitAnd for XrExtensions { - type Output = Self; - - fn bitand(self, rhs: Self) -> Self::Output { - let mut out = ExtensionSet::default(); - out.ext_local_floor = self.0.ext_local_floor && rhs.0.ext_local_floor; - out.almalence_digital_lens_control = - self.0.almalence_digital_lens_control && rhs.0.almalence_digital_lens_control; - out.epic_view_configuration_fov = - self.0.epic_view_configuration_fov && rhs.0.epic_view_configuration_fov; - out.ext_performance_settings = - self.0.ext_performance_settings && rhs.0.ext_performance_settings; - out.ext_thermal_query = self.0.ext_thermal_query && rhs.0.ext_thermal_query; - out.ext_debug_utils = self.0.ext_debug_utils && rhs.0.ext_debug_utils; - out.ext_eye_gaze_interaction = - self.0.ext_eye_gaze_interaction && rhs.0.ext_eye_gaze_interaction; - out.ext_view_configuration_depth_range = - self.0.ext_view_configuration_depth_range && rhs.0.ext_view_configuration_depth_range; - out.ext_conformance_automation = - self.0.ext_conformance_automation && rhs.0.ext_conformance_automation; - out.ext_hand_tracking = self.0.ext_hand_tracking && rhs.0.ext_hand_tracking; - out.ext_dpad_binding = self.0.ext_dpad_binding && rhs.0.ext_dpad_binding; - out.ext_hand_joints_motion_range = - self.0.ext_hand_joints_motion_range && rhs.0.ext_hand_joints_motion_range; - out.ext_samsung_odyssey_controller = - self.0.ext_samsung_odyssey_controller && rhs.0.ext_samsung_odyssey_controller; - out.ext_hp_mixed_reality_controller = - self.0.ext_hp_mixed_reality_controller && rhs.0.ext_hp_mixed_reality_controller; - out.ext_palm_pose = self.0.ext_palm_pose && rhs.0.ext_palm_pose; - out.ext_uuid = self.0.ext_uuid && rhs.0.ext_uuid; - // out.extx_overlay = self.0.extx_overlay && rhs.0.extx_overlay; - out.fb_composition_layer_image_layout = - self.0.fb_composition_layer_image_layout && rhs.0.fb_composition_layer_image_layout; - out.fb_composition_layer_alpha_blend = - self.0.fb_composition_layer_alpha_blend && rhs.0.fb_composition_layer_alpha_blend; - out.fb_swapchain_update_state = - self.0.fb_swapchain_update_state && rhs.0.fb_swapchain_update_state; - out.fb_composition_layer_secure_content = - self.0.fb_composition_layer_secure_content && rhs.0.fb_composition_layer_secure_content; - out.fb_display_refresh_rate = - self.0.fb_display_refresh_rate && rhs.0.fb_display_refresh_rate; - out.fb_color_space = self.0.fb_color_space && rhs.0.fb_color_space; - out.fb_hand_tracking_mesh = self.0.fb_hand_tracking_mesh && rhs.0.fb_hand_tracking_mesh; - out.fb_hand_tracking_aim = self.0.fb_hand_tracking_aim && rhs.0.fb_hand_tracking_aim; - out.fb_hand_tracking_capsules = - self.0.fb_hand_tracking_capsules && rhs.0.fb_hand_tracking_capsules; - out.fb_spatial_entity = self.0.fb_spatial_entity && rhs.0.fb_spatial_entity; - out.fb_foveation = self.0.fb_foveation && rhs.0.fb_foveation; - out.fb_foveation_configuration = - self.0.fb_foveation_configuration && rhs.0.fb_foveation_configuration; - out.fb_keyboard_tracking = self.0.fb_keyboard_tracking && rhs.0.fb_keyboard_tracking; - out.fb_triangle_mesh = self.0.fb_triangle_mesh && rhs.0.fb_triangle_mesh; - out.fb_passthrough = self.0.fb_passthrough && rhs.0.fb_passthrough; - out.fb_render_model = self.0.fb_render_model && rhs.0.fb_render_model; - out.fb_spatial_entity_query = - self.0.fb_spatial_entity_query && rhs.0.fb_spatial_entity_query; - out.fb_spatial_entity_storage = - self.0.fb_spatial_entity_storage && rhs.0.fb_spatial_entity_storage; - out.fb_foveation_vulkan = self.0.fb_foveation_vulkan && rhs.0.fb_foveation_vulkan; - out.fb_swapchain_update_state_opengl_es = - self.0.fb_swapchain_update_state_opengl_es && rhs.0.fb_swapchain_update_state_opengl_es; - out.fb_swapchain_update_state_vulkan = - self.0.fb_swapchain_update_state_vulkan && rhs.0.fb_swapchain_update_state_vulkan; - out.fb_space_warp = self.0.fb_space_warp && rhs.0.fb_space_warp; - out.fb_scene = self.0.fb_scene && rhs.0.fb_scene; - out.fb_spatial_entity_container = - self.0.fb_spatial_entity_container && rhs.0.fb_spatial_entity_container; - out.fb_passthrough_keyboard_hands = - self.0.fb_passthrough_keyboard_hands && rhs.0.fb_passthrough_keyboard_hands; - out.fb_composition_layer_settings = - self.0.fb_composition_layer_settings && rhs.0.fb_composition_layer_settings; - out.htc_vive_cosmos_controller_interaction = self.0.htc_vive_cosmos_controller_interaction - && rhs.0.htc_vive_cosmos_controller_interaction; - out.htc_facial_tracking = self.0.htc_facial_tracking && rhs.0.htc_facial_tracking; - out.htc_vive_focus3_controller_interaction = self.0.htc_vive_focus3_controller_interaction - && rhs.0.htc_vive_focus3_controller_interaction; - out.htc_hand_interaction = self.0.htc_hand_interaction && rhs.0.htc_hand_interaction; - out.htc_vive_wrist_tracker_interaction = - self.0.htc_vive_wrist_tracker_interaction && rhs.0.htc_vive_wrist_tracker_interaction; - // out.htcx_vive_tracker_interaction = - // self.0.htcx_vive_tracker_interaction && rhs.0.htcx_vive_tracker_interaction; - out.huawei_controller_interaction = - self.0.huawei_controller_interaction && rhs.0.huawei_controller_interaction; - out.khr_composition_layer_cube = - self.0.khr_composition_layer_cube && rhs.0.khr_composition_layer_cube; - out.khr_composition_layer_depth = - self.0.khr_composition_layer_depth && rhs.0.khr_composition_layer_depth; - out.khr_vulkan_swapchain_format_list = - self.0.khr_vulkan_swapchain_format_list && rhs.0.khr_vulkan_swapchain_format_list; - out.khr_composition_layer_cylinder = - self.0.khr_composition_layer_cylinder && rhs.0.khr_composition_layer_cylinder; - out.khr_composition_layer_equirect = - self.0.khr_composition_layer_equirect && rhs.0.khr_composition_layer_equirect; - out.khr_opengl_enable = self.0.khr_opengl_enable && rhs.0.khr_opengl_enable; - out.khr_opengl_es_enable = self.0.khr_opengl_es_enable && rhs.0.khr_opengl_es_enable; - out.khr_vulkan_enable = self.0.khr_vulkan_enable && rhs.0.khr_vulkan_enable; - out.khr_visibility_mask = self.0.khr_visibility_mask && rhs.0.khr_visibility_mask; - out.khr_composition_layer_color_scale_bias = self.0.khr_composition_layer_color_scale_bias - && rhs.0.khr_composition_layer_color_scale_bias; - out.khr_convert_timespec_time = - self.0.khr_convert_timespec_time && rhs.0.khr_convert_timespec_time; - out.khr_loader_init = self.0.khr_loader_init && rhs.0.khr_loader_init; - out.khr_vulkan_enable2 = self.0.khr_vulkan_enable2 && rhs.0.khr_vulkan_enable2; - out.khr_composition_layer_equirect2 = - self.0.khr_composition_layer_equirect2 && rhs.0.khr_composition_layer_equirect2; - out.khr_binding_modification = - self.0.khr_binding_modification && rhs.0.khr_binding_modification; - out.khr_swapchain_usage_input_attachment_bit = - self.0.khr_swapchain_usage_input_attachment_bit - && rhs.0.khr_swapchain_usage_input_attachment_bit; - out.meta_vulkan_swapchain_create_info = - self.0.meta_vulkan_swapchain_create_info && rhs.0.meta_vulkan_swapchain_create_info; - out.meta_performance_metrics = - self.0.meta_performance_metrics && rhs.0.meta_performance_metrics; - out.ml_ml2_controller_interaction = - self.0.ml_ml2_controller_interaction && rhs.0.ml_ml2_controller_interaction; - out.mnd_headless = self.0.mnd_headless && rhs.0.mnd_headless; - out.mnd_swapchain_usage_input_attachment_bit = - self.0.mnd_swapchain_usage_input_attachment_bit - && rhs.0.mnd_swapchain_usage_input_attachment_bit; - // out.mndx_egl_enable = self.0.mndx_egl_enable && rhs.0.mndx_egl_enable; - out.msft_unbounded_reference_space = - self.0.msft_unbounded_reference_space && rhs.0.msft_unbounded_reference_space; - out.msft_spatial_anchor = self.0.msft_spatial_anchor && rhs.0.msft_spatial_anchor; - out.msft_spatial_graph_bridge = - self.0.msft_spatial_graph_bridge && rhs.0.msft_spatial_graph_bridge; - out.msft_hand_interaction = self.0.msft_hand_interaction && rhs.0.msft_hand_interaction; - out.msft_hand_tracking_mesh = - self.0.msft_hand_tracking_mesh && rhs.0.msft_hand_tracking_mesh; - out.msft_secondary_view_configuration = - self.0.msft_secondary_view_configuration && rhs.0.msft_secondary_view_configuration; - out.msft_first_person_observer = - self.0.msft_first_person_observer && rhs.0.msft_first_person_observer; - out.msft_controller_model = self.0.msft_controller_model && rhs.0.msft_controller_model; - out.msft_composition_layer_reprojection = - self.0.msft_composition_layer_reprojection && rhs.0.msft_composition_layer_reprojection; - out.msft_spatial_anchor_persistence = - self.0.msft_spatial_anchor_persistence && rhs.0.msft_spatial_anchor_persistence; - out.oculus_audio_device_guid = - self.0.oculus_audio_device_guid && rhs.0.oculus_audio_device_guid; - out.ultraleap_hand_tracking_forearm = - self.0.ultraleap_hand_tracking_forearm && rhs.0.ultraleap_hand_tracking_forearm; - out.valve_analog_threshold = self.0.valve_analog_threshold && rhs.0.valve_analog_threshold; - out.varjo_quad_views = self.0.varjo_quad_views && rhs.0.varjo_quad_views; - out.varjo_foveated_rendering = - self.0.varjo_foveated_rendering && rhs.0.varjo_foveated_rendering; - out.varjo_composition_layer_depth_test = - self.0.varjo_composition_layer_depth_test && rhs.0.varjo_composition_layer_depth_test; - out.varjo_environment_depth_estimation = - self.0.varjo_environment_depth_estimation && rhs.0.varjo_environment_depth_estimation; - out.varjo_marker_tracking = self.0.varjo_marker_tracking && rhs.0.varjo_marker_tracking; - out.varjo_view_offset = self.0.varjo_view_offset && rhs.0.varjo_view_offset; - and_android_only_exts(&self, &rhs, &mut out); - and_windows_only_exts(&self, &rhs, &mut out); - for ext in self.0.other { - if rhs.0.other.contains(&ext) { - out.other.push(ext); - } - } - Self(out) - } -} - -#[cfg(not(target_os = "android"))] -fn and_android_only_exts(lhs: &XrExtensions, rhs: &XrExtensions, out: &mut ExtensionSet) {} -#[cfg(not(windows))] -fn and_windows_only_exts(lhs: &XrExtensions, rhs: &XrExtensions, out: &mut ExtensionSet) {} -#[cfg(target_os = "android")] -fn and_android_only_exts(lhs: &XrExtensions, rhs: &XrExtensions, out: &mut ExtensionSet) { - out.oculus_android_session_state_enable = - lhs.0.oculus_android_session_state_enable && rhs.0.oculus_android_session_state_enable; - out.khr_loader_init_android = lhs.0.khr_loader_init_android && rhs.0.khr_loader_init_android; - out.fb_android_surface_swapchain_create = - lhs.0.fb_android_surface_swapchain_create && rhs.0.fb_android_surface_swapchain_create; - out.fb_swapchain_update_state_android_surface = lhs.0.fb_swapchain_update_state_android_surface - && rhs.0.fb_swapchain_update_state_android_surface; - out.khr_android_thread_settings = - lhs.0.khr_android_thread_settings && rhs.0.khr_android_thread_settings; - out.khr_android_surface_swapchain = - lhs.0.khr_android_surface_swapchain && rhs.0.khr_android_surface_swapchain; - out.khr_android_create_instance = - lhs.0.khr_android_create_instance && rhs.0.khr_android_create_instance; -} -#[cfg(windows)] -fn and_windows_only_exts(lhs: &XrExtensions, rhs: &XrExtensions, out: &mut ExtensionSet) { - out.ext_win32_appcontainer_compatible = - lhs.0.ext_win32_appcontainer_compatible && rhs.0.ext_win32_appcontainer_compatible; - out.khr_d3d11_enable = lhs.0.khr_d3d11_enable && rhs.0.khr_d3d11_enable; - out.khr_d3d12_enable = lhs.0.khr_d3d12_enable && rhs.0.khr_d3d12_enable; - out.khr_win32_convert_performance_counter_time = - lhs.0.khr_win32_convert_performance_counter_time - && rhs.0.khr_win32_convert_performance_counter_time; - out.msft_perception_anchor_interop = - lhs.0.msft_perception_anchor_interop && rhs.0.msft_perception_anchor_interop; - out.msft_holographic_window_attachment = - lhs.0.msft_holographic_window_attachment && rhs.0.msft_holographic_window_attachment; -} diff --git a/src/graphics/mod.rs b/src/graphics/mod.rs deleted file mode 100644 index 633c563..0000000 --- a/src/graphics/mod.rs +++ /dev/null @@ -1,243 +0,0 @@ -pub mod extensions; - -#[cfg(all(feature = "d3d12", windows))] -mod d3d12; -#[cfg(feature = "vulkan")] -mod vulkan; - -use std::sync::Arc; - -use bevy::ecs::query::With; -use bevy::ecs::system::{Query, SystemState}; -use bevy::ecs::world::World; -use bevy::render::renderer::{ - RenderAdapter, RenderAdapterInfo, RenderDevice, RenderInstance, RenderQueue, WgpuWrapper, -}; -use bevy::window::{PrimaryWindow, RawHandleWrapper}; -use wgpu::Instance; - -use crate::input::XrInput; -use crate::resources::{ - XrEnvironmentBlendMode, XrFormat, XrFrameState, XrFrameWaiter, XrInstance, XrResolution, - XrSession, XrSessionRunning, XrSwapchain, XrViews, -}; -use crate::OXrSessionSetupInfo; - -use crate::Backend; - -use openxr as xr; - -use self::extensions::XrExtensions; - -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum XrPreferdBlendMode { - Opaque, - Additive, - AlphaBlend, -} -impl Default for XrPreferdBlendMode { - fn default() -> Self { - Self::Opaque - } -} - -#[derive(Clone, Debug)] -pub struct XrAppInfo { - pub name: String, -} -impl Default for XrAppInfo { - fn default() -> Self { - Self { - name: "Ambient".into(), - } - } -} - -pub fn start_xr_session( - window: Option, - session_setup_data: &OXrSessionSetupInfo, - xr_instance: &XrInstance, - render_device: &RenderDevice, - render_adapter: &RenderAdapter, - wgpu_instance: &Instance, -) -> eyre::Result<( - XrSession, - XrResolution, - XrFormat, - XrSessionRunning, - XrFrameWaiter, - XrSwapchain, - XrInput, - XrViews, - XrFrameState, -)> { - match session_setup_data { - #[cfg(feature = "vulkan")] - OXrSessionSetupInfo::Vulkan(_) => vulkan::start_xr_session( - window, - session_setup_data, - xr_instance, - render_device, - render_adapter, - wgpu_instance, - ), - #[cfg(all(feature = "d3d12", windows))] - OXrSessionSetupInfo::D3D12(_) => d3d12::start_xr_session( - window, - session_setup_data, - xr_instance, - render_device, - render_adapter, - wgpu_instance, - ), - } -} -pub fn initialize_xr_instance( - backend_preference: &[Backend], - window: Option, - reqeusted_extensions: XrExtensions, - prefered_blend_mode: XrPreferdBlendMode, - app_info: XrAppInfo, -) -> eyre::Result<( - XrInstance, - OXrSessionSetupInfo, - XrEnvironmentBlendMode, - RenderDevice, - RenderQueue, - RenderAdapterInfo, - RenderAdapter, - Instance, -)> { - if backend_preference.is_empty() { - eyre::bail!("Cannot initialize with no backend selected"); - } - let xr_entry = xr_entry()?; - - #[cfg(target_os = "android")] - xr_entry.initialize_android_loader()?; - - let available_extensions: XrExtensions = xr_entry.enumerate_extensions()?.into(); - - for backend in backend_preference { - match backend { - #[cfg(feature = "vulkan")] - Backend::Vulkan => { - if !available_extensions.raw().khr_vulkan_enable2 { - continue; - } - return vulkan::initialize_xr_instance( - window, - xr_entry, - reqeusted_extensions, - available_extensions, - prefered_blend_mode, - app_info, - ); - } - #[cfg(all(feature = "d3d12", windows))] - Backend::D3D12 => { - if !available_extensions.raw().khr_d3d12_enable { - continue; - } - return d3d12::initialize_xr_instance( - window, - xr_entry, - reqeusted_extensions, - available_extensions, - prefered_blend_mode, - app_info, - ); - } - } - } - eyre::bail!( - "No selected backend was supported by the runtime. Selected: {:?}", - backend_preference - ); -} - -pub fn try_full_init( - world: &mut World, - backend_preference: &[Backend], - reqeusted_extensions: XrExtensions, - prefered_blend_mode: XrPreferdBlendMode, - app_info: XrAppInfo, -) -> eyre::Result<( - RenderDevice, - RenderQueue, - RenderAdapterInfo, - RenderAdapter, - RenderInstance, -)> { - let mut system_state: SystemState>> = - SystemState::new(world); - let primary_window = system_state.get(world).get_single().ok().cloned(); - let ( - xr_instance, - setup_info, - blend_mode, - render_device, - render_queue, - render_adapter_info, - render_adapter, - wgpu_instance, - ) = initialize_xr_instance( - backend_preference, - primary_window.clone(), - reqeusted_extensions, - prefered_blend_mode, - app_info, - )?; - world.insert_resource(xr_instance); - world.insert_non_send_resource(setup_info); - // TODO: move BlendMode the session init? - world.insert_resource(blend_mode); - let setup_info = world - .get_non_send_resource::() - .unwrap(); - let xr_instance = world.get_resource::().unwrap(); - - let ( - xr_session, - xr_resolution, - xr_format, - xr_session_running, - xr_frame_waiter, - xr_swapchain, - xr_input, - xr_views, - xr_frame_state, - ) = start_xr_session( - primary_window, - setup_info, - xr_instance, - &render_device, - &render_adapter, - &wgpu_instance, - )?; - world.insert_resource(xr_session); - world.insert_resource(xr_resolution); - world.insert_resource(xr_format); - world.insert_resource(xr_session_running); - world.insert_resource(xr_frame_waiter); - world.insert_resource(xr_swapchain); - world.insert_resource(xr_input); - world.insert_resource(xr_views); - world.insert_resource(xr_frame_state); - - Ok(( - render_device, - render_queue, - render_adapter_info, - render_adapter, - RenderInstance(Arc::new(WgpuWrapper::new(wgpu_instance))), - )) -} - -pub fn xr_entry() -> eyre::Result { - #[cfg(windows)] - let entry = Ok(xr::Entry::linked()); - #[cfg(not(windows))] - let entry = unsafe { xr::Entry::load().map_err(|e| eyre::eyre!(e)) }; - entry -} diff --git a/src/graphics/vulkan.rs b/src/graphics/vulkan.rs deleted file mode 100644 index ce48db3..0000000 --- a/src/graphics/vulkan.rs +++ /dev/null @@ -1,606 +0,0 @@ -use std::ffi::{c_void, CString}; -use std::sync::atomic::AtomicBool; -use std::sync::{Arc, Mutex}; - -// use anyhow::Context; -use ash::vk::{self, Handle}; -use bevy::math::uvec2; -use bevy::prelude::*; -use bevy::render::renderer::{ - RenderAdapter, RenderAdapterInfo, RenderDevice, RenderQueue, WgpuWrapper, -}; -use bevy::window::RawHandleWrapper; -use eyre::{Context, ContextCompat}; -use openxr as xr; -use wgpu::Instance; -use wgpu_hal::{api::Vulkan as V, Api}; -use xr::EnvironmentBlendMode; - -use crate::graphics::extensions::XrExtensions; -use crate::input::XrInput; - -use crate::resources::{ - OXrSessionSetupInfo, Swapchain, SwapchainInner, VulkanOXrSessionSetupInfo, - XrEnvironmentBlendMode, XrFormat, XrFrameState, XrFrameWaiter, XrInstance, XrResolution, - XrSession, XrSessionRunning, XrSwapchain, XrViews, -}; -use crate::VIEW_TYPE; - -use super::{XrAppInfo, XrPreferdBlendMode}; - -pub fn initialize_xr_instance( - window: Option, - xr_entry: xr::Entry, - reqeusted_extensions: XrExtensions, - available_extensions: XrExtensions, - prefered_blend_mode: XrPreferdBlendMode, - app_info: XrAppInfo, -) -> eyre::Result<( - XrInstance, - OXrSessionSetupInfo, - XrEnvironmentBlendMode, - RenderDevice, - RenderQueue, - RenderAdapterInfo, - RenderAdapter, - Instance, -)> { - #[cfg(target_os = "android")] - xr_entry.initialize_android_loader()?; - - assert!(available_extensions.raw().khr_vulkan_enable2); - // info!("available OpenXR extensions: {:#?}", available_extensions); - - let mut enabled_extensions: xr::ExtensionSet = - (available_extensions & reqeusted_extensions).into(); - enabled_extensions.khr_vulkan_enable2 = true; - #[cfg(target_os = "android")] - { - enabled_extensions.khr_android_create_instance = true; - } - - let available_layers = xr_entry.enumerate_layers()?; - // info!("available OpenXR layers: {:#?}", available_layers); - - let xr_instance = xr_entry.create_instance( - &xr::ApplicationInfo { - application_name: &app_info.name, - engine_name: "Bevy", - ..Default::default() - }, - &enabled_extensions, - &[], - )?; - info!("created OpenXR instance"); - let instance_props = xr_instance.properties()?; - let xr_system_id = xr_instance.system(xr::FormFactor::HEAD_MOUNTED_DISPLAY)?; - info!("created OpenXR system"); - let system_props = xr_instance.system_properties(xr_system_id).unwrap(); - info!( - "loaded OpenXR runtime: {} {} {}", - instance_props.runtime_name, - instance_props.runtime_version, - if system_props.system_name.is_empty() { - "" - } else { - &system_props.system_name - } - ); - - let blend_modes = xr_instance.enumerate_environment_blend_modes(xr_system_id, VIEW_TYPE)?; - let blend_mode: EnvironmentBlendMode = match prefered_blend_mode { - XrPreferdBlendMode::Opaque if blend_modes.contains(&EnvironmentBlendMode::OPAQUE) => { - bevy::log::info!("Using Opaque"); - EnvironmentBlendMode::OPAQUE - } - XrPreferdBlendMode::Additive if blend_modes.contains(&EnvironmentBlendMode::ADDITIVE) => { - bevy::log::info!("Using Additive"); - EnvironmentBlendMode::ADDITIVE - } - XrPreferdBlendMode::AlphaBlend - if blend_modes.contains(&EnvironmentBlendMode::ALPHA_BLEND) => - { - bevy::log::info!("Using AlphaBlend"); - EnvironmentBlendMode::ALPHA_BLEND - } - _ => { - bevy::log::info!("Using Opaque"); - EnvironmentBlendMode::OPAQUE - } - }; - - #[cfg(not(target_os = "android"))] - let vk_target_version = vk::make_api_version(0, 1, 2, 0); - #[cfg(not(target_os = "android"))] - let vk_target_version_xr = xr::Version::new(1, 2, 0); - - #[cfg(target_os = "android")] - let vk_target_version = vk::make_api_version(0, 1, 1, 0); - #[cfg(target_os = "android")] - let vk_target_version_xr = xr::Version::new(1, 1, 0); - - let reqs = xr_instance.graphics_requirements::(xr_system_id)?; - if vk_target_version_xr < reqs.min_api_version_supported - || vk_target_version_xr.major() > reqs.max_api_version_supported.major() - { - panic!( - "OpenXR runtime requires Vulkan version >= {}, < {}.0.0", - reqs.min_api_version_supported, - reqs.max_api_version_supported.major() + 1 - ); - } - - let vk_entry = unsafe { ash::Entry::load() }?; - let flags = wgpu::InstanceFlags::from_build_config(); - let extensions = ::Instance::desired_extensions(&vk_entry, vk_target_version, flags)?; - let device_extensions = vec![ - ash::extensions::khr::Swapchain::name(), - ash::extensions::khr::DrawIndirectCount::name(), - #[cfg(target_os = "android")] - ash::extensions::khr::TimelineSemaphore::name(), - ]; - info!( - "creating Vulkan instance with these extensions: {:#?}", - extensions - ); - - let vk_instance = unsafe { - let extensions_cchar: Vec<_> = extensions.iter().map(|s| s.as_ptr()).collect(); - - let app_name = CString::new(app_info.name)?; - let vk_app_info = vk::ApplicationInfo::builder() - .application_name(&app_name) - .application_version(1) - .engine_name(&app_name) - .engine_version(1) - .api_version(vk_target_version); - - let vk_instance = xr_instance - .create_vulkan_instance( - xr_system_id, - std::mem::transmute(vk_entry.static_fn().get_instance_proc_addr), - &vk::InstanceCreateInfo::builder() - .application_info(&vk_app_info) - .enabled_extension_names(&extensions_cchar) as *const _ - as *const _, - ) - .context("OpenXR error creating Vulkan instance") - .unwrap() - .map_err(vk::Result::from_raw) - .context("Vulkan error creating Vulkan instance") - .unwrap(); - - ash::Instance::load( - vk_entry.static_fn(), - vk::Instance::from_raw(vk_instance as _), - ) - }; - info!("created Vulkan instance"); - - let vk_instance_ptr = vk_instance.handle().as_raw() as *const c_void; - - let vk_physical_device = vk::PhysicalDevice::from_raw(unsafe { - xr_instance.vulkan_graphics_device(xr_system_id, vk_instance.handle().as_raw() as _)? as _ - }); - let vk_physical_device_ptr = vk_physical_device.as_raw() as *const c_void; - - let vk_device_properties = - unsafe { vk_instance.get_physical_device_properties(vk_physical_device) }; - if vk_device_properties.api_version < vk_target_version { - unsafe { vk_instance.destroy_instance(None) } - panic!("Vulkan physical device doesn't support version 1.1"); - } - - let wgpu_vk_instance = unsafe { - ::Instance::from_raw( - vk_entry.clone(), - vk_instance.clone(), - vk_target_version, - 0, - None, - extensions, - flags, - false, - Some(Box::new(())), - )? - }; - - let wgpu_features = wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES - | wgpu::Features::MULTIVIEW - | wgpu::Features::MULTI_DRAW_INDIRECT_COUNT - | wgpu::Features::MULTI_DRAW_INDIRECT; - - let wgpu_exposed_adapter = wgpu_vk_instance - .expose_adapter(vk_physical_device) - .context("failed to expose adapter")?; - - let enabled_extensions = wgpu_exposed_adapter - .adapter - .required_device_extensions(wgpu_features); - - let (wgpu_open_device, vk_device_ptr, queue_family_index) = { - let extensions_cchar: Vec<_> = device_extensions.iter().map(|s| s.as_ptr()).collect(); - let mut enabled_phd_features = wgpu_exposed_adapter - .adapter - .physical_device_features(&enabled_extensions, wgpu_features); - let family_index = 0; - let family_info = vk::DeviceQueueCreateInfo::builder() - .queue_family_index(family_index) - .queue_priorities(&[1.0]) - .build(); - let family_infos = [family_info]; - let info = enabled_phd_features - .add_to_device_create_builder( - vk::DeviceCreateInfo::builder() - .queue_create_infos(&family_infos) - .push_next(&mut vk::PhysicalDeviceMultiviewFeatures { - multiview: vk::TRUE, - ..Default::default() - }), - ) - .enabled_extension_names(&extensions_cchar) - .build(); - let vk_device = unsafe { - let vk_device = xr_instance - .create_vulkan_device( - xr_system_id, - std::mem::transmute(vk_entry.static_fn().get_instance_proc_addr), - vk_physical_device.as_raw() as _, - &info as *const _ as *const _, - ) - .context("OpenXR error creating Vulkan device")? - .map_err(vk::Result::from_raw) - .context("Vulkan error creating Vulkan device")?; - - ash::Device::load(vk_instance.fp_v1_0(), vk::Device::from_raw(vk_device as _)) - }; - let vk_device_ptr = vk_device.handle().as_raw() as *const c_void; - - let wgpu_open_device = unsafe { - wgpu_exposed_adapter.adapter.device_from_raw( - vk_device, - true, - &enabled_extensions, - wgpu_features, - family_info.queue_family_index, - 0, - ) - }?; - - ( - wgpu_open_device, - vk_device_ptr, - family_info.queue_family_index, - ) - }; - - let wgpu_instance = - unsafe { wgpu::Instance::from_hal::(wgpu_vk_instance) }; - let wgpu_adapter = unsafe { wgpu_instance.create_adapter_from_hal(wgpu_exposed_adapter) }; - let (wgpu_device, wgpu_queue) = unsafe { - wgpu_adapter.create_device_from_hal( - wgpu_open_device, - &wgpu::DeviceDescriptor { - label: None, - required_features: wgpu_features, - required_limits: wgpu::Limits { - max_bind_groups: 8, - max_storage_buffer_binding_size: wgpu_adapter - .limits() - .max_storage_buffer_binding_size, - max_push_constant_size: 4, - ..Default::default() - }, - }, - None, - ) - }?; - Ok(( - xr_instance.into(), - OXrSessionSetupInfo::Vulkan(VulkanOXrSessionSetupInfo { - device_ptr: vk_device_ptr, - physical_device_ptr: vk_physical_device_ptr, - vk_instance_ptr, - queue_family_index, - xr_system_id, - }), - blend_mode.into(), - wgpu_device.into(), - RenderQueue(Arc::new(WgpuWrapper::new(wgpu_queue))), - RenderAdapterInfo(WgpuWrapper::new(wgpu_adapter.get_info())), - RenderAdapter(Arc::new(WgpuWrapper::new(wgpu_adapter))), - wgpu_instance.into(), - )) -} - -pub fn start_xr_session( - window: Option, - ptrs: &OXrSessionSetupInfo, - xr_instance: &XrInstance, - render_device: &RenderDevice, - render_adapter: &RenderAdapter, - wgpu_instance: &Instance, -) -> eyre::Result<( - XrSession, - XrResolution, - XrFormat, - XrSessionRunning, - XrFrameWaiter, - XrSwapchain, - XrInput, - XrViews, - XrFrameState, -)> { - let wgpu_device = render_device.wgpu_device(); - let wgpu_adapter = &render_adapter.0; - - #[allow(unreachable_patterns)] - let setup_info = match ptrs { - OXrSessionSetupInfo::Vulkan(v) => v, - _ => eyre::bail!("Wrong Graphics Api"), - }; - let (session, frame_wait, frame_stream) = unsafe { - xr_instance.create_session::( - xr_instance.system(xr::FormFactor::HEAD_MOUNTED_DISPLAY)?, - &xr::vulkan::SessionCreateInfo { - instance: setup_info.vk_instance_ptr, - physical_device: setup_info.physical_device_ptr, - device: setup_info.device_ptr, - queue_family_index: setup_info.queue_family_index, - queue_index: 0, - }, - ) - }?; - - let views = - xr_instance.enumerate_view_configuration_views(setup_info.xr_system_id, VIEW_TYPE)?; - let surface = window.map(|wrapper| unsafe { - // SAFETY: Plugins should be set up on the main thread. - let handle = wrapper.get_handle(); - wgpu_instance - .create_surface(handle) - .expect("Failed to create wgpu surface") - }); - let swapchain_format = surface - .as_ref() - .map(|surface| surface.get_capabilities(wgpu_adapter).formats[0]) - .unwrap_or(wgpu::TextureFormat::Rgba8UnormSrgb); - - // TODO: Log swapchain format - - let resolution = uvec2( - views[0].recommended_image_rect_width, - views[0].recommended_image_rect_height, - ); - - let handle = session - .create_swapchain(&xr::SwapchainCreateInfo { - create_flags: xr::SwapchainCreateFlags::EMPTY, - usage_flags: xr::SwapchainUsageFlags::COLOR_ATTACHMENT - | xr::SwapchainUsageFlags::SAMPLED, - format: wgpu_to_vulkan(swapchain_format).as_raw() as _, - // The Vulkan graphics pipeline we create is not set up for multisampling, - // so we hardcode this to 1. If we used a proper multisampling setup, we - // could set this to `views[0].recommended_swapchain_sample_count`. - sample_count: 1, - width: resolution.x, - height: resolution.y, - face_count: 1, - array_size: 2, - mip_count: 1, - }) - .unwrap(); - - let images = handle.enumerate_images().unwrap(); - - let buffers = images - .into_iter() - .map(|color_image| { - info!("image map swapchain"); - let color_image = vk::Image::from_raw(color_image); - let wgpu_hal_texture = unsafe { - ::Device::texture_from_raw( - color_image, - &wgpu_hal::TextureDescriptor { - label: Some("bevy_openxr swapchain"), // unused internally - size: wgpu::Extent3d { - width: resolution.x, - height: resolution.y, - depth_or_array_layers: 2, - }, - mip_level_count: 1, - sample_count: 1, - dimension: wgpu::TextureDimension::D2, - format: swapchain_format, - usage: wgpu_hal::TextureUses::COLOR_TARGET - | wgpu_hal::TextureUses::COPY_DST, - memory_flags: wgpu_hal::MemoryFlags::empty(), - view_formats: vec![], - }, - None, - ) - }; - let texture = unsafe { - wgpu_device.create_texture_from_hal::( - wgpu_hal_texture, - &wgpu::TextureDescriptor { - label: Some("bevy_openxr swapchain"), - size: wgpu::Extent3d { - width: resolution.x, - height: resolution.y, - depth_or_array_layers: 2, - }, - mip_level_count: 1, - sample_count: 1, - dimension: wgpu::TextureDimension::D2, - format: swapchain_format, - usage: wgpu::TextureUsages::RENDER_ATTACHMENT - | wgpu::TextureUsages::COPY_DST, - view_formats: &[], - }, - ) - }; - texture - }) - .collect(); - - Ok(( - XrSession::Vulkan(session.clone()), - resolution.into(), - swapchain_format.into(), - // TODO: this shouldn't be in here - AtomicBool::new(false).into(), - frame_wait.into(), - Swapchain::Vulkan(SwapchainInner { - stream: Mutex::new(frame_stream), - handle: Mutex::new(handle), - buffers, - image_index: Mutex::new(0), - }) - .into(), - XrInput::new(xr_instance, &session.into_any_graphics())?, - Vec::default().into(), - // TODO: Feels wrong to return a FrameState here, we probably should just wait for the next frame - xr::FrameState { - predicted_display_time: xr::Time::from_nanos(1), - predicted_display_period: xr::Duration::from_nanos(1), - should_render: true, - } - .into(), - )) -} - -fn wgpu_to_vulkan(format: wgpu::TextureFormat) -> vk::Format { - // Copied with minor modification from: - // https://github.com/gfx-rs/wgpu/blob/v0.19/wgpu-hal/src/vulkan/conv.rs#L5C1-L153 - // license: MIT OR Apache-2.0 - use ash::vk::Format as F; - use wgpu::TextureFormat as Tf; - use wgpu::{AstcBlock, AstcChannel}; - match format { - Tf::R8Unorm => F::R8_UNORM, - Tf::R8Snorm => F::R8_SNORM, - Tf::R8Uint => F::R8_UINT, - Tf::R8Sint => F::R8_SINT, - Tf::R16Uint => F::R16_UINT, - Tf::R16Sint => F::R16_SINT, - Tf::R16Unorm => F::R16_UNORM, - Tf::R16Snorm => F::R16_SNORM, - Tf::R16Float => F::R16_SFLOAT, - Tf::Rg8Unorm => F::R8G8_UNORM, - Tf::Rg8Snorm => F::R8G8_SNORM, - Tf::Rg8Uint => F::R8G8_UINT, - Tf::Rg8Sint => F::R8G8_SINT, - Tf::Rg16Unorm => F::R16G16_UNORM, - Tf::Rg16Snorm => F::R16G16_SNORM, - Tf::R32Uint => F::R32_UINT, - Tf::R32Sint => F::R32_SINT, - Tf::R32Float => F::R32_SFLOAT, - Tf::Rg16Uint => F::R16G16_UINT, - Tf::Rg16Sint => F::R16G16_SINT, - Tf::Rg16Float => F::R16G16_SFLOAT, - Tf::Rgba8Unorm => F::R8G8B8A8_UNORM, - Tf::Rgba8UnormSrgb => F::R8G8B8A8_SRGB, - Tf::Bgra8UnormSrgb => F::B8G8R8A8_SRGB, - Tf::Rgba8Snorm => F::R8G8B8A8_SNORM, - Tf::Bgra8Unorm => F::B8G8R8A8_UNORM, - Tf::Rgba8Uint => F::R8G8B8A8_UINT, - Tf::Rgba8Sint => F::R8G8B8A8_SINT, - Tf::Rgb10a2Uint => F::A2B10G10R10_UINT_PACK32, - Tf::Rgb10a2Unorm => F::A2B10G10R10_UNORM_PACK32, - Tf::Rg11b10Float => F::B10G11R11_UFLOAT_PACK32, - Tf::Rg32Uint => F::R32G32_UINT, - Tf::Rg32Sint => F::R32G32_SINT, - Tf::Rg32Float => F::R32G32_SFLOAT, - Tf::Rgba16Uint => F::R16G16B16A16_UINT, - Tf::Rgba16Sint => F::R16G16B16A16_SINT, - Tf::Rgba16Unorm => F::R16G16B16A16_UNORM, - Tf::Rgba16Snorm => F::R16G16B16A16_SNORM, - Tf::Rgba16Float => F::R16G16B16A16_SFLOAT, - Tf::Rgba32Uint => F::R32G32B32A32_UINT, - Tf::Rgba32Sint => F::R32G32B32A32_SINT, - Tf::Rgba32Float => F::R32G32B32A32_SFLOAT, - Tf::Depth32Float => F::D32_SFLOAT, - Tf::Depth32FloatStencil8 => F::D32_SFLOAT_S8_UINT, - Tf::Depth24Plus | Tf::Depth24PlusStencil8 | Tf::Stencil8 => { - panic!("Cannot convert format that is dependent on device properties") - } - Tf::Depth16Unorm => F::D16_UNORM, - Tf::NV12 => F::G8_B8R8_2PLANE_420_UNORM, - Tf::Rgb9e5Ufloat => F::E5B9G9R9_UFLOAT_PACK32, - Tf::Bc1RgbaUnorm => F::BC1_RGBA_UNORM_BLOCK, - Tf::Bc1RgbaUnormSrgb => F::BC1_RGBA_SRGB_BLOCK, - Tf::Bc2RgbaUnorm => F::BC2_UNORM_BLOCK, - Tf::Bc2RgbaUnormSrgb => F::BC2_SRGB_BLOCK, - Tf::Bc3RgbaUnorm => F::BC3_UNORM_BLOCK, - Tf::Bc3RgbaUnormSrgb => F::BC3_SRGB_BLOCK, - Tf::Bc4RUnorm => F::BC4_UNORM_BLOCK, - Tf::Bc4RSnorm => F::BC4_SNORM_BLOCK, - Tf::Bc5RgUnorm => F::BC5_UNORM_BLOCK, - Tf::Bc5RgSnorm => F::BC5_SNORM_BLOCK, - Tf::Bc6hRgbUfloat => F::BC6H_UFLOAT_BLOCK, - Tf::Bc6hRgbFloat => F::BC6H_SFLOAT_BLOCK, - Tf::Bc7RgbaUnorm => F::BC7_UNORM_BLOCK, - Tf::Bc7RgbaUnormSrgb => F::BC7_SRGB_BLOCK, - Tf::Etc2Rgb8Unorm => F::ETC2_R8G8B8_UNORM_BLOCK, - Tf::Etc2Rgb8UnormSrgb => F::ETC2_R8G8B8_SRGB_BLOCK, - Tf::Etc2Rgb8A1Unorm => F::ETC2_R8G8B8A1_UNORM_BLOCK, - Tf::Etc2Rgb8A1UnormSrgb => F::ETC2_R8G8B8A1_SRGB_BLOCK, - Tf::Etc2Rgba8Unorm => F::ETC2_R8G8B8A8_UNORM_BLOCK, - Tf::Etc2Rgba8UnormSrgb => F::ETC2_R8G8B8A8_SRGB_BLOCK, - Tf::EacR11Unorm => F::EAC_R11_UNORM_BLOCK, - Tf::EacR11Snorm => F::EAC_R11_SNORM_BLOCK, - Tf::EacRg11Unorm => F::EAC_R11G11_UNORM_BLOCK, - Tf::EacRg11Snorm => F::EAC_R11G11_SNORM_BLOCK, - Tf::Astc { block, channel } => match channel { - AstcChannel::Unorm => match block { - AstcBlock::B4x4 => F::ASTC_4X4_UNORM_BLOCK, - AstcBlock::B5x4 => F::ASTC_5X4_UNORM_BLOCK, - AstcBlock::B5x5 => F::ASTC_5X5_UNORM_BLOCK, - AstcBlock::B6x5 => F::ASTC_6X5_UNORM_BLOCK, - AstcBlock::B6x6 => F::ASTC_6X6_UNORM_BLOCK, - AstcBlock::B8x5 => F::ASTC_8X5_UNORM_BLOCK, - AstcBlock::B8x6 => F::ASTC_8X6_UNORM_BLOCK, - AstcBlock::B8x8 => F::ASTC_8X8_UNORM_BLOCK, - AstcBlock::B10x5 => F::ASTC_10X5_UNORM_BLOCK, - AstcBlock::B10x6 => F::ASTC_10X6_UNORM_BLOCK, - AstcBlock::B10x8 => F::ASTC_10X8_UNORM_BLOCK, - AstcBlock::B10x10 => F::ASTC_10X10_UNORM_BLOCK, - AstcBlock::B12x10 => F::ASTC_12X10_UNORM_BLOCK, - AstcBlock::B12x12 => F::ASTC_12X12_UNORM_BLOCK, - }, - AstcChannel::UnormSrgb => match block { - AstcBlock::B4x4 => F::ASTC_4X4_SRGB_BLOCK, - AstcBlock::B5x4 => F::ASTC_5X4_SRGB_BLOCK, - AstcBlock::B5x5 => F::ASTC_5X5_SRGB_BLOCK, - AstcBlock::B6x5 => F::ASTC_6X5_SRGB_BLOCK, - AstcBlock::B6x6 => F::ASTC_6X6_SRGB_BLOCK, - AstcBlock::B8x5 => F::ASTC_8X5_SRGB_BLOCK, - AstcBlock::B8x6 => F::ASTC_8X6_SRGB_BLOCK, - AstcBlock::B8x8 => F::ASTC_8X8_SRGB_BLOCK, - AstcBlock::B10x5 => F::ASTC_10X5_SRGB_BLOCK, - AstcBlock::B10x6 => F::ASTC_10X6_SRGB_BLOCK, - AstcBlock::B10x8 => F::ASTC_10X8_SRGB_BLOCK, - AstcBlock::B10x10 => F::ASTC_10X10_SRGB_BLOCK, - AstcBlock::B12x10 => F::ASTC_12X10_SRGB_BLOCK, - AstcBlock::B12x12 => F::ASTC_12X12_SRGB_BLOCK, - }, - AstcChannel::Hdr => match block { - AstcBlock::B4x4 => F::ASTC_4X4_SFLOAT_BLOCK_EXT, - AstcBlock::B5x4 => F::ASTC_5X4_SFLOAT_BLOCK_EXT, - AstcBlock::B5x5 => F::ASTC_5X5_SFLOAT_BLOCK_EXT, - AstcBlock::B6x5 => F::ASTC_6X5_SFLOAT_BLOCK_EXT, - AstcBlock::B6x6 => F::ASTC_6X6_SFLOAT_BLOCK_EXT, - AstcBlock::B8x5 => F::ASTC_8X5_SFLOAT_BLOCK_EXT, - AstcBlock::B8x6 => F::ASTC_8X6_SFLOAT_BLOCK_EXT, - AstcBlock::B8x8 => F::ASTC_8X8_SFLOAT_BLOCK_EXT, - AstcBlock::B10x5 => F::ASTC_10X5_SFLOAT_BLOCK_EXT, - AstcBlock::B10x6 => F::ASTC_10X6_SFLOAT_BLOCK_EXT, - AstcBlock::B10x8 => F::ASTC_10X8_SFLOAT_BLOCK_EXT, - AstcBlock::B10x10 => F::ASTC_10X10_SFLOAT_BLOCK_EXT, - AstcBlock::B12x10 => F::ASTC_12X10_SFLOAT_BLOCK_EXT, - AstcBlock::B12x12 => F::ASTC_12X12_SFLOAT_BLOCK_EXT, - }, - }, - } -} diff --git a/src/input.rs b/src/input.rs deleted file mode 100644 index 8a98a7e..0000000 --- a/src/input.rs +++ /dev/null @@ -1,86 +0,0 @@ -use std::sync::Arc; - -use bevy::{prelude::*, render::extract_resource::ExtractResource}; -use openxr as xr; -use xr::{FrameState, FrameWaiter, ViewConfigurationType}; - -#[derive(Clone, Resource, ExtractResource)] -pub struct XrInput { - //pub action_set: xr::ActionSet, - //pub hand_pose: xr::Action, - //pub right_space: Arc, - //pub left_space: Arc, - pub stage: Arc, - pub head: Arc, -} - -impl XrInput { - pub fn new( - instance: &xr::Instance, - session: &xr::Session, - // frame_state: &FrameState, - ) -> xr::Result { - // let right_hand_subaction_path = instance.string_to_path("/user/hand/right").unwrap(); - // let right_hand_grip_pose_path = instance - // .string_to_path("/user/hand/right/input/grip/pose") - // .unwrap(); - // let hand_pose = action_set.create_action::( - // "hand_pose", - // "Hand Pose", - // &[left_hand_subaction_path, right_hand_subaction_path], - // )?; - // /* let left_action = - // action_set.create_action::("left_hand", "Left Hand Controller", &[])?;*/ - // instance.suggest_interaction_profile_bindings( - // instance.string_to_path("/interaction_profiles/khr/simple_controller")?, - // &[ - // xr::Binding::new(&hand_pose, right_hand_grip_pose_path), - // xr::Binding::new(&hand_pose, left_hand_grip_pose_path), - // ], - // )?; - // - // let right_space = hand_pose.create_space( - // session.clone(), - // right_hand_subaction_path, - // xr::Posef::IDENTITY, - // )?; - // let left_space = hand_pose.create_space( - // session.clone(), - // left_hand_subaction_path, - // xr::Posef::IDENTITY, - // )?; - - let stage = match instance.exts().ext_local_floor { - None => session - .create_reference_space(xr::ReferenceSpaceType::STAGE, xr::Posef::IDENTITY)?, - Some(_) => session.create_reference_space( - xr::ReferenceSpaceType::LOCAL_FLOOR_EXT, - xr::Posef::IDENTITY, - )?, - }; - let head = - session.create_reference_space(xr::ReferenceSpaceType::VIEW, xr::Posef::IDENTITY)?; - // let y = stage - // .locate(&head, frame_state.predicted_display_time).unwrap() - // .pose - // .position - // .y; - // let local = session.create_reference_space( - // xr::ReferenceSpaceType::LOCAL, - // xr::Posef { - // position: xr::Vector3f { x: 0.0, y, z: 0.0 }, - // orientation: xr::Quaternionf::IDENTITY, - // }, - // ).unwrap(); - //session.attach_action_sets(&[&action_set])?; - //session.attach_action_sets(&[])?; - Ok(Self { - //action_set, - //hand_pose, - // right_space: Arc::new(right_space), - // left_space: Arc::new(left_space), - stage: Arc::new(stage), - head: Arc::new(head), - }) - } -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 47f922f..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,541 +0,0 @@ -pub mod graphics; -pub mod input; -pub mod passthrough; -pub mod prelude; -pub mod resource_macros; -pub mod resources; -pub mod xr_init; -pub mod xr_input; - -use std::sync::atomic::AtomicBool; -use std::sync::Arc; - -use crate::xr_init::{StartXrSession, XrInitPlugin}; -use crate::xr_input::oculus_touch::ActionSets; -use crate::xr_input::trackers::verify_quat; -use bevy::app::{AppExit, PluginGroupBuilder}; -use bevy::core::TaskPoolThreadAssignmentPolicy; -use bevy::ecs::system::SystemState; -use bevy::prelude::*; -use bevy::render::camera::{ManualTextureView, ManualTextureViewHandle, ManualTextureViews}; -use bevy::render::pipelined_rendering::PipelinedRenderingPlugin; -use bevy::render::renderer::{render_system, RenderInstance, WgpuWrapper}; -use bevy::render::settings::RenderCreation; -use bevy::render::{Render, RenderApp, RenderPlugin, RenderSet}; -use bevy::window::{PresentMode, PrimaryWindow, RawHandleWrapper}; -use graphics::extensions::XrExtensions; -use graphics::{XrAppInfo, XrPreferdBlendMode}; -use input::XrInput; -use openxr as xr; -use passthrough::{PassthroughPlugin, XrPassthroughLayer, XrPassthroughState}; -use resources::*; -use xr_init::{ - xr_after_wait_only, xr_only, xr_render_only, CleanupRenderWorld, CleanupXrData, - ExitAppOnSessionExit, SetupXrData, StartSessionOnStartup, XrCleanup, XrEarlyInitPlugin, - XrHasWaited, XrPostCleanup, XrShouldRender, XrStatus, -}; -use xr_input::actions::XrActionsPlugin; -use xr_input::hands::emulated::HandEmulationPlugin; -use xr_input::hands::hand_tracking::HandTrackingPlugin; -use xr_input::hands::HandPlugin; -use xr_input::xr_camera::XrCameraPlugin; -use xr_input::XrInputPlugin; - -const VIEW_TYPE: xr::ViewConfigurationType = xr::ViewConfigurationType::PRIMARY_STEREO; - -pub const LEFT_XR_TEXTURE_HANDLE: ManualTextureViewHandle = ManualTextureViewHandle(1208214591); -pub const RIGHT_XR_TEXTURE_HANDLE: ManualTextureViewHandle = ManualTextureViewHandle(3383858418); - -/// Adds OpenXR support to an App -pub struct OpenXrPlugin { - pub backend_preference: Vec, - pub reqeusted_extensions: XrExtensions, - pub prefered_blend_mode: XrPreferdBlendMode, - pub app_info: XrAppInfo, - pub synchronous_pipeline_compilation: bool, -} - -impl Plugin for OpenXrPlugin { - fn build(&self, app: &mut App) { - app.insert_resource(XrSessionRunning::new(AtomicBool::new(false))); - app.insert_resource(ExitAppOnSessionExit::default()); - #[cfg(not(target_arch = "wasm32"))] - match graphics::initialize_xr_instance( - &self.backend_preference, - SystemState::>>::new(app.world_mut()) - .get(&app.world()) - .get_single() - .ok() - .cloned(), - self.reqeusted_extensions.clone(), - self.prefered_blend_mode, - self.app_info.clone(), - ) { - Ok(( - xr_instance, - oxr_session_setup_info, - blend_mode, - device, - queue, - adapter_info, - render_adapter, - instance, - )) => { - debug!("Configured wgpu adapter Limits: {:#?}", device.limits()); - debug!("Configured wgpu adapter Features: {:#?}", device.features()); - warn!("Starting with OpenXR Instance"); - app.insert_resource(xr_instance.clone()); - app.insert_resource(blend_mode); - app.insert_resource(ActionSets(vec![])); - app.insert_resource(xr_instance); - app.insert_resource(blend_mode); - app.insert_non_send_resource(oxr_session_setup_info); - let render_instance = RenderInstance(Arc::new(WgpuWrapper::new(instance))); - app.insert_resource(render_instance.clone()); - app.add_plugins(RenderPlugin { - render_creation: RenderCreation::Manual( - device, - queue, - adapter_info, - render_adapter, - render_instance, - ), - // Expose this? if yes we also have to set this in the non xr case - synchronous_pipeline_compilation: self.synchronous_pipeline_compilation, - }); - app.insert_resource(XrStatus::Disabled); - // app.world.send_event(StartXrSession); - } - Err(err) => { - warn!("OpenXR Instance Failed to initialize: {}", err); - app.add_plugins(RenderPlugin { - synchronous_pipeline_compilation: self.synchronous_pipeline_compilation, - ..Default::default() - }); - app.insert_resource(XrStatus::NoInstance); - } - } - #[cfg(target_arch = "wasm32")] - { - app.add_plugins(RenderPlugin::default()); - app.insert_resource(XrStatus::Disabled); - } - app.add_systems(XrPostCleanup, clean_resources); - app.add_systems(XrPostCleanup, || info!("Main World Post Cleanup!")); - app.add_systems( - PreUpdate, - xr_poll_events.run_if(|status: Res| *status != XrStatus::NoInstance), - ); - app.add_systems( - PreUpdate, - ( - xr_reset_per_frame_resources, - xr_wait_frame.run_if(xr_only()), - locate_views.run_if(xr_only()), - apply_deferred, - ) - .chain() - .after(xr_poll_events), - ); - let render_app = app.sub_app_mut(RenderApp); - render_app.add_systems( - Render, - xr_pre_frame - .run_if(xr_only()) - .run_if(xr_after_wait_only()) - .run_if(xr_render_only()) - .before(render_system) - .after(RenderSet::ExtractCommands), - ); - render_app.add_systems( - Render, - xr_end_frame - .run_if(xr_only()) - .run_if(xr_after_wait_only()) - .run_if(xr_render_only()) - .in_set(RenderSet::Cleanup), - ); - render_app.add_systems( - Render, - xr_skip_frame - .run_if(xr_only()) - .run_if(xr_after_wait_only()) - .run_if(not(xr_render_only())) - .in_set(RenderSet::Cleanup), - ); - render_app.add_systems( - Render, - clean_resources_render - .run_if(resource_exists::) - .after(RenderSet::ExtractCommands), - ); - } -} - -#[cfg(all(not(feature = "vulkan"), not(all(feature = "d3d12", windows))))] -compile_error!("At least one platform-compatible backend feature must be enabled."); - -#[derive(Debug)] -pub enum Backend { - #[cfg(feature = "vulkan")] - Vulkan, - #[cfg(all(feature = "d3d12", windows))] - D3D12, -} - -fn clean_resources_render(cmds: &mut World) { - // let session = cmds.remove_resource::().unwrap(); - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - // cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - // unsafe { - // (session.instance().fp().destroy_session)(session.as_raw()); - // } - warn!("Cleanup Resources Render"); -} -fn clean_resources(cmds: &mut World) { - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - // cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - cmds.remove_resource::(); - // cmds.remove_resource::(); - // unsafe { - // (session.instance().fp().destroy_session)(session.as_raw()); - // } - warn!("Cleanup Resources"); -} - -fn xr_skip_frame( - xr_swapchain: Res, - xr_frame_state: Res, - environment_blend_mode: Res, -) { - let swapchain: &Swapchain = &xr_swapchain; - match swapchain { - #[cfg(feature = "vulkan")] - Swapchain::Vulkan(swap) => &swap - .stream - .lock() - .unwrap() - .end( - xr_frame_state.predicted_display_time, - **environment_blend_mode, - &[], - ) - .unwrap(), - #[cfg(all(feature = "d3d12", windows))] - Swapchain::D3D12(swap) => &swap - .stream - .lock() - .unwrap() - .end( - xr_frame_state.predicted_display_time, - **environment_blend_mode, - &[], - ) - .unwrap(), - }; -} - -pub struct DefaultXrPlugins { - pub backend_preference: Vec, - pub reqeusted_extensions: XrExtensions, - pub prefered_blend_mode: XrPreferdBlendMode, - pub app_info: XrAppInfo, - pub synchronous_pipeline_compilation: bool, -} -impl Default for DefaultXrPlugins { - fn default() -> Self { - Self { - backend_preference: vec![ - #[cfg(feature = "vulkan")] - Backend::Vulkan, - #[cfg(all(feature = "d3d12", windows))] - Backend::D3D12, - ], - reqeusted_extensions: default(), - prefered_blend_mode: default(), - app_info: default(), - synchronous_pipeline_compilation: false, - } - } -} - -impl PluginGroup for DefaultXrPlugins { - fn build(self) -> PluginGroupBuilder { - DefaultPlugins - .build() - .set(TaskPoolPlugin { - task_pool_options: TaskPoolOptions { - compute: TaskPoolThreadAssignmentPolicy { - min_threads: 2, - max_threads: std::usize::MAX, // unlimited max threads - percent: 1.0, // this value is irrelevant in this case - }, - // keep the defaults for everything else - ..default() - }, - }) - .disable::() - .disable::() - .add_before::(OpenXrPlugin { - backend_preference: self.backend_preference, - prefered_blend_mode: self.prefered_blend_mode, - reqeusted_extensions: self.reqeusted_extensions, - app_info: self.app_info.clone(), - synchronous_pipeline_compilation: self.synchronous_pipeline_compilation, - }) - .add_after::(XrInitPlugin) - .add(XrInputPlugin) - .add(XrActionsPlugin) - .add(XrCameraPlugin) - .add_before::(XrEarlyInitPlugin) - .add(HandPlugin) - .add(HandTrackingPlugin) - .add(HandEmulationPlugin) - .add(PassthroughPlugin) - .add(XrResourcePlugin) - .add(StartSessionOnStartup) - .set(WindowPlugin { - #[cfg(not(target_os = "android"))] - primary_window: Some(Window { - transparent: true, - present_mode: PresentMode::AutoNoVsync, - title: self.app_info.name.clone(), - ..default() - }), - #[cfg(target_os = "android")] - primary_window: Some(Window { - present_mode: PresentMode::AutoNoVsync, - ..default() - }), - #[cfg(target_os = "android")] - exit_condition: bevy::window::ExitCondition::DontExit, - #[cfg(target_os = "android")] - close_when_requested: true, - ..default() - }) - } -} - -fn xr_reset_per_frame_resources( - mut should: ResMut, - mut waited: ResMut, -) { - **should = false; - **waited = false; -} - -fn xr_poll_events( - instance: Option>, - session: Option>, - session_running: Res, - exit_type: Res, - mut app_exit: EventWriter, - mut start_session: EventWriter, - mut setup_xr: EventWriter, - mut cleanup_xr: EventWriter, -) { - if let (Some(instance), Some(session)) = (instance, session) { - let _span = info_span!("xr_poll_events"); - while let Some(event) = instance.poll_event(&mut Default::default()).unwrap() { - use xr::Event::*; - match event { - SessionStateChanged(e) => { - // Session state change is where we can begin and end sessions, as well as - // find quit messages! - info!("entered XR state {:?}", e.state()); - match e.state() { - xr::SessionState::READY => { - info!("Calling Session begin :3"); - session.begin(VIEW_TYPE).unwrap(); - setup_xr.send_default(); - session_running.store(true, std::sync::atomic::Ordering::Relaxed); - } - xr::SessionState::STOPPING => { - session.end().unwrap(); - session_running.store(false, std::sync::atomic::Ordering::Relaxed); - cleanup_xr.send_default(); - } - xr::SessionState::EXITING => { - if *exit_type == ExitAppOnSessionExit::Always - || *exit_type == ExitAppOnSessionExit::OnlyOnExit - { - app_exit.send_default(); - } - } - xr::SessionState::LOSS_PENDING => { - if *exit_type == ExitAppOnSessionExit::Always { - app_exit.send_default(); - } - if *exit_type == ExitAppOnSessionExit::OnlyOnExit { - start_session.send_default(); - } - } - - _ => {} - } - } - InstanceLossPending(_) => { - app_exit.send_default(); - } - EventsLost(e) => { - warn!("lost {} XR events", e.lost_event_count()); - } - _ => {} - } - } - } -} - -pub fn xr_wait_frame( - world: &mut World, - // mut frame_state: ResMut, - // mut frame_waiter: ResMut, - // mut should_render: ResMut, - // mut waited: ResMut, -) { - let mut frame_waiter = world.get_resource_mut::().unwrap(); - { - let _span = info_span!("xr_wait_frame").entered(); - - *world.get_resource_mut::().unwrap() = match frame_waiter.wait() { - Ok(a) => a.into(), - Err(e) => { - warn!("error: {}", e); - return; - } - }; - let should_render = world.get_resource::().unwrap().should_render; - **world.get_resource_mut::().unwrap() = should_render; - **world.get_resource_mut::().unwrap() = true; - } - world - .get_resource::() - .unwrap() - .begin() - .unwrap(); -} - -pub fn xr_pre_frame( - resolution: Res, - format: Res, - swapchain: Res, - mut manual_texture_views: ResMut, -) { - { - let _span = info_span!("xr_acquire_image").entered(); - swapchain.acquire_image().unwrap() - } - { - let _span = info_span!("xr_wait_image").entered(); - swapchain.wait_image().unwrap(); - } - { - let _span = info_span!("xr_update_manual_texture_views").entered(); - let (left, right) = swapchain.get_render_views(); - let left = ManualTextureView { - texture_view: left.into(), - size: **resolution, - format: **format, - }; - let right = ManualTextureView { - texture_view: right.into(), - size: **resolution, - format: **format, - }; - manual_texture_views.insert(LEFT_XR_TEXTURE_HANDLE, left); - manual_texture_views.insert(RIGHT_XR_TEXTURE_HANDLE, right); - } -} - -#[allow(clippy::too_many_arguments)] -pub fn xr_end_frame( - xr_frame_state: Res, - views: Res, - input: Res, - swapchain: Res, - resolution: Res, - environment_blend_mode: Res, - passthrough_layer: Option>, - passthrough_state: Option>, -) { - #[cfg(target_os = "android")] - { - let ctx = ndk_context::android_context(); - let vm = unsafe { jni::JavaVM::from_raw(ctx.vm().cast()) }.unwrap(); - let env = vm.attach_current_thread_as_daemon(); - } - - { - let _span = info_span!("xr_release_image").entered(); - swapchain.release_image().unwrap(); - } - { - let _span = info_span!("xr_end_frame").entered(); - let pass_layer = match passthrough_state.as_deref() { - Some(XrPassthroughState::Running) => passthrough_layer.as_deref(), - _ => None, - }; - let result = swapchain.end( - xr_frame_state.predicted_display_time, - &views, - &input.stage, - **resolution, - **environment_blend_mode, - pass_layer, - ); - match result { - Ok(_) => {} - Err(e) => warn!("error: {}", e), - } - } -} - -pub fn locate_views( - mut views: ResMut, - input: Res, - session: Res, - xr_frame_state: Res, -) { - let _span = info_span!("xr_locate_views").entered(); - **views = match session.locate_views( - VIEW_TYPE, - xr_frame_state.predicted_display_time, - &input.stage, - ) { - Ok(this) => this - .1 - .into_iter() - .map(|mut view| { - use crate::prelude::*; - let quat = view.pose.orientation.to_quat(); - let fixed_quat = verify_quat(quat); - let oxr_quat = xr::Quaternionf { - x: fixed_quat.x, - y: fixed_quat.y, - z: fixed_quat.z, - w: fixed_quat.w, - }; - view.pose.orientation = oxr_quat; - view - }) - .collect(), - Err(err) => { - warn!("error: {}", err); - return; - } - } -} diff --git a/src/passthrough.rs b/src/passthrough.rs deleted file mode 100644 index 22502b5..0000000 --- a/src/passthrough.rs +++ /dev/null @@ -1,229 +0,0 @@ -use bevy::color::palettes; -use bevy::render::extract_resource::ExtractResource; -use bevy::{prelude::*, render::extract_resource::ExtractResourcePlugin}; -use std::{marker::PhantomData, mem, ptr}; - -use crate::resources::XrSession; -use crate::{ - resources::XrInstance, - xr_arc_resource_wrapper, - xr_init::{XrCleanup, XrSetup}, -}; -use openxr as xr; -use xr::{ - sys::{Space, SystemPassthroughProperties2FB}, - CompositionLayerBase, CompositionLayerFlags, FormFactor, Graphics, - PassthroughCapabilityFlagsFB, -}; - -#[derive( - Clone, Copy, Default, Debug, Resource, PartialEq, PartialOrd, Ord, Eq, Reflect, ExtractResource, -)] -pub enum XrPassthroughState { - #[default] - Unsupported, - Running, - Paused, -} - -xr_arc_resource_wrapper!(XrPassthrough, xr::Passthrough); -xr_arc_resource_wrapper!(XrPassthroughLayer, xr::PassthroughLayer); - -pub struct PassthroughPlugin; - -impl Plugin for PassthroughPlugin { - fn build(&self, app: &mut App) { - app.add_event::(); - app.add_event::(); - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.register_type::(); - app.add_systems(Startup, check_passthrough_support); - app.add_systems( - XrSetup, - setup_passthrough - .run_if(|state: Res| *state != XrPassthroughState::Unsupported), - ); - app.add_systems(XrCleanup, cleanup_passthrough); - app.add_systems( - Update, - resume_passthrough.run_if( - resource_exists_and_equals(XrPassthroughState::Paused) - .and_then(on_event::()), - ), - ); - app.add_systems( - Update, - pause_passthrough.run_if( - resource_exists_and_equals(XrPassthroughState::Running) - .and_then(on_event::()), - ), - ); - } -} - -fn check_passthrough_support(mut cmds: Commands, instance: Option>) { - match instance { - None => cmds.insert_resource(XrPassthroughState::Unsupported), - Some(instance) => { - let supported = instance.exts().fb_passthrough.is_some() - && supports_passthrough( - &instance, - instance.system(FormFactor::HEAD_MOUNTED_DISPLAY).unwrap(), - ) - .is_ok_and(|v| v); - match supported { - false => cmds.insert_resource(XrPassthroughState::Unsupported), - true => cmds.insert_resource(XrPassthroughState::Paused), - } - } - } -} - -fn resume_passthrough( - layer: Res, - mut state: ResMut, - mut clear_color: ResMut, -) { - if let Err(e) = layer.resume() { - warn!("Unable to resume Passthrough: {}", e); - return; - } - **clear_color = Srgba::NONE.into(); - *state = XrPassthroughState::Running; -} -fn pause_passthrough( - layer: Res, - mut state: ResMut, - mut clear_color: ResMut, -) { - if let Err(e) = layer.pause() { - warn!("Unable to resume Passthrough: {}", e); - return; - } - clear_color.set_alpha(1.0); - *state = XrPassthroughState::Paused; -} - -fn cleanup_passthrough(mut cmds: Commands) { - cmds.remove_resource::(); - cmds.remove_resource::(); -} - -fn setup_passthrough(mut cmds: Commands, session: Res) { - match create_passthrough(&session) { - Ok((passthrough, layer)) => { - cmds.insert_resource(XrPassthrough::from(passthrough)); - cmds.insert_resource(XrPassthroughLayer::from(layer)); - } - Err(e) => { - warn!("Unable to create passthrough: {}", e); - } - } -} - -#[derive(Clone, Copy, Debug, Default, Reflect, Event)] -pub struct ResumePassthrough; - -#[derive(Clone, Copy, Debug, Default, Reflect, Event)] -pub struct PausePassthrough; - -fn cvt(x: xr::sys::Result) -> xr::Result { - if x.into_raw() >= 0 { - Ok(x) - } else { - Err(x) - } -} - -#[derive(Copy, Clone)] -#[repr(transparent)] -pub(crate) struct CompositionLayerPassthrough<'a, G: xr::Graphics> { - inner: xr::sys::CompositionLayerPassthroughFB, - _marker: PhantomData<&'a G>, -} -impl<'a, G: Graphics> std::ops::Deref for CompositionLayerPassthrough<'a, G> { - type Target = CompositionLayerBase<'a, G>; - #[inline] - fn deref(&self) -> &Self::Target { - unsafe { mem::transmute(&self.inner) } - } -} - -impl<'a, G: xr::Graphics> CompositionLayerPassthrough<'a, G> { - pub(crate) fn from_xr_passthrough_layer(layer: &XrPassthroughLayer) -> Self { - Self { - inner: xr::sys::CompositionLayerPassthroughFB { - ty: xr::sys::CompositionLayerPassthroughFB::TYPE, - next: ptr::null(), - flags: CompositionLayerFlags::BLEND_TEXTURE_SOURCE_ALPHA, - space: Space::NULL, - layer_handle: *layer.inner(), - }, - _marker: PhantomData, - } - } -} -#[inline] -pub fn supports_passthrough(instance: &XrInstance, system: xr::SystemId) -> xr::Result { - unsafe { - let mut hand = xr::sys::SystemPassthroughProperties2FB { - ty: SystemPassthroughProperties2FB::TYPE, - next: ptr::null(), - capabilities: PassthroughCapabilityFlagsFB::PASSTHROUGH_CAPABILITY, - }; - let mut p = xr::sys::SystemProperties::out(&mut hand as *mut _ as _); - cvt((instance.fp().get_system_properties)( - instance.as_raw(), - system, - p.as_mut_ptr(), - ))?; - bevy::log::info!( - "From supports_passthrough: Passthrough capabilities: {:?}", - hand.capabilities - ); - Ok( - (hand.capabilities & PassthroughCapabilityFlagsFB::PASSTHROUGH_CAPABILITY) - == PassthroughCapabilityFlagsFB::PASSTHROUGH_CAPABILITY, - ) - } -} - -#[inline] -pub fn create_passthrough( - xr_session: &XrSession, -) -> xr::Result<(xr::Passthrough, xr::PassthroughLayer)> { - let flags = xr::PassthroughFlagsFB::IS_RUNNING_AT_CREATION; - let purpose = xr::PassthroughLayerPurposeFB::RECONSTRUCTION; - let passthrough = match xr_session { - #[cfg(feature = "vulkan")] - XrSession::Vulkan(session) => { - session.create_passthrough(xr::PassthroughFlagsFB::IS_RUNNING_AT_CREATION) - } - #[cfg(all(feature = "d3d12", windows))] - XrSession::D3D12(session) => { - session.create_passthrough(xr::PassthroughFlagsFB::IS_RUNNING_AT_CREATION) - } - }?; - let passthrough_layer = match xr_session { - #[cfg(feature = "vulkan")] - XrSession::Vulkan(session) => { - session.create_passthrough_layer(&passthrough, flags, purpose) - } - #[cfg(all(feature = "d3d12", windows))] - XrSession::D3D12(session) => session.create_passthrough_layer(&passthrough, flags, purpose), - }?; - Ok((passthrough, passthrough_layer)) -} - -/// Enable Passthrough on xr startup -/// just sends the [`ResumePassthrough`] event in [`XrSetup`] -pub struct EnablePassthroughStartup; - -impl Plugin for EnablePassthroughStartup { - fn build(&self, app: &mut App) { - app.add_systems(XrSetup, |mut e: EventWriter| { - e.send_default(); - }); - } -} diff --git a/src/prelude.rs b/src/prelude.rs deleted file mode 100644 index 33b86d8..0000000 --- a/src/prelude.rs +++ /dev/null @@ -1,15 +0,0 @@ -use bevy::ecs::schedule::{IntoSystemConfigs, SystemConfigs}; - -pub use crate::xr_init::schedules::XrSetup; -use crate::xr_init::xr_only; -pub use crate::xr_input::{QuatConv, Vec2Conv, Vec3Conv}; - -pub trait XrSystems { - fn xr_only(self) -> SystemConfigs; -} - -impl, M> XrSystems for T { - fn xr_only(self) -> SystemConfigs { - self.into_configs().run_if(xr_only()) - } -} diff --git a/src/resource_macros.rs b/src/resource_macros.rs deleted file mode 100644 index 11ffd20..0000000 --- a/src/resource_macros.rs +++ /dev/null @@ -1,133 +0,0 @@ -#[macro_export] -macro_rules! xr_resource_wrapper { - ($wrapper_type:ident, $xr_type:ty) => { - #[derive( - Clone, - bevy::prelude::Resource, - bevy::prelude::Deref, - bevy::prelude::DerefMut, - bevy::render::extract_resource::ExtractResource, - )] - pub struct $wrapper_type($xr_type); - - impl $wrapper_type { - pub fn new(value: $xr_type) -> Self { - Self(value) - } - } - - // impl std::ops::Deref for $wrapper_type { - // type Target = $xr_type; - // - // fn deref(&self) -> &Self::Target { - // &self.0 - // } - // } - - impl From<$xr_type> for $wrapper_type { - fn from(value: $xr_type) -> Self { - Self::new(value) - } - } - }; -} - -#[macro_export] -macro_rules! xr_resource_wrapper_copy { - ($wrapper_type:ident, $xr_type:ty) => { - #[derive( - Clone, - Copy, - bevy::prelude::Resource, - bevy::prelude::Deref, - bevy::prelude::DerefMut, - bevy::render::extract_resource::ExtractResource, - )] - pub struct $wrapper_type($xr_type); - - impl $wrapper_type { - pub fn new(value: $xr_type) -> Self { - Self(value) - } - } - - // impl std::ops::Deref for $wrapper_type { - // type Target = $xr_type; - // - // fn deref(&self) -> &Self::Target { - // &self.0 - // } - // } - - impl From<$xr_type> for $wrapper_type { - fn from(value: $xr_type) -> Self { - Self::new(value) - } - } - }; -} -#[macro_export] -macro_rules! xr_arc_resource_wrapper { - ($wrapper_type:ident, $xr_type:ty) => { - #[derive( - Clone, - bevy::prelude::Resource, - bevy::prelude::Deref, - bevy::prelude::DerefMut, - bevy::render::extract_resource::ExtractResource, - )] - pub struct $wrapper_type(std::sync::Arc<$xr_type>); - - impl $wrapper_type { - pub fn new(value: $xr_type) -> Self { - Self(std::sync::Arc::new(value)) - } - } - - // impl std::ops::Deref for $wrapper_type { - // type Target = $xr_type; - // - // fn deref(&self) -> &Self::Target { - // self.0.as_ref() - // } - // } - - impl From<$xr_type> for $wrapper_type { - fn from(value: $xr_type) -> Self { - Self::new(value) - } - } - }; -} - -#[macro_export] -macro_rules! xr_no_clone_resource_wrapper { - ($wrapper_type:ident, $xr_type:ty) => { - #[derive(bevy::prelude::Resource, bevy::prelude::Deref, bevy::prelude::DerefMut)] - pub struct $wrapper_type($xr_type); - - impl $wrapper_type { - pub fn new(value: $xr_type) -> Self { - Self(value) - } - } - - // impl std::ops::Deref for $wrapper_type { - // type Target = $xr_type; - // - // fn deref(&self) -> &Self::Target { - // &self.0 - // } - // } - - impl From<$xr_type> for $wrapper_type { - fn from(value: $xr_type) -> Self { - Self::new(value) - } - } - }; -} - -pub use xr_arc_resource_wrapper; -pub use xr_no_clone_resource_wrapper; -pub use xr_resource_wrapper; diff --git a/src/resources.rs b/src/resources.rs deleted file mode 100644 index 1f1e2f9..0000000 --- a/src/resources.rs +++ /dev/null @@ -1,319 +0,0 @@ -use std::ffi::c_void; -use std::sync::atomic::AtomicBool; -use std::sync::Mutex; - -use crate::input::XrInput; -use crate::passthrough::{CompositionLayerPassthrough, XrPassthroughLayer}; -use crate::resource_macros::*; -use crate::xr::sys::CompositionLayerPassthroughFB; -use crate::xr::{CompositionLayerBase, CompositionLayerFlags}; -use crate::{resource_macros::*, xr_resource_wrapper_copy}; -use bevy::prelude::*; -use bevy::prelude::*; -use bevy::render::extract_component::ExtractComponent; -use bevy::render::extract_resource::{ExtractResource, ExtractResourcePlugin}; -use core::ptr; -use openxr as xr; -#[cfg(all(feature = "d3d12", windows))] -use winapi::um::d3d12::{ID3D12CommandQueue, ID3D12Device}; - -xr_resource_wrapper!(XrInstance, xr::Instance); -xr_resource_wrapper_copy!(XrEnvironmentBlendMode, xr::EnvironmentBlendMode); -xr_resource_wrapper_copy!(XrResolution, UVec2); -xr_resource_wrapper_copy!(XrFormat, wgpu::TextureFormat); -xr_resource_wrapper_copy!(XrFrameState, xr::FrameState); -xr_resource_wrapper!(XrViews, Vec); -xr_arc_resource_wrapper!(XrSessionRunning, AtomicBool); -xr_arc_resource_wrapper!(XrSwapchain, Swapchain); -xr_no_clone_resource_wrapper!(XrFrameWaiter, xr::FrameWaiter); - -#[derive(Clone, Resource, ExtractResource)] -pub enum XrSession { - #[cfg(feature = "vulkan")] - Vulkan(xr::Session), - #[cfg(all(feature = "d3d12", windows))] - D3D12(xr::Session), -} - -impl std::ops::Deref for XrSession { - type Target = xr::Session; - - fn deref(&self) -> &Self::Target { - // SAFTEY: should be fine i think -Schmarni - unsafe { - match self { - #[cfg(feature = "vulkan")] - XrSession::Vulkan(sess) => std::mem::transmute(sess), - #[cfg(all(feature = "d3d12", windows))] - XrSession::D3D12(sess) => std::mem::transmute(sess), - } - } - } -} - -#[cfg(feature = "vulkan")] -pub struct VulkanOXrSessionSetupInfo { - pub(crate) device_ptr: *const c_void, - pub(crate) physical_device_ptr: *const c_void, - pub(crate) vk_instance_ptr: *const c_void, - pub(crate) queue_family_index: u32, - pub(crate) xr_system_id: xr::SystemId, -} - -#[cfg(all(feature = "d3d12", windows))] -pub struct D3D12OXrSessionSetupInfo { - pub(crate) raw_device: *mut ID3D12Device, - pub(crate) raw_queue: *mut ID3D12CommandQueue, - pub(crate) xr_system_id: xr::SystemId, -} - -pub enum OXrSessionSetupInfo { - #[cfg(feature = "vulkan")] - Vulkan(VulkanOXrSessionSetupInfo), - #[cfg(all(feature = "d3d12", windows))] - D3D12(D3D12OXrSessionSetupInfo), -} - -pub struct XrResourcePlugin; - -impl Plugin for XrResourcePlugin { - fn build(&self, app: &mut App) { - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - // app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - } -} - -pub enum Swapchain { - #[cfg(feature = "vulkan")] - Vulkan(SwapchainInner), - #[cfg(all(feature = "d3d12", windows))] - D3D12(SwapchainInner), -} - -impl Swapchain { - pub(crate) fn begin(&self) -> xr::Result<()> { - match self { - #[cfg(feature = "vulkan")] - Swapchain::Vulkan(swapchain) => swapchain.begin(), - #[cfg(all(feature = "d3d12", windows))] - Swapchain::D3D12(swapchain) => swapchain.begin(), - } - } - - pub(crate) fn get_render_views(&self) -> (wgpu::TextureView, wgpu::TextureView) { - match self { - #[cfg(feature = "vulkan")] - Swapchain::Vulkan(swapchain) => swapchain.get_render_views(), - #[cfg(all(feature = "d3d12", windows))] - Swapchain::D3D12(swapchain) => swapchain.get_render_views(), - } - } - - pub(crate) fn acquire_image(&self) -> xr::Result<()> { - match self { - #[cfg(feature = "vulkan")] - Swapchain::Vulkan(swapchain) => swapchain.acquire_image(), - #[cfg(all(feature = "d3d12", windows))] - Swapchain::D3D12(swapchain) => swapchain.acquire_image(), - } - } - - pub(crate) fn wait_image(&self) -> xr::Result<()> { - match self { - #[cfg(feature = "vulkan")] - Swapchain::Vulkan(swapchain) => swapchain.wait_image(), - #[cfg(all(feature = "d3d12", windows))] - Swapchain::D3D12(swapchain) => swapchain.wait_image(), - } - } - - pub(crate) fn release_image(&self) -> xr::Result<()> { - match self { - #[cfg(feature = "vulkan")] - Swapchain::Vulkan(swapchain) => swapchain.release_image(), - #[cfg(all(feature = "d3d12", windows))] - Swapchain::D3D12(swapchain) => swapchain.release_image(), - } - } - - pub(crate) fn end( - &self, - predicted_display_time: xr::Time, - views: &[openxr::View], - stage: &xr::Space, - resolution: UVec2, - environment_blend_mode: xr::EnvironmentBlendMode, - passthrough_layer: Option<&XrPassthroughLayer>, - ) -> xr::Result<()> { - match self { - #[cfg(feature = "vulkan")] - Swapchain::Vulkan(swapchain) => swapchain.end( - predicted_display_time, - views, - stage, - resolution, - environment_blend_mode, - passthrough_layer, - ), - #[cfg(all(feature = "d3d12", windows))] - Swapchain::D3D12(swapchain) => swapchain.end( - predicted_display_time, - views, - stage, - resolution, - environment_blend_mode, - passthrough_layer, - ), - } - } -} - -pub struct SwapchainInner { - pub(crate) stream: Mutex>, - pub(crate) handle: Mutex>, - pub(crate) buffers: Vec, - pub(crate) image_index: Mutex, -} -impl Drop for SwapchainInner { - fn drop(&mut self) { - for _ in 0..self.buffers.len() { - let v = self.buffers.remove(0); - Box::leak(Box::new(v)); - } - } -} - -impl SwapchainInner { - fn begin(&self) -> xr::Result<()> { - self.stream.lock().unwrap().begin() - } - - fn get_render_views(&self) -> (wgpu::TextureView, wgpu::TextureView) { - let texture = &self.buffers[*self.image_index.lock().unwrap()]; - - ( - texture.create_view(&wgpu::TextureViewDescriptor { - dimension: Some(wgpu::TextureViewDimension::D2), - array_layer_count: Some(1), - ..Default::default() - }), - texture.create_view(&wgpu::TextureViewDescriptor { - dimension: Some(wgpu::TextureViewDimension::D2), - array_layer_count: Some(1), - base_array_layer: 1, - ..Default::default() - }), - ) - } - - fn acquire_image(&self) -> xr::Result<()> { - let image_index = self.handle.lock().unwrap().acquire_image()?; - *self.image_index.lock().unwrap() = image_index as _; - Ok(()) - } - - fn wait_image(&self) -> xr::Result<()> { - self.handle - .lock() - .unwrap() - .wait_image(xr::Duration::INFINITE) - } - - fn release_image(&self) -> xr::Result<()> { - self.handle.lock().unwrap().release_image() - } - - fn end( - &self, - predicted_display_time: xr::Time, - views: &[openxr::View], - stage: &xr::Space, - resolution: UVec2, - environment_blend_mode: xr::EnvironmentBlendMode, - passthrough_layer: Option<&XrPassthroughLayer>, - ) -> xr::Result<()> { - let rect = xr::Rect2Di { - offset: xr::Offset2Di { x: 0, y: 0 }, - extent: xr::Extent2Di { - width: resolution.x as _, - height: resolution.y as _, - }, - }; - let swapchain = self.handle.lock().unwrap(); - if views.is_empty() { - warn!("views are len of 0"); - return Ok(()); - } - match passthrough_layer { - Some(pass) => { - //bevy::log::info!("Rendering with pass through"); - - self.stream.lock().unwrap().end( - predicted_display_time, - environment_blend_mode, - &[ - &CompositionLayerPassthrough::from_xr_passthrough_layer(pass), - &xr::CompositionLayerProjection::new() - .layer_flags(CompositionLayerFlags::BLEND_TEXTURE_SOURCE_ALPHA) - .space(stage) - .views(&[ - xr::CompositionLayerProjectionView::new() - .pose(views[0].pose) - .fov(views[0].fov) - .sub_image( - xr::SwapchainSubImage::new() - .swapchain(&swapchain) - .image_array_index(0) - .image_rect(rect), - ), - xr::CompositionLayerProjectionView::new() - .pose(views[1].pose) - .fov(views[1].fov) - .sub_image( - xr::SwapchainSubImage::new() - .swapchain(&swapchain) - .image_array_index(1) - .image_rect(rect), - ), - ]), - ], - ) - } - - None => { - // bevy::log::info!("Rendering without pass through"); - self.stream.lock().unwrap().end( - predicted_display_time, - environment_blend_mode, - &[&xr::CompositionLayerProjection::new().space(stage).views(&[ - xr::CompositionLayerProjectionView::new() - .pose(views[0].pose) - .fov(views[0].fov) - .sub_image( - xr::SwapchainSubImage::new() - .swapchain(&swapchain) - .image_array_index(0) - .image_rect(rect), - ), - xr::CompositionLayerProjectionView::new() - .pose(views[1].pose) - .fov(views[1].fov) - .sub_image( - xr::SwapchainSubImage::new() - .swapchain(&swapchain) - .image_array_index(1) - .image_rect(rect), - ), - ])], - ) - } - } - } -} diff --git a/src/xr_init/mod.rs b/src/xr_init/mod.rs deleted file mode 100644 index 50377ef..0000000 --- a/src/xr_init/mod.rs +++ /dev/null @@ -1,263 +0,0 @@ -pub mod schedules; -pub use schedules::*; - -use bevy::{ - prelude::*, - render::{ - camera::{ManualTextureView, ManualTextureViews}, - extract_resource::{ExtractResource, ExtractResourcePlugin}, - renderer::{RenderAdapter, RenderDevice, RenderInstance}, - Render, RenderApp, RenderSet, - }, - window::{PrimaryWindow, RawHandleWrapper}, -}; - -use crate::{ - clean_resources, graphics, - resources::{OXrSessionSetupInfo, XrFormat, XrInstance, XrResolution, XrSession, XrSwapchain}, - LEFT_XR_TEXTURE_HANDLE, RIGHT_XR_TEXTURE_HANDLE, -}; - -#[derive(Resource, Event, Clone, Copy, PartialEq, Eq, Reflect, Debug, ExtractResource)] -pub enum XrStatus { - NoInstance, - Enabled, - Enabling, - Disabled, - Disabling, -} - -#[derive( - Resource, Clone, Copy, PartialEq, Eq, Reflect, Debug, ExtractResource, Default, Deref, DerefMut, -)] -pub struct XrShouldRender(bool); -#[derive( - Resource, Clone, Copy, PartialEq, Eq, Reflect, Debug, ExtractResource, Default, Deref, DerefMut, -)] -pub struct XrHasWaited(bool); - -pub struct XrEarlyInitPlugin; - -pub struct XrInitPlugin; - -pub fn xr_only() -> impl FnMut(Res) -> bool { - resource_equals(XrStatus::Enabled) -} -pub fn xr_render_only() -> impl FnMut(Res) -> bool { - resource_equals(XrShouldRender(true)) -} -pub fn xr_after_wait_only() -> impl FnMut(Res) -> bool { - resource_equals(XrHasWaited(true)) -} - -#[derive(Resource, Clone, Copy, ExtractResource)] -pub struct CleanupRenderWorld; - -impl Plugin for XrEarlyInitPlugin { - fn build(&self, app: &mut App) { - add_schedules(app); - app.add_event::() - .add_event::() - .add_event::() - .add_event::(); - } -} - -impl Plugin for XrInitPlugin { - fn build(&self, app: &mut App) { - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.add_plugins(ExtractResourcePlugin::::default()); - app.init_resource::(); - app.init_resource::(); - app.add_systems(PreUpdate, setup_xr.run_if(on_event::())) - .add_systems(PreUpdate, cleanup_xr.run_if(on_event::())); - app.add_systems( - PostUpdate, - start_xr_session.run_if(on_event::()), - ); - app.add_systems( - PostUpdate, - stop_xr_session.run_if(on_event::()), - ); - app.add_systems(XrSetup, setup_manual_texture_views); - app.add_systems(XrCleanup, set_cleanup_res); - app.add_systems(PreUpdate, remove_cleanup_res.before(cleanup_xr)); - let render_app = app.sub_app_mut(RenderApp); - render_app.add_systems( - Render, - remove_cleanup_res - .in_set(RenderSet::Cleanup) - .after(clean_resources), - ); - } -} - -#[derive(Resource, Clone, Copy, PartialEq, Eq, Default)] -pub enum ExitAppOnSessionExit { - #[default] - /// Restart XrSession when session is lost - OnlyOnExit, - /// Always exit the app - Always, - /// Keep app open when XrSession wants to exit or is lost - Never, -} - -pub struct StartSessionOnStartup; - -impl Plugin for StartSessionOnStartup { - fn build(&self, app: &mut App) { - app.add_systems(Startup, |mut event: EventWriter| { - event.send_default(); - }); - } -} - -fn set_cleanup_res(mut commands: Commands) { - info!("Set Cleanup Res"); - commands.insert_resource(CleanupRenderWorld); -} -fn remove_cleanup_res(mut commands: Commands) { - commands.remove_resource::(); -} - -fn setup_manual_texture_views( - mut manual_texture_views: ResMut, - swapchain: Res, - xr_resolution: Res, - xr_format: Res, -) { - info!("Creating Texture views"); - let (left, right) = swapchain.get_render_views(); - let left = ManualTextureView { - texture_view: left.into(), - size: **xr_resolution, - format: **xr_format, - }; - let right = ManualTextureView { - texture_view: right.into(), - size: **xr_resolution, - format: **xr_format, - }; - manual_texture_views.insert(LEFT_XR_TEXTURE_HANDLE, left); - manual_texture_views.insert(RIGHT_XR_TEXTURE_HANDLE, right); -} - -pub fn setup_xr(world: &mut World) { - info!("Pre XrPreSetup"); - world.run_schedule(XrPreSetup); - info!("Post XrPreSetup"); - world.run_schedule(XrSetup); - world.run_schedule(XrPrePostSetup); - world.run_schedule(XrPostSetup); - *world.resource_mut::() = XrStatus::Enabled; -} -fn cleanup_xr(world: &mut World) { - world.run_schedule(XrPreCleanup); - world.run_schedule(XrCleanup); - world.run_schedule(XrPostCleanup); - *world.resource_mut::() = XrStatus::Disabled; -} - -#[derive(Event, Clone, Copy, Default)] -pub struct StartXrSession; - -#[derive(Event, Clone, Copy, Default)] -pub struct EndXrSession; - -#[derive(Event, Clone, Copy, Default)] -pub(crate) struct SetupXrData; -#[derive(Event, Clone, Copy, Default)] -pub(crate) struct CleanupXrData; - -#[allow(clippy::too_many_arguments)] -fn start_xr_session( - mut commands: Commands, - mut status: ResMut, - instance: Option>, - primary_window: Query<&RawHandleWrapper, With>, - setup_info: Option>, - render_device: Option>, - render_adapter: Option>, - render_instance: Option>, -) { - info!("start Session"); - match *status { - XrStatus::Disabled => {} - XrStatus::NoInstance => { - warn!("Trying to start OpenXR Session without instance, ignoring"); - return; - } - XrStatus::Enabled | XrStatus::Enabling => { - warn!("Trying to start OpenXR Session while one already exists, ignoring"); - return; - } - XrStatus::Disabling => { - warn!("Trying to start OpenXR Session while one is stopping, ignoring"); - return; - } - } - let ( - Some(instance), - Some(setup_info), - Some(render_device), - Some(render_adapter), - Some(render_instance), - ) = ( - instance, - setup_info, - render_device, - render_adapter, - render_instance, - ) - else { - error!("Missing resources after passing status check"); - return; - }; - let ( - xr_session, - xr_resolution, - xr_format, - xr_session_running, - xr_frame_waiter, - xr_swapchain, - xr_input, - xr_views, - xr_frame_state, - ) = match graphics::start_xr_session( - primary_window.get_single().cloned().ok(), - &setup_info, - &instance, - &render_device, - &render_adapter, - &render_instance, - ) { - Ok(data) => data, - Err(err) => { - error!("Unable to start OpenXR Session: {}", err); - return; - } - }; - commands.insert_resource(xr_session); - commands.insert_resource(xr_resolution); - commands.insert_resource(xr_format); - commands.insert_resource(xr_session_running); - commands.insert_resource(xr_frame_waiter); - commands.insert_resource(xr_swapchain); - commands.insert_resource(xr_input); - commands.insert_resource(xr_views); - commands.insert_resource(xr_frame_state); - *status = XrStatus::Enabling; -} - -fn stop_xr_session(session: ResMut, mut status: ResMut) { - match session.request_exit() { - Ok(_) => {} - Err(err) => { - error!("Error while trying to request session exit: {}", err) - } - } - *status = XrStatus::Disabling; -} diff --git a/src/xr_init/schedules.rs b/src/xr_init/schedules.rs deleted file mode 100644 index d4bcf07..0000000 --- a/src/xr_init/schedules.rs +++ /dev/null @@ -1,54 +0,0 @@ -use bevy::{ - app::App, - ecs::schedule::{ExecutorKind, Schedule, ScheduleLabel}, -}; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrPreSetup; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrSetup; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrPrePostSetup; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrPostSetup; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrPreCleanup; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrCleanup; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrPostCleanup; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrPreRenderUpdate; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrRenderUpdate; - -#[derive(Debug, ScheduleLabel, Clone, Copy, Hash, PartialEq, Eq)] -pub struct XrPostRenderUpdate; - -pub(super) fn add_schedules(app: &mut App) { - let schedules = [ - Schedule::new(XrPreSetup), - Schedule::new(XrSetup), - Schedule::new(XrPrePostSetup), - Schedule::new(XrPostSetup), - Schedule::new(XrPreRenderUpdate), - Schedule::new(XrRenderUpdate), - Schedule::new(XrPostRenderUpdate), - Schedule::new(XrPreCleanup), - Schedule::new(XrCleanup), - Schedule::new(XrPostCleanup), - ]; - for mut schedule in schedules { - schedule.set_executor_kind(ExecutorKind::SingleThreaded); - schedule.set_apply_final_deferred(true); - app.add_schedule(schedule); - } -} diff --git a/src/xr_input/actions.rs b/src/xr_input/actions.rs deleted file mode 100644 index 84b3273..0000000 --- a/src/xr_input/actions.rs +++ /dev/null @@ -1,409 +0,0 @@ -use std::error::Error; - -use bevy::{prelude::*, utils::HashMap}; -use openxr as xr; -use xr::{Action, Binding, Haptic, Posef, Vector2f}; - -use crate::{ - resources::{XrInstance, XrSession}, - xr_init::{xr_only, XrCleanup, XrPrePostSetup, XrPreSetup}, -}; - -use super::oculus_touch::ActionSets; - -pub use xr::sys::NULL_PATH; - -pub struct XrActionsPlugin; -impl Plugin for XrActionsPlugin { - fn build(&self, app: &mut App) { - app.add_systems(PreUpdate, sync_actions.run_if(xr_only())); - app.add_systems( - XrPreSetup, - (insert_setup_action_sets, apply_deferred).chain(), - ); - app.add_systems(XrPrePostSetup, setup_oxr_actions); - app.add_systems(XrCleanup, clean_actions); - } -} - -fn insert_setup_action_sets(mut cmds: Commands) { - info!("WHAT?!"); - cmds.insert_resource(SetupActionSets { - sets: HashMap::new(), - }); -} - -fn clean_actions(mut cmds: Commands) { - cmds.remove_resource::(); - cmds.remove_resource::(); -} - -#[inline(always)] -fn create_action( - action: &SetupAction, - action_name: &'static str, - oxr_action_set: &xr::ActionSet, - hands: &[xr::Path], -) -> xr::Action { - match action.handednes { - ActionHandednes::Single => oxr_action_set - .create_action(action_name, &action.pretty_name, &[]) - .unwrap_or_else(|_| panic!("Unable to create action: {}", action_name)), - ActionHandednes::Double => oxr_action_set - .create_action(action_name, &action.pretty_name, hands) - .unwrap_or_else(|_| panic!("Unable to create action: {}", action_name)), - } -} -pub fn setup_oxr_actions(world: &mut World) { - let actions = world.remove_resource::().unwrap(); - let instance = world.get_resource::().unwrap(); - let session = world.get_resource::().unwrap(); - let left_path = instance.string_to_path("/user/hand/left").unwrap(); - let right_path = instance.string_to_path("/user/hand/right").unwrap(); - let hands = [left_path, right_path]; - - let mut action_sets = XrActionSets { sets: default() }; - // let mut action_bindings: HashMap<&'static str, Vec> = HashMap::new(); - let mut action_bindings: HashMap< - (&'static str, &'static str), - HashMap<&'static str, Vec>, - > = HashMap::new(); - for (set_name, set) in actions.sets.into_iter() { - let mut actions: HashMap<&'static str, TypedAction> = default(); - let oxr_action_set = instance - .create_action_set(set_name, &set.pretty_name, set.priority) - .expect("Unable to create action set"); - for (action_name, action) in set.actions.into_iter() { - use self::create_action as ca; - let typed_action = match action.action_type { - ActionType::Vec2 => { - TypedAction::Vec2(ca(&action, action_name, &oxr_action_set, &hands)) - } - ActionType::F32 => { - TypedAction::F32(ca(&action, action_name, &oxr_action_set, &hands)) - } - ActionType::Bool => { - TypedAction::Bool(ca(&action, action_name, &oxr_action_set, &hands)) - } - ActionType::PoseF => { - TypedAction::PoseF(ca(&action, action_name, &oxr_action_set, &hands)) - } - ActionType::Haptic => { - TypedAction::Haptic(ca(&action, action_name, &oxr_action_set, &hands)) - } - }; - actions.insert(action_name, typed_action); - for (device_path, bindings) in action.bindings.into_iter() { - for b in bindings { - // info!("binding {} to {}", action_name, b); - action_bindings - .entry((set_name, action_name)) - .or_default() - .entry(device_path) - .or_default() - .push(instance.string_to_path(b).unwrap()); - } - } - } - // oxr_action_sets.push(oxr_action_set); - action_sets.sets.insert( - set_name, - ActionSet { - oxr_action_set, - actions, - enabled: true, - }, - ); - } - let mut b_indings: HashMap<&'static str, Vec> = HashMap::new(); - for (dev, mut bindings) in action_sets - .sets - .iter() - .flat_map(|(set_name, set)| { - set.actions - .iter() - .map(move |(action_name, a)| (set_name, action_name, a)) - }) - .zip([&action_bindings].into_iter().cycle()) - .flat_map(move |((set_name, action_name, action), bindings)| { - bindings - .get(&(set_name as &'static str, action_name as &'static str)) - .unwrap() - .iter() - .map(move |(dev, bindings)| (action, dev, bindings)) - }) - .map(|(action, dev, bindings)| { - ( - dev, - bindings - .iter() - .map(move |binding| match &action { - TypedAction::Vec2(a) => Binding::new(a, *binding), - TypedAction::F32(a) => Binding::new(a, *binding), - TypedAction::Bool(a) => Binding::new(a, *binding), - TypedAction::PoseF(a) => Binding::new(a, *binding), - TypedAction::Haptic(a) => Binding::new(a, *binding), - }) - .collect::>(), - ) - }) - { - b_indings.entry(dev).or_default().append(&mut bindings); - } - for (dev, bindings) in b_indings.into_iter() { - instance - .suggest_interaction_profile_bindings(instance.string_to_path(dev).unwrap(), &bindings) - .expect("Unable to suggest interaction bindings!"); - } - session - .attach_action_sets( - &action_sets - .sets - .values() - .map(|set| &set.oxr_action_set) - .collect::>(), - ) - .expect("Unable to attach action sets!"); - - world.insert_resource(action_sets); -} - -pub enum ActionHandednes { - Single, - Double, -} - -#[derive(Clone, Copy)] -pub enum ActionType { - F32, - Bool, - PoseF, - Haptic, - Vec2, -} - -pub enum TypedAction { - F32(Action), - Bool(Action), - PoseF(Action), - Haptic(Action), - Vec2(Action), -} - -pub struct SetupAction { - pretty_name: String, - action_type: ActionType, - handednes: ActionHandednes, - bindings: HashMap<&'static str, Vec<&'static str>>, -} - -pub struct SetupActionSet { - pretty_name: String, - priority: u32, - actions: HashMap<&'static str, SetupAction>, -} - -impl SetupActionSet { - pub fn new_action( - &mut self, - name: &'static str, - pretty_name: String, - action_type: ActionType, - handednes: ActionHandednes, - ) { - self.actions.insert( - name, - SetupAction { - pretty_name, - action_type, - handednes, - bindings: default(), - }, - ); - } - pub fn suggest_binding(&mut self, device_path: &'static str, bindings: &[XrBinding]) { - for binding in bindings { - self.actions - .get_mut(binding.action) - .ok_or(eyre::eyre!("Missing Action: {}", binding.action)) - .unwrap() - .bindings - .entry(device_path) - .or_default() - .push(binding.path); - } - } -} -pub struct XrBinding { - action: &'static str, - path: &'static str, -} - -impl XrBinding { - pub fn new(action_name: &'static str, binding_path: &'static str) -> XrBinding { - XrBinding { - action: action_name, - path: binding_path, - } - } -} - -#[derive(Resource)] -pub struct SetupActionSets { - sets: HashMap<&'static str, SetupActionSet>, -} - -impl SetupActionSets { - pub fn add_action_set( - &mut self, - name: &'static str, - pretty_name: String, - priority: u32, - ) -> &mut SetupActionSet { - self.sets.insert( - name, - SetupActionSet { - pretty_name, - priority, - actions: HashMap::new(), - }, - ); - self.sets.get_mut(name).unwrap() - } -} - -pub struct ActionSet { - // add functionality to enable/disable action sets - enabled: bool, - actions: HashMap<&'static str, TypedAction>, - oxr_action_set: xr::ActionSet, -} - -#[derive(Resource)] -pub struct XrActionSets { - sets: HashMap<&'static str, ActionSet>, -} - -use std::fmt::Display as FmtDisplay; -impl FmtDisplay for ActionError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let err = match self { - ActionError::NoActionSet => "Action Set Not Found!", - ActionError::NoAction => "Action Not Found!", - ActionError::WrongActionType => "Wrong Action Type!", - }; - write!(f, "{}", err) - } -} -impl Error for ActionError {} -#[derive(Debug)] -pub enum ActionError { - NoActionSet, - NoAction, - WrongActionType, -} - -impl XrActionSets { - pub fn get_action_vec2( - &self, - action_set: &'static str, - action_name: &'static str, - ) -> Result<&Action, ActionError> { - let action = self - .sets - .get(action_set) - .ok_or(ActionError::NoActionSet)? - .actions - .get(action_name) - .ok_or(ActionError::NoAction)?; - match action { - TypedAction::Vec2(a) => Ok(a), - _ => Err(ActionError::WrongActionType), - } - } - pub fn get_action_f32( - &self, - action_set: &'static str, - action_name: &'static str, - ) -> Result<&Action, ActionError> { - let action = self - .sets - .get(action_set) - .ok_or(ActionError::NoActionSet)? - .actions - .get(action_name) - .ok_or(ActionError::NoAction)?; - match action { - TypedAction::F32(a) => Ok(a), - _ => Err(ActionError::WrongActionType), - } - } - pub fn get_action_bool( - &self, - action_set: &'static str, - action_name: &'static str, - ) -> Result<&Action, ActionError> { - let action = self - .sets - .get(action_set) - .ok_or(ActionError::NoActionSet)? - .actions - .get(action_name) - .ok_or(ActionError::NoAction)?; - match action { - TypedAction::Bool(a) => Ok(a), - _ => Err(ActionError::WrongActionType), - } - } - pub fn get_action_posef( - &self, - action_set: &'static str, - action_name: &'static str, - ) -> Result<&Action, ActionError> { - let action = self - .sets - .get(action_set) - .ok_or(ActionError::NoActionSet)? - .actions - .get(action_name) - .ok_or(ActionError::NoAction)?; - match action { - TypedAction::PoseF(a) => Ok(a), - _ => Err(ActionError::WrongActionType), - } - } - pub fn get_action_haptic( - &self, - action_set: &'static str, - action_name: &'static str, - ) -> Result<&Action, ActionError> { - let action = self - .sets - .get(action_set) - .ok_or(ActionError::NoActionSet)? - .actions - .get(action_name) - .ok_or(ActionError::NoAction)?; - match action { - TypedAction::Haptic(a) => Ok(a), - _ => Err(ActionError::WrongActionType), - } - } -} - -pub fn sync_actions(action_sets: Res, session: Res) { - let active_sets = action_sets - .sets - .values() - .filter_map(|set| { - if set.enabled { - Some(xr::ActiveActionSet::new(&set.oxr_action_set)) - } else { - None - } - }) - .collect::>(); - if let Err(err) = session.sync_actions(&active_sets) { - warn!("OpenXR action sync error: {}", err); - } -} diff --git a/src/xr_input/controllers.rs b/src/xr_input/controllers.rs deleted file mode 100644 index e13294f..0000000 --- a/src/xr_input/controllers.rs +++ /dev/null @@ -1,10 +0,0 @@ -use openxr::{Action, ActionTy}; - -pub struct Touchable { - pub inner: Action, - pub touch: Action, -} -pub struct Handed { - pub left: T, - pub right: T, -} diff --git a/src/xr_input/debug_gizmos.rs b/src/xr_input/debug_gizmos.rs deleted file mode 100644 index 562f7e9..0000000 --- a/src/xr_input/debug_gizmos.rs +++ /dev/null @@ -1,396 +0,0 @@ -use bevy::color::palettes; -use bevy::ecs::schedule::IntoSystemConfigs; -use bevy::log::{debug, info}; -use bevy::math::Dir3; -use bevy::prelude::{ - Gizmos, GlobalTransform, Plugin, Quat, Query, Res, Transform, Update, Vec2, Vec3, With, Without, -}; - -use crate::xr_init::xr_only; -use crate::{ - input::XrInput, - resources::{XrFrameState, XrSession}, -}; - -use crate::xr_input::{ - oculus_touch::{OculusController, OculusControllerRef}, - Hand, -}; - -use super::{ - actions::XrActionSets, - trackers::{OpenXRLeftController, OpenXRRightController, OpenXRTrackingRoot}, -}; - -/// add debug renderer for controllers -#[derive(Default)] -pub struct OpenXrDebugRenderer; - -impl Plugin for OpenXrDebugRenderer { - fn build(&self, app: &mut bevy::prelude::App) { - app.add_systems(Update, draw_gizmos.run_if(xr_only())); - } -} - -#[allow(clippy::too_many_arguments, clippy::complexity)] -pub fn draw_gizmos( - mut gizmos: Gizmos, - oculus_controller: Res, - frame_state: Res, - xr_input: Res, - session: Res, - tracking_root_query: Query< - &mut Transform, - ( - With, - Without, - Without, - ), - >, - left_controller_query: Query< - &GlobalTransform, - ( - With, - Without, - Without, - ), - >, - right_controller_query: Query< - &GlobalTransform, - ( - With, - Without, - Without, - ), - >, - action_sets: Res, -) { - // if let Some(hand_tracking) = hand_tracking { - // let handtracking_ref = hand_tracking.get_ref(&xr_input, &frame_state); - // if let Some(joints) = handtracking_ref.get_poses(Hand::Left) { - // for joint in joints.inner() { - // let trans = Transform::from_rotation(joint.orientation); - // gizmos.circle( - // joint.position, - // trans.forward(), - // joint.radius, - // palettes::css::ORANGE_RED, - // ); - // } - // } - // if let Some(joints) = handtracking_ref.get_poses(Hand::Right) { - // for joint in joints.inner() { - // let trans = Transform::from_rotation(joint.orientation); - // gizmos.circle( - // joint.position, - // trans.forward(), - // joint.radius, - // palettes::css::LIME_GREEN, - // ); - // } - // return; - // } - // } - //lock frame - // let frame_state = *frame_state.lock().unwrap(); - //get controller - let controller = oculus_controller.get_ref(&session, &frame_state, &xr_input, &action_sets); - let root = tracking_root_query.get_single(); - match root { - Ok(position) => { - gizmos.circle( - position.translation - + Vec3 { - x: 0.0, - y: 0.01, - z: 0.0, - }, - Dir3::Y, - 0.2, - palettes::css::RED, - ); - } - Err(_) => info!("too many tracking roots"), - } - //draw the hands - //left - let left_transform = left_controller_query.get_single(); - match left_transform { - Ok(left_entity) => { - draw_hand_gizmo(&mut gizmos, &controller, Hand::Left, left_entity); - } - Err(_) => debug!("no left controller entity for debug gizmos"), - } - //right - let right_transform = right_controller_query.get_single(); - match right_transform { - Ok(right_entity) => { - draw_hand_gizmo(&mut gizmos, &controller, Hand::Right, right_entity); - } - Err(_) => debug!("no right controller entity for debug gizmos"), - } -} - -fn draw_hand_gizmo( - gizmos: &mut Gizmos, - controller: &OculusControllerRef<'_>, - hand: Hand, - hand_transform: &GlobalTransform, -) { - match hand { - Hand::Left => { - let left_color = palettes::css::YELLOW_GREEN; - let off_color = palettes::css::BLUE; - let touch_color = palettes::css::GREEN; - let pressed_color = palettes::css::RED; - - let grip_quat_offset = Quat::from_rotation_x(-1.4); - let face_quat_offset = Quat::from_rotation_x(1.05); - let trans = hand_transform.compute_transform(); - let controller_vec3 = trans.translation; - let controller_quat = trans.rotation; - let face_quat = controller_quat.mul_quat(face_quat_offset); - let face_quat_normal = face_quat.mul_vec3(Vec3::Z); - - //draw grip - gizmos.rect( - controller_vec3, - controller_quat * grip_quat_offset, - Vec2::new(0.05, 0.1), - left_color, - ); - - let face_translation_offset = Quat::from_rotation_x(-1.7); //direction to move the face from the controller tracking point - let face_translation_vec3 = controller_vec3 - + controller_quat - .mul_quat(face_translation_offset) - .mul_vec3(Vec3::Y * 0.075); //distance to move face by - - //draw face - gizmos.circle( - face_translation_vec3, - Dir3::new_unchecked(face_quat_normal), - 0.04, - palettes::css::YELLOW_GREEN, - ); - - //button b - let mut b_color = off_color; - if controller.y_button_touched() { - b_color = touch_color; - } - if controller.y_button() { - b_color = pressed_color; - } - - let b_offset_quat = face_quat; - let b_translation_vec3 = - face_translation_vec3 + b_offset_quat.mul_vec3(Vec3::new(0.025, -0.01, 0.0)); - gizmos.circle( - b_translation_vec3, - Dir3::new_unchecked(face_quat_normal), - 0.0075, - b_color, - ); - - //button a - let mut a_color = off_color; - if controller.x_button_touched() { - a_color = touch_color; - } - if controller.x_button() { - a_color = pressed_color; - } - - let a_offset_quat = face_quat; - let a_translation_vec3 = - face_translation_vec3 + a_offset_quat.mul_vec3(Vec3::new(0.025, 0.01, 0.0)); - gizmos.circle( - a_translation_vec3, - Dir3::new_unchecked(face_quat_normal), - 0.0075, - a_color, - ); - - //joystick - let joystick_offset_quat = face_quat; - let joystick_base_vec = - face_translation_vec3 + joystick_offset_quat.mul_vec3(Vec3::new(-0.02, 0.0, 0.0)); - let mut joystick_color = off_color; - if controller.thumbstick_touch(Hand::Left) { - joystick_color = touch_color; - } - - //base - gizmos.circle( - joystick_base_vec, - Dir3::new_unchecked(face_quat_normal), - 0.014, - joystick_color, - ); - - let stick = controller.thumbstick(Hand::Left); - let input = Vec3::new(stick.x, -stick.y, 0.0); - let joystick_top_vec = face_translation_vec3 - + joystick_offset_quat.mul_vec3(Vec3::new(-0.02, 0.0, -0.01)) - + joystick_offset_quat.mul_vec3(input * 0.01); - //top - gizmos.circle( - joystick_top_vec, - Dir3::new_unchecked(face_quat_normal), - 0.005, - joystick_color, - ); - - //trigger - let trigger_state = controller.trigger(Hand::Left); - let trigger_rotation = Quat::from_rotation_x(-0.75 * trigger_state); - let mut trigger_color = off_color; - if controller.trigger_touched(Hand::Left) { - trigger_color = touch_color; - } - let trigger_transform = Transform { - translation: face_translation_vec3 - + face_quat - .mul_quat(trigger_rotation) - .mul_vec3(Vec3::new(0.0, 0.0, 0.02)), - rotation: face_quat.mul_quat(trigger_rotation), - scale: Vec3 { - x: 0.01, - y: 0.02, - z: 0.03, - }, - }; - gizmos.cuboid(trigger_transform, trigger_color); - } - Hand::Right => { - //get right controller - let right_color = palettes::css::YELLOW_GREEN; - let off_color = palettes::css::BLUE; - let touch_color = palettes::css::GREEN; - let pressed_color = palettes::css::RED; - - let grip_quat_offset = Quat::from_rotation_x(-1.4); - let face_quat_offset = Quat::from_rotation_x(1.05); - - let trans = hand_transform.compute_transform(); - let controller_vec3 = trans.translation; - let controller_quat = trans.rotation; - let face_quat = controller_quat.mul_quat(face_quat_offset); - let face_quat_normal = face_quat.mul_vec3(Vec3::Z); - - let _squeeze = controller.squeeze(Hand::Right); - //info!("{:?}", squeeze); - //grip - gizmos.rect( - controller_vec3, - controller_quat * grip_quat_offset, - Vec2::new(0.05, 0.1), - right_color, - ); - - let face_translation_offset = Quat::from_rotation_x(-1.7); //direction to move the face from the controller tracking point - let face_translation_vec3 = controller_vec3 - + controller_quat - .mul_quat(face_translation_offset) - .mul_vec3(Vec3::Y * 0.075); //distance to move face by - - //draw face - gizmos.circle( - face_translation_vec3, - Dir3::new_unchecked(face_quat_normal), - 0.04, - palettes::css::YELLOW_GREEN, - ); - - //button b - let mut b_color = off_color; - if controller.b_button_touched() { - b_color = touch_color; - } - if controller.b_button() { - b_color = pressed_color; - } - - let b_offset_quat = face_quat; - let b_translation_vec3 = - face_translation_vec3 + b_offset_quat.mul_vec3(Vec3::new(-0.025, -0.01, 0.0)); - gizmos.circle( - b_translation_vec3, - Dir3::new_unchecked(face_quat_normal), - 0.0075, - b_color, - ); - - //button a - let mut a_color = off_color; - if controller.a_button_touched() { - a_color = touch_color; - } - if controller.a_button() { - a_color = pressed_color; - } - - let a_offset_quat = face_quat; - let a_translation_vec3 = - face_translation_vec3 + a_offset_quat.mul_vec3(Vec3::new(-0.025, 0.01, 0.0)); - gizmos.circle( - a_translation_vec3, - Dir3::new_unchecked(face_quat_normal), - 0.0075, - a_color, - ); - - //joystick time - let joystick_offset_quat = face_quat; - let joystick_base_vec = - face_translation_vec3 + joystick_offset_quat.mul_vec3(Vec3::new(0.02, 0.0, 0.0)); - let mut joystick_color = off_color; - if controller.thumbstick_touch(Hand::Right) { - joystick_color = touch_color; - } - - //base - gizmos.circle( - joystick_base_vec, - Dir3::new_unchecked(face_quat_normal), - 0.014, - joystick_color, - ); - - let stick = controller.thumbstick(Hand::Right); - let input = Vec3::new(stick.x, -stick.y, 0.0); - let joystick_top_vec = face_translation_vec3 - + joystick_offset_quat.mul_vec3(Vec3::new(0.02, 0.0, -0.01)) - + joystick_offset_quat.mul_vec3(input * 0.01); - //top - gizmos.circle( - joystick_top_vec, - Dir3::new_unchecked(face_quat_normal), - 0.005, - joystick_color, - ); - - //trigger - let trigger_state = controller.trigger(Hand::Right); - let trigger_rotation = Quat::from_rotation_x(-0.75 * trigger_state); - let mut trigger_color = off_color; - if controller.trigger_touched(Hand::Right) { - trigger_color = touch_color; - } - let trigger_transform = Transform { - translation: face_translation_vec3 - + face_quat - .mul_quat(trigger_rotation) - .mul_vec3(Vec3::new(0.0, 0.0, 0.02)), - rotation: face_quat.mul_quat(trigger_rotation), - scale: Vec3 { - x: 0.01, - y: 0.02, - z: 0.03, - }, - }; - gizmos.cuboid(trigger_transform, trigger_color); - } - } -} diff --git a/src/xr_input/hand_poses.rs b/src/xr_input/hand_poses.rs deleted file mode 100644 index be5598b..0000000 --- a/src/xr_input/hand_poses.rs +++ /dev/null @@ -1,519 +0,0 @@ -use bevy::prelude::{Quat, Transform, Vec3}; -use openxr::{Posef, Quaternionf, Vector3f}; - -use super::Hand; - -pub fn get_simulated_open_hand_transforms(hand: Hand) -> [Transform; 26] { - let test_hand_bones: [Vec3; 26] = [ - Vec3 { - x: 0.0, - y: 0.0, - z: 0.0, - }, //palm - Vec3 { - x: 0.0, - y: 0.0, - z: -0.04, - }, //wrist - Vec3 { - x: -0.02, - y: 0.00, - z: 0.015, - }, //thumb - Vec3 { - x: 0.0, - y: 0.0, - z: 0.03, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.024, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.024, - }, - Vec3 { - x: -0.01, - y: -0.015, - z: 0.0155, - }, //index - Vec3 { - x: 0.0, - y: 0.0, - z: 0.064, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.037, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.02, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.01, - }, - Vec3 { - x: 0.0, - y: -0.02, - z: 0.016, - }, //middle - Vec3 { - x: 0.0, - y: 0.0, - z: 0.064, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.037, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.02, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.01, - }, - Vec3 { - x: 0.01, - y: -0.015, - z: 0.015, - }, //ring - Vec3 { - x: 0.0, - y: 0.0, - z: 0.064, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.037, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.02, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.01, - }, - Vec3 { - x: 0.02, - y: -0.01, - z: 0.015, - }, //little - Vec3 { - x: 0.0, - y: 0.0, - z: 0.064, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.037, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.02, - }, - Vec3 { - x: 0.0, - y: 0.0, - z: 0.01, - }, - ]; - bones_to_transforms(test_hand_bones, hand) -} - -fn bones_to_transforms(hand_bones: [Vec3; 26], hand: Hand) -> [Transform; 26] { - match hand { - Hand::Left => { - let mut result_array: [Transform; 26] = [Transform::default(); 26]; - for (place, data) in result_array.iter_mut().zip(hand_bones.iter()) { - *place = Transform { - translation: Vec3 { - x: -data.x, - y: -data.y, - z: -data.z, - }, - rotation: Quat::IDENTITY, - scale: Vec3::splat(1.0), - } - } - return result_array; - } - Hand::Right => { - let mut result_array: [Transform; 26] = [Transform::default(); 26]; - for (place, data) in result_array.iter_mut().zip(hand_bones.iter()) { - *place = Transform { - translation: Vec3 { - x: data.x, - y: -data.y, - z: -data.z, - }, - rotation: Quat::IDENTITY, - scale: Vec3::splat(1.0), - } - } - return result_array; - } - } -} - -pub fn get_test_hand_pose_array() -> [Posef; 26] { - let test_hand_pose: [Posef; 26] = [ - Posef { - position: Vector3f { - x: 0.0, - y: 0.0, - z: 0.0, - }, - orientation: Quaternionf { - x: -0.267, - y: 0.849, - z: 0.204, - w: 0.407, - }, - }, //palm - Posef { - position: Vector3f { - x: 0.02, - y: -0.040, - z: -0.015, - }, - orientation: Quaternionf { - x: -0.267, - y: 0.849, - z: 0.204, - w: 0.407, - }, - }, - Posef { - position: Vector3f { - x: 0.019, - y: -0.037, - z: 0.011, - }, - orientation: Quaternionf { - x: -0.744, - y: -0.530, - z: 0.156, - w: -0.376, - }, - }, - Posef { - position: Vector3f { - x: 0.015, - y: -0.014, - z: 0.047, - }, - orientation: Quaternionf { - x: -0.786, - y: -0.550, - z: 0.126, - w: -0.254, - }, - }, - Posef { - position: Vector3f { - x: 0.004, - y: 0.003, - z: 0.068, - }, - orientation: Quaternionf { - x: -0.729, - y: -0.564, - z: 0.027, - w: -0.387, - }, - }, - Posef { - position: Vector3f { - x: -0.009, - y: 0.011, - z: 0.072, - }, - orientation: Quaternionf { - x: -0.585, - y: -0.548, - z: -0.140, - w: -0.582, - }, - }, - Posef { - position: Vector3f { - x: 0.027, - y: -0.021, - z: 0.001, - }, - orientation: Quaternionf { - x: -0.277, - y: -0.826, - z: 0.317, - w: -0.376, - }, - }, - Posef { - position: Vector3f { - x: -0.002, - y: 0.026, - z: 0.034, - }, - orientation: Quaternionf { - x: -0.277, - y: -0.826, - z: 0.317, - w: -0.376, - }, - }, - Posef { - position: Vector3f { - x: -0.023, - y: 0.049, - z: 0.055, - }, - orientation: Quaternionf { - x: -0.244, - y: -0.843, - z: 0.256, - w: -0.404, - }, - }, - Posef { - position: Vector3f { - x: -0.037, - y: 0.059, - z: 0.067, - }, - orientation: Quaternionf { - x: -0.200, - y: -0.866, - z: 0.165, - w: -0.428, - }, - }, - Posef { - position: Vector3f { - x: -0.045, - y: 0.063, - z: 0.073, - }, - orientation: Quaternionf { - x: -0.172, - y: -0.874, - z: 0.110, - w: -0.440, - }, - }, - Posef { - position: Vector3f { - x: 0.021, - y: -0.017, - z: -0.007, - }, - orientation: Quaternionf { - x: -0.185, - y: -0.817, - z: 0.370, - w: -0.401, - }, - }, - Posef { - position: Vector3f { - x: -0.011, - y: 0.029, - z: 0.018, - }, - orientation: Quaternionf { - x: -0.185, - y: -0.817, - z: 0.370, - w: -0.401, - }, - }, - Posef { - position: Vector3f { - x: -0.034, - y: 0.06, - z: 0.033, - }, - orientation: Quaternionf { - x: -0.175, - y: -0.809, - z: 0.371, - w: -0.420, - }, - }, - Posef { - position: Vector3f { - x: -0.051, - y: 0.072, - z: 0.045, - }, - orientation: Quaternionf { - x: -0.109, - y: -0.856, - z: 0.245, - w: -0.443, - }, - }, - Posef { - position: Vector3f { - x: -0.06, - y: 0.077, - z: 0.051, - }, - orientation: Quaternionf { - x: -0.075, - y: -0.871, - z: 0.180, - w: -0.450, - }, - }, - Posef { - position: Vector3f { - x: 0.013, - y: -0.017, - z: -0.015, - }, - orientation: Quaternionf { - x: -0.132, - y: -0.786, - z: 0.408, - w: -0.445, - }, - }, - Posef { - position: Vector3f { - x: -0.02, - y: 0.025, - z: 0.0, - }, - orientation: Quaternionf { - x: -0.132, - y: -0.786, - z: 0.408, - w: -0.445, - }, - }, - Posef { - position: Vector3f { - x: -0.042, - y: 0.055, - z: 0.007, - }, - orientation: Quaternionf { - x: -0.131, - y: -0.762, - z: 0.432, - w: -0.464, - }, - }, - Posef { - position: Vector3f { - x: -0.06, - y: 0.069, - z: 0.015, - }, - orientation: Quaternionf { - x: -0.071, - y: -0.810, - z: 0.332, - w: -0.477, - }, - }, - Posef { - position: Vector3f { - x: -0.069, - y: 0.075, - z: 0.02, - }, - orientation: Quaternionf { - x: -0.029, - y: -0.836, - z: 0.260, - w: -0.482, - }, - }, - Posef { - position: Vector3f { - x: 0.004, - y: -0.022, - z: -0.022, - }, - orientation: Quaternionf { - x: -0.060, - y: -0.749, - z: 0.481, - w: -0.452, - }, - }, - Posef { - position: Vector3f { - x: -0.028, - y: 0.018, - z: -0.015, - }, - orientation: Quaternionf { - x: -0.060, - y: -0.749, - z: 0.481, - w: -0.452, - }, - }, - Posef { - position: Vector3f { - x: -0.046, - y: 0.042, - z: -0.017, - }, - orientation: Quaternionf { - x: -0.061, - y: -0.684, - z: 0.534, - w: -0.493, - }, - }, - Posef { - position: Vector3f { - x: -0.059, - y: 0.053, - z: -0.015, - }, - orientation: Quaternionf { - x: 0.002, - y: -0.745, - z: 0.444, - w: -0.498, - }, - }, - Posef { - position: Vector3f { - x: -0.068, - y: 0.059, - z: -0.013, - }, - orientation: Quaternionf { - x: 0.045, - y: -0.780, - z: 0.378, - w: -0.496, - }, - }, - ]; - return test_hand_pose; -} diff --git a/src/xr_input/hands/common.rs b/src/xr_input/hands/common.rs deleted file mode 100644 index 265e61c..0000000 --- a/src/xr_input/hands/common.rs +++ /dev/null @@ -1,258 +0,0 @@ -use bevy::{ - color::{palettes, Srgba}, - core::Name, - prelude::{ - default, Color, Commands, Component, Deref, DerefMut, Entity, Gizmos, Plugin, PostUpdate, - Query, Resource, SpatialBundle, Startup, Transform, - }, - transform::components::GlobalTransform, -}; - -use crate::xr_input::{trackers::OpenXRTracker, Hand}; - -use super::{BoneTrackingStatus, HandBone}; - -/// add debug renderer for controllers -// #[derive(Default)] -// pub struct OpenXrHandInput; -// -// impl Plugin for OpenXrHandInput { -// fn build(&self, app: &mut bevy::prelude::App) { -// app.add_systems(Startup, spawn_hand_entities); -// } -// } - -/// add debug renderer for controllers -#[derive(Default)] -pub struct HandInputDebugRenderer; - -impl Plugin for HandInputDebugRenderer { - fn build(&self, app: &mut bevy::prelude::App) { - app.add_systems(PostUpdate, draw_hand_entities); - } -} - -#[derive(Resource, Default, Clone, Copy)] -pub struct HandsResource { - pub left: HandResource, - pub right: HandResource, -} -#[derive(Clone, Copy)] -pub struct HandResource { - pub palm: Entity, - pub wrist: Entity, - pub thumb: ThumbResource, - pub index: IndexResource, - pub middle: MiddleResource, - pub ring: RingResource, - pub little: LittleResource, -} - -impl Default for HandResource { - fn default() -> Self { - Self { - palm: Entity::PLACEHOLDER, - wrist: Entity::PLACEHOLDER, - thumb: Default::default(), - index: Default::default(), - middle: Default::default(), - ring: Default::default(), - little: Default::default(), - } - } -} -#[derive(Clone, Copy)] -pub struct ThumbResource { - pub metacarpal: Entity, - pub proximal: Entity, - pub distal: Entity, - pub tip: Entity, -} - -impl Default for ThumbResource { - fn default() -> Self { - Self { - metacarpal: Entity::PLACEHOLDER, - proximal: Entity::PLACEHOLDER, - distal: Entity::PLACEHOLDER, - tip: Entity::PLACEHOLDER, - } - } -} -#[derive(Clone, Copy)] -pub struct IndexResource { - pub metacarpal: Entity, - pub proximal: Entity, - pub intermediate: Entity, - pub distal: Entity, - pub tip: Entity, -} - -impl Default for IndexResource { - fn default() -> Self { - Self { - metacarpal: Entity::PLACEHOLDER, - proximal: Entity::PLACEHOLDER, - intermediate: Entity::PLACEHOLDER, - distal: Entity::PLACEHOLDER, - tip: Entity::PLACEHOLDER, - } - } -} -#[derive(Clone, Copy)] -pub struct MiddleResource { - pub metacarpal: Entity, - pub proximal: Entity, - pub intermediate: Entity, - pub distal: Entity, - pub tip: Entity, -} -impl Default for MiddleResource { - fn default() -> Self { - Self { - metacarpal: Entity::PLACEHOLDER, - proximal: Entity::PLACEHOLDER, - intermediate: Entity::PLACEHOLDER, - distal: Entity::PLACEHOLDER, - tip: Entity::PLACEHOLDER, - } - } -} -#[derive(Clone, Copy)] -pub struct RingResource { - pub metacarpal: Entity, - pub proximal: Entity, - pub intermediate: Entity, - pub distal: Entity, - pub tip: Entity, -} -impl Default for RingResource { - fn default() -> Self { - Self { - metacarpal: Entity::PLACEHOLDER, - proximal: Entity::PLACEHOLDER, - intermediate: Entity::PLACEHOLDER, - distal: Entity::PLACEHOLDER, - tip: Entity::PLACEHOLDER, - } - } -} -#[derive(Clone, Copy)] -pub struct LittleResource { - pub metacarpal: Entity, - pub proximal: Entity, - pub intermediate: Entity, - pub distal: Entity, - pub tip: Entity, -} -impl Default for LittleResource { - fn default() -> Self { - Self { - metacarpal: Entity::PLACEHOLDER, - proximal: Entity::PLACEHOLDER, - intermediate: Entity::PLACEHOLDER, - distal: Entity::PLACEHOLDER, - tip: Entity::PLACEHOLDER, - } - } -} - -pub fn spawn_hand_entities(mut commands: Commands) { - let hands = [Hand::Left, Hand::Right]; - let bones = HandBone::get_all_bones(); - //hand resource - let mut hand_resource = HandsResource { ..default() }; - for hand in hands.iter() { - for bone in bones.iter() { - let boneid = commands - .spawn(( - Name::new(format!("{:?} {:?}", hand, bone)), - SpatialBundle::default(), - *bone, - OpenXRTracker, - *hand, - BoneTrackingStatus::Tracked, - HandBoneRadius(0.1), - )) - .id(); - let hand_res = match hand { - Hand::Left => &mut hand_resource.left, - Hand::Right => &mut hand_resource.right, - }; - match bone { - HandBone::Palm => hand_res.palm = boneid, - HandBone::Wrist => hand_res.wrist = boneid, - HandBone::ThumbMetacarpal => hand_res.thumb.metacarpal = boneid, - HandBone::ThumbProximal => hand_res.thumb.proximal = boneid, - HandBone::ThumbDistal => hand_res.thumb.distal = boneid, - HandBone::ThumbTip => hand_res.thumb.tip = boneid, - HandBone::IndexMetacarpal => hand_res.index.metacarpal = boneid, - HandBone::IndexProximal => hand_res.index.proximal = boneid, - HandBone::IndexIntermediate => hand_res.index.intermediate = boneid, - HandBone::IndexDistal => hand_res.index.distal = boneid, - HandBone::IndexTip => hand_res.index.tip = boneid, - HandBone::MiddleMetacarpal => hand_res.middle.metacarpal = boneid, - HandBone::MiddleProximal => hand_res.middle.proximal = boneid, - HandBone::MiddleIntermediate => hand_res.middle.intermediate = boneid, - HandBone::MiddleDistal => hand_res.middle.distal = boneid, - HandBone::MiddleTip => hand_res.middle.tip = boneid, - HandBone::RingMetacarpal => hand_res.ring.metacarpal = boneid, - HandBone::RingProximal => hand_res.ring.proximal = boneid, - HandBone::RingIntermediate => hand_res.ring.intermediate = boneid, - HandBone::RingDistal => hand_res.ring.distal = boneid, - HandBone::RingTip => hand_res.ring.tip = boneid, - HandBone::LittleMetacarpal => hand_res.little.metacarpal = boneid, - HandBone::LittleProximal => hand_res.little.proximal = boneid, - HandBone::LittleIntermediate => hand_res.little.intermediate = boneid, - HandBone::LittleDistal => hand_res.little.distal = boneid, - HandBone::LittleTip => hand_res.little.tip = boneid, - } - } - } - commands.insert_resource(hand_resource); -} - -#[derive(Debug, Component, DerefMut, Deref)] -pub struct HandBoneRadius(pub f32); - -pub fn draw_hand_entities( - mut gizmos: Gizmos, - query: Query<(&GlobalTransform, &HandBone, &HandBoneRadius)>, -) { - for (transform, hand_bone, hand_bone_radius) in query.iter() { - let (_, color) = get_bone_gizmo_style(hand_bone); - let (_, rotation, translation) = transform.to_scale_rotation_translation(); - gizmos.sphere(translation, rotation, hand_bone_radius.0, color); - } -} - -pub(crate) fn get_bone_gizmo_style(hand_bone: &HandBone) -> (f32, Srgba) { - match hand_bone { - HandBone::Palm => (0.01, palettes::css::WHITE), - HandBone::Wrist => (0.01, palettes::css::GRAY), - HandBone::ThumbMetacarpal => (0.01, palettes::css::RED), - HandBone::ThumbProximal => (0.008, palettes::css::RED), - HandBone::ThumbDistal => (0.006, palettes::css::RED), - HandBone::ThumbTip => (0.004, palettes::css::RED), - HandBone::IndexMetacarpal => (0.01, palettes::css::ORANGE), - HandBone::IndexProximal => (0.008, palettes::css::ORANGE), - HandBone::IndexIntermediate => (0.006, palettes::css::ORANGE), - HandBone::IndexDistal => (0.004, palettes::css::ORANGE), - HandBone::IndexTip => (0.002, palettes::css::ORANGE), - HandBone::MiddleMetacarpal => (0.01, palettes::css::YELLOW), - HandBone::MiddleProximal => (0.008, palettes::css::YELLOW), - HandBone::MiddleIntermediate => (0.006, palettes::css::YELLOW), - HandBone::MiddleDistal => (0.004, palettes::css::YELLOW), - HandBone::MiddleTip => (0.002, palettes::css::YELLOW), - HandBone::RingMetacarpal => (0.01, palettes::css::GREEN), - HandBone::RingProximal => (0.008, palettes::css::GREEN), - HandBone::RingIntermediate => (0.006, palettes::css::GREEN), - HandBone::RingDistal => (0.004, palettes::css::GREEN), - HandBone::RingTip => (0.002, palettes::css::GREEN), - HandBone::LittleMetacarpal => (0.01, palettes::css::BLUE), - HandBone::LittleProximal => (0.008, palettes::css::BLUE), - HandBone::LittleIntermediate => (0.006, palettes::css::BLUE), - HandBone::LittleDistal => (0.004, palettes::css::BLUE), - HandBone::LittleTip => (0.002, palettes::css::BLUE), - } -} diff --git a/src/xr_input/hands/emulated.rs b/src/xr_input/hands/emulated.rs deleted file mode 100644 index 9ebbc73..0000000 --- a/src/xr_input/hands/emulated.rs +++ /dev/null @@ -1,546 +0,0 @@ -use std::f32::consts::PI; - -use bevy::prelude::*; -use openxr::{ActionTy, HandJoint}; - -use super::common::{get_bone_gizmo_style, HandBoneRadius}; -use crate::{ - resources::{XrInstance, XrSession}, - xr_init::{xr_only, XrSetup}, - xr_input::{ - actions::{ - ActionHandednes, ActionType, SetupActionSet, SetupActionSets, XrActionSets, XrBinding, - }, - hand_poses::get_simulated_open_hand_transforms, - trackers::{OpenXRLeftController, OpenXRRightController, OpenXRTrackingRoot}, - Hand, - }, -}; - -use super::{BoneTrackingStatus, HandBone}; - -pub enum TouchValue { - None, - Touched(T), -} - -pub struct HandEmulationPlugin; - -impl Plugin for HandEmulationPlugin { - fn build(&self, app: &mut App) { - app.add_systems(Update, update_hand_skeleton_from_emulated.run_if(xr_only())); - app.add_systems(XrSetup, setup_hand_emulation_action_set); - } -} - -const HAND_ACTION_SET: &str = "hand_pose_approx"; - -fn setup_hand_emulation_action_set(mut action_sets: ResMut) { - let action_set = - action_sets.add_action_set(HAND_ACTION_SET, "Hand Pose Approximaiton".into(), 0); - action_set.new_action( - "thumb_touch", - "Thumb Touched".into(), - ActionType::Bool, - ActionHandednes::Double, - ); - action_set.new_action( - "thumb_x", - "Thumb X".into(), - ActionType::F32, - ActionHandednes::Double, - ); - action_set.new_action( - "thumb_y", - "Thumb Y".into(), - ActionType::F32, - ActionHandednes::Double, - ); - - action_set.new_action( - "index_touch", - "Index Finger Touched".into(), - ActionType::Bool, - ActionHandednes::Double, - ); - action_set.new_action( - "index_value", - "Index Finger Pull".into(), - ActionType::F32, - ActionHandednes::Double, - ); - - action_set.new_action( - "middle_value", - "Middle Finger Pull".into(), - ActionType::F32, - ActionHandednes::Double, - ); - action_set.new_action( - "ring_value", - "Ring Finger Pull".into(), - ActionType::F32, - ActionHandednes::Double, - ); - action_set.new_action( - "little_value", - "Little Finger Pull".into(), - ActionType::F32, - ActionHandednes::Double, - ); - - suggest_oculus_touch_profile(action_set); -} - -fn suggest_oculus_touch_profile(action_set: &mut SetupActionSet) { - action_set.suggest_binding( - "/interaction_profiles/oculus/touch_controller", - &[ - XrBinding::new("thumb_x", "/user/hand/left/input/thumbstick/x"), - XrBinding::new("thumb_x", "/user/hand/right/input/thumbstick/x"), - XrBinding::new("thumb_y", "/user/hand/left/input/thumbstick/y"), - XrBinding::new("thumb_y", "/user/hand/right/input/thumbstick/y"), - XrBinding::new("thumb_touch", "/user/hand/left/input/thumbstick/touch"), - XrBinding::new("thumb_touch", "/user/hand/right/input/thumbstick/touch"), - XrBinding::new("thumb_touch", "/user/hand/left/input/x/touch"), - XrBinding::new("thumb_touch", "/user/hand/left/input/y/touch"), - XrBinding::new("thumb_touch", "/user/hand/right/input/a/touch"), - XrBinding::new("thumb_touch", "/user/hand/right/input/b/touch"), - XrBinding::new("thumb_touch", "/user/hand/left/input/thumbrest/touch"), - XrBinding::new("thumb_touch", "/user/hand/right/input/thumbrest/touch"), - XrBinding::new("index_touch", "/user/hand/left/input/trigger/touch"), - XrBinding::new("index_value", "/user/hand/left/input/trigger/value"), - XrBinding::new("index_touch", "/user/hand/right/input/trigger/touch"), - XrBinding::new("index_value", "/user/hand/right/input/trigger/value"), - XrBinding::new("middle_value", "/user/hand/left/input/squeeze/value"), - XrBinding::new("middle_value", "/user/hand/right/input/squeeze/value"), - XrBinding::new("ring_value", "/user/hand/left/input/squeeze/value"), - XrBinding::new("ring_value", "/user/hand/right/input/squeeze/value"), - XrBinding::new("little_value", "/user/hand/left/input/squeeze/value"), - XrBinding::new("little_value", "/user/hand/right/input/squeeze/value"), - ], - ); -} - -#[allow(clippy::type_complexity)] -pub(crate) fn update_hand_skeleton_from_emulated( - session: Res, - instance: Res, - action_sets: Res, - left_controller_transform: Query<&Transform, With>, - right_controller_transform: Query<&Transform, With>, - mut bones: Query< - ( - &mut Transform, - &HandBone, - &Hand, - &BoneTrackingStatus, - &mut HandBoneRadius, - ), - ( - Without, - Without, - Without, - ), - >, -) { - //get the transforms outside the loop - let left = left_controller_transform.get_single(); - let right = right_controller_transform.get_single(); - let mut data: [[Transform; 26]; 2] = [[Transform::default(); 26]; 2]; - for (subaction_path, hand) in [ - ( - instance.string_to_path("/user/hand/left").unwrap(), - Hand::Left, - ), - ( - instance.string_to_path("/user/hand/right").unwrap(), - Hand::Right, - ), - ] { - let thumb_curl = match action_sets - .get_action_bool(HAND_ACTION_SET, "thumb_touch") - .unwrap() - .state(&session, subaction_path) - .unwrap() - .current_state - { - true => 1.0, - false => 0.0, - }; - let index_curl = action_sets - .get_action_f32(HAND_ACTION_SET, "index_value") - .unwrap() - .state(&session, subaction_path) - .unwrap() - .current_state; - let middle_curl = action_sets - .get_action_f32(HAND_ACTION_SET, "middle_value") - .unwrap() - .state(&session, subaction_path) - .unwrap() - .current_state; - let ring_curl = action_sets - .get_action_f32(HAND_ACTION_SET, "ring_value") - .unwrap() - .state(&session, subaction_path) - .unwrap() - .current_state; - let little_curl = action_sets - .get_action_f32(HAND_ACTION_SET, "little_value") - .unwrap() - .state(&session, subaction_path) - .unwrap() - .current_state; - match hand { - Hand::Left => match left { - Ok(hand_transform) => { - data[0] = update_hand_bones_emulated( - hand_transform, - hand, - thumb_curl, - index_curl, - middle_curl, - ring_curl, - little_curl, - ); - } - Err(_) => debug!("no left controller transform for hand bone emulation"), - }, - Hand::Right => match right { - Ok(hand_transform) => { - data[1] = update_hand_bones_emulated( - hand_transform, - hand, - thumb_curl, - index_curl, - middle_curl, - ring_curl, - little_curl, - ); - } - Err(_) => debug!("no right controller transform for hand bone emulation"), - }, - } - } - for (mut t, bone, hand, status, mut radius) in bones.iter_mut() { - match status { - BoneTrackingStatus::Emulated => {} - BoneTrackingStatus::Tracked => continue, - } - radius.0 = get_bone_gizmo_style(bone).0; - - *t = data[match hand { - Hand::Left => 0, - Hand::Right => 1, - }][bone.get_index_from_bone()]; - // *t = t.with_scale(trt.scale); - // *t = t.with_rotation(trt.rotation * t.rotation); - // *t = t.with_translation(trt.transform_point(t.translation)); - } -} -pub fn update_hand_bones_emulated( - controller_transform: &Transform, - hand: Hand, - thumb_curl: f32, - index_curl: f32, - middle_curl: f32, - ring_curl: f32, - little_curl: f32, -) -> [Transform; 26] { - let left_hand_rot = Quat::from_rotation_y(PI); - let hand_translation: Vec3 = controller_transform.translation; - - let controller_quat: Quat = match hand { - Hand::Left => controller_transform.rotation.mul_quat(left_hand_rot), - Hand::Right => controller_transform.rotation, - }; - - let splay_direction = match hand { - Hand::Left => -1.0, - Hand::Right => 1.0, - }; - //lets make a structure to hold our calculated transforms for now - let mut calc_transforms = [Transform::default(); 26]; - - //get palm quat - let y = Quat::from_rotation_y(-90.0 * PI / 180.0); - let x = Quat::from_rotation_x(-90.0 * PI / 180.0); - let palm_quat = controller_quat.mul_quat(y).mul_quat(x); - //get simulated bones - let hand_transform_array: [Transform; 26] = get_simulated_open_hand_transforms(hand); - //palm - let palm = hand_transform_array[HandJoint::PALM]; - calc_transforms[HandJoint::PALM] = Transform { - translation: hand_translation + palm.translation, - ..default() - }; - //wrist - let wrist = hand_transform_array[HandJoint::WRIST]; - calc_transforms[HandJoint::WRIST] = Transform { - translation: hand_translation + palm.translation + palm_quat.mul_vec3(wrist.translation), - ..default() - }; - - //thumb - let thumb_joints = [ - HandJoint::THUMB_METACARPAL, - HandJoint::THUMB_PROXIMAL, - HandJoint::THUMB_DISTAL, - HandJoint::THUMB_TIP, - ]; - let mut prior_start: Option = None; - let mut prior_quat: Option = None; - let mut prior_vector: Option = None; - let splay = Quat::from_rotation_y(splay_direction * 30.0 * PI / 180.0); - let huh = Quat::from_rotation_x(-35.0 * PI / 180.0); - let splay_quat = palm_quat.mul_quat(huh).mul_quat(splay); - for bone in thumb_joints.iter() { - match prior_start { - Some(start) => { - let curl_angle: f32 = get_bone_curl_angle(*bone, thumb_curl); - let tp_lrot = Quat::from_rotation_y(splay_direction * curl_angle * PI / 180.0); - let tp_quat = prior_quat.unwrap().mul_quat(tp_lrot); - let thumb_prox = hand_transform_array[*bone]; - let tp_start = start + prior_vector.unwrap(); - let tp_vector = tp_quat.mul_vec3(thumb_prox.translation); - prior_start = Some(tp_start); - prior_quat = Some(tp_quat); - prior_vector = Some(tp_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tp_start + tp_vector, - ..default() - }; - } - None => { - let thumb_meta = hand_transform_array[*bone]; - let tm_start = hand_translation - + palm_quat.mul_vec3(palm.translation) - + palm_quat.mul_vec3(wrist.translation); - let tm_vector = palm_quat.mul_vec3(thumb_meta.translation); - prior_start = Some(tm_start); - prior_quat = Some(splay_quat); - prior_vector = Some(tm_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tm_start + tm_vector, - ..default() - }; - } - } - } - - //index - let thumb_joints = [ - HandJoint::INDEX_METACARPAL, - HandJoint::INDEX_PROXIMAL, - HandJoint::INDEX_INTERMEDIATE, - HandJoint::INDEX_DISTAL, - HandJoint::INDEX_TIP, - ]; - let mut prior_start: Option = None; - let mut prior_quat: Option = None; - let mut prior_vector: Option = None; - let splay = Quat::from_rotation_y(splay_direction * 10.0 * PI / 180.0); - let splay_quat = palm_quat.mul_quat(splay); - for bone in thumb_joints.iter() { - match prior_start { - Some(start) => { - let curl_angle: f32 = get_bone_curl_angle(*bone, index_curl); - let tp_lrot = Quat::from_rotation_x(curl_angle * PI / 180.0); - let tp_quat = prior_quat.unwrap().mul_quat(tp_lrot); - let thumb_prox = hand_transform_array[*bone]; - let tp_start = start + prior_vector.unwrap(); - let tp_vector = tp_quat.mul_vec3(thumb_prox.translation); - prior_start = Some(tp_start); - prior_quat = Some(tp_quat); - prior_vector = Some(tp_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tp_start + tp_vector, - ..default() - }; - } - None => { - let thumb_meta = hand_transform_array[*bone]; - let tm_start = hand_translation - + palm_quat.mul_vec3(palm.translation) - + palm_quat.mul_vec3(wrist.translation); - let tm_vector = palm_quat.mul_vec3(thumb_meta.translation); - prior_start = Some(tm_start); - prior_quat = Some(splay_quat); - prior_vector = Some(tm_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tm_start + tm_vector, - ..default() - }; - } - } - } - - //middle - let thumb_joints = [ - HandJoint::MIDDLE_METACARPAL, - HandJoint::MIDDLE_PROXIMAL, - HandJoint::MIDDLE_INTERMEDIATE, - HandJoint::MIDDLE_DISTAL, - HandJoint::MIDDLE_TIP, - ]; - let mut prior_start: Option = None; - let mut prior_quat: Option = None; - let mut prior_vector: Option = None; - let splay = Quat::from_rotation_y(splay_direction * 0.0 * PI / 180.0); - let splay_quat = palm_quat.mul_quat(splay); - for bone in thumb_joints.iter() { - match prior_start { - Some(start) => { - let curl_angle: f32 = get_bone_curl_angle(*bone, middle_curl); - let tp_lrot = Quat::from_rotation_x(curl_angle * PI / 180.0); - let tp_quat = prior_quat.unwrap().mul_quat(tp_lrot); - let thumb_prox = hand_transform_array[*bone]; - let tp_start = start + prior_vector.unwrap(); - let tp_vector = tp_quat.mul_vec3(thumb_prox.translation); - prior_start = Some(tp_start); - prior_quat = Some(tp_quat); - prior_vector = Some(tp_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tp_start + tp_vector, - ..default() - }; - } - None => { - let thumb_meta = hand_transform_array[*bone]; - let tm_start = hand_translation - + palm_quat.mul_vec3(palm.translation) - + palm_quat.mul_vec3(wrist.translation); - let tm_vector = palm_quat.mul_vec3(thumb_meta.translation); - prior_start = Some(tm_start); - prior_quat = Some(splay_quat); - prior_vector = Some(tm_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tm_start + tm_vector, - ..default() - }; - } - } - } - //ring - let thumb_joints = [ - HandJoint::RING_METACARPAL, - HandJoint::RING_PROXIMAL, - HandJoint::RING_INTERMEDIATE, - HandJoint::RING_DISTAL, - HandJoint::RING_TIP, - ]; - let mut prior_start: Option = None; - let mut prior_quat: Option = None; - let mut prior_vector: Option = None; - let splay = Quat::from_rotation_y(splay_direction * -10.0 * PI / 180.0); - let splay_quat = palm_quat.mul_quat(splay); - for bone in thumb_joints.iter() { - match prior_start { - Some(start) => { - let curl_angle: f32 = get_bone_curl_angle(*bone, ring_curl); - let tp_lrot = Quat::from_rotation_x(curl_angle * PI / 180.0); - let tp_quat = prior_quat.unwrap().mul_quat(tp_lrot); - let thumb_prox = hand_transform_array[*bone]; - let tp_start = start + prior_vector.unwrap(); - let tp_vector = tp_quat.mul_vec3(thumb_prox.translation); - prior_start = Some(tp_start); - prior_quat = Some(tp_quat); - prior_vector = Some(tp_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tp_start + tp_vector, - ..default() - }; - } - None => { - let thumb_meta = hand_transform_array[*bone]; - let tm_start = hand_translation - + palm_quat.mul_vec3(palm.translation) - + palm_quat.mul_vec3(wrist.translation); - let tm_vector = palm_quat.mul_vec3(thumb_meta.translation); - prior_start = Some(tm_start); - prior_quat = Some(splay_quat); - prior_vector = Some(tm_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tm_start + tm_vector, - ..default() - }; - } - } - } - - //little - let thumb_joints = [ - HandJoint::LITTLE_METACARPAL, - HandJoint::LITTLE_PROXIMAL, - HandJoint::LITTLE_INTERMEDIATE, - HandJoint::LITTLE_DISTAL, - HandJoint::LITTLE_TIP, - ]; - let mut prior_start: Option = None; - let mut prior_quat: Option = None; - let mut prior_vector: Option = None; - let splay = Quat::from_rotation_y(splay_direction * -20.0 * PI / 180.0); - let splay_quat = palm_quat.mul_quat(splay); - for bone in thumb_joints.iter() { - match prior_start { - Some(start) => { - let curl_angle: f32 = get_bone_curl_angle(*bone, little_curl); - let tp_lrot = Quat::from_rotation_x(curl_angle * PI / 180.0); - let tp_quat = prior_quat.unwrap().mul_quat(tp_lrot); - let thumb_prox = hand_transform_array[*bone]; - let tp_start = start + prior_vector.unwrap(); - let tp_vector = tp_quat.mul_vec3(thumb_prox.translation); - prior_start = Some(tp_start); - prior_quat = Some(tp_quat); - prior_vector = Some(tp_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tp_start + tp_vector, - ..default() - }; - } - None => { - let thumb_meta = hand_transform_array[*bone]; - let tm_start = hand_translation - + palm_quat.mul_vec3(palm.translation) - + palm_quat.mul_vec3(wrist.translation); - let tm_vector = palm_quat.mul_vec3(thumb_meta.translation); - prior_start = Some(tm_start); - prior_quat = Some(splay_quat); - prior_vector = Some(tm_vector); - //store it - calc_transforms[*bone] = Transform { - translation: tm_start + tm_vector, - ..default() - }; - } - } - } - calc_transforms -} - -fn get_bone_curl_angle(bone: HandJoint, curl: f32) -> f32 { - let mul: f32 = match bone { - HandJoint::INDEX_PROXIMAL => 0.0, - HandJoint::MIDDLE_PROXIMAL => 0.0, - HandJoint::RING_PROXIMAL => 0.0, - HandJoint::LITTLE_PROXIMAL => 0.0, - HandJoint::THUMB_PROXIMAL => 0.0, - HandJoint::THUMB_TIP => 0.1, - HandJoint::THUMB_DISTAL => 0.1, - HandJoint::THUMB_METACARPAL => 0.1, - _ => 1.0, - }; - let curl_angle = -((mul * curl * 80.0) + 5.0); - #[allow(clippy::needless_return)] - return curl_angle; -} diff --git a/src/xr_input/hands/hand_tracking.rs b/src/xr_input/hands/hand_tracking.rs deleted file mode 100644 index 709115c..0000000 --- a/src/xr_input/hands/hand_tracking.rs +++ /dev/null @@ -1,212 +0,0 @@ -use bevy::prelude::*; -use openxr::{HandTracker, Result, SpaceLocationFlags}; - -use super::common::HandBoneRadius; -use crate::{ - input::XrInput, - resources::{XrFrameState, XrSession}, - xr_init::xr_only, - xr_input::{hands::HandBone, Hand, QuatConv, Vec3Conv}, -}; - -use super::BoneTrackingStatus; - -#[derive(Resource, PartialEq)] -pub enum DisableHandTracking { - OnlyLeft, - OnlyRight, - Both, -} -pub struct HandTrackingPlugin; - -#[derive(Resource)] -pub struct HandTrackingData { - left_hand: HandTracker, - right_hand: HandTracker, -} - -impl HandTrackingData { - pub fn new(session: &XrSession) -> Result { - let left = session.create_hand_tracker(openxr::HandEXT::LEFT)?; - let right = session.create_hand_tracker(openxr::HandEXT::RIGHT)?; - Ok(HandTrackingData { - left_hand: left, - right_hand: right, - }) - } - pub fn get_ref<'a>( - &'a self, - input: &'a XrInput, - frame_state: &'a XrFrameState, - ) -> HandTrackingRef<'a> { - HandTrackingRef { - tracking: self, - input, - frame_state, - } - } -} - -pub struct HandTrackingRef<'a> { - tracking: &'a HandTrackingData, - input: &'a XrInput, - frame_state: &'a XrFrameState, -} -#[derive(Debug)] -pub struct HandJoint { - pub position: Vec3, - pub position_valid: bool, - pub position_tracked: bool, - pub orientation: Quat, - pub orientation_valid: bool, - pub orientation_tracked: bool, - pub radius: f32, -} - -#[derive(Debug)] -pub struct HandJoints { - inner: [HandJoint; 26], -} -impl HandJoints { - pub fn inner(&self) -> &[HandJoint; 26] { - &self.inner - } -} - -impl HandJoints { - pub fn get_joint(&self, bone: HandBone) -> &HandJoint { - &self.inner[bone.get_index_from_bone()] - } -} - -impl<'a> HandTrackingRef<'a> { - pub fn get_poses(&self, side: Hand) -> Option { - self.input - .stage - .locate_hand_joints( - match side { - Hand::Left => &self.tracking.left_hand, - Hand::Right => &self.tracking.right_hand, - }, - self.frame_state.predicted_display_time, - ) - .unwrap() - .map(|joints| { - joints - .into_iter() - .map(|joint| HandJoint { - position: joint.pose.position.to_vec3(), - orientation: joint.pose.orientation.to_quat(), - position_valid: joint - .location_flags - .contains(SpaceLocationFlags::POSITION_VALID), - position_tracked: joint - .location_flags - .contains(SpaceLocationFlags::POSITION_TRACKED), - orientation_valid: joint - .location_flags - .contains(SpaceLocationFlags::ORIENTATION_VALID), - orientation_tracked: joint - .location_flags - .contains(SpaceLocationFlags::ORIENTATION_TRACKED), - radius: joint.radius, - }) - .collect::>() - .try_into() - .unwrap() - }) - .map(|joints| HandJoints { inner: joints }) - } -} - -impl Plugin for HandTrackingPlugin { - fn build(&self, app: &mut App) { - app.add_systems( - PreUpdate, - ( - update_hand_bones - .run_if(|dh: Option>| { - !dh.is_some_and(|v| *v == DisableHandTracking::Both) - }) - .run_if(xr_only()), - update_tracking_state_on_disable, - ), - ); - } -} - -fn update_tracking_state_on_disable( - mut is_off: Local, - disabled_tracking: Option>, - mut tracking_states: Query<&mut BoneTrackingStatus>, -) { - if !*is_off - && disabled_tracking - .as_ref() - .is_some_and(|t| **t == DisableHandTracking::Both) - { - tracking_states - .par_iter_mut() - .for_each(|mut state| *state = BoneTrackingStatus::Emulated); - } - *is_off = disabled_tracking - .as_ref() - .is_some_and(|t| **t == DisableHandTracking::Both); -} - -pub fn update_hand_bones( - disabled_tracking: Option>, - hand_tracking: Option>, - xr_input: Res, - xr_frame_state: Res, - mut bones: Query<( - &mut Transform, - &Hand, - &HandBone, - &mut HandBoneRadius, - &mut BoneTrackingStatus, - )>, -) { - let hand_ref = match hand_tracking.as_ref() { - Some(h) => h.get_ref(&xr_input, &xr_frame_state), - None => { - warn!("No Handtracking data!"); - return; - } - }; - let left_hand_data = hand_ref.get_poses(Hand::Left); - let right_hand_data = hand_ref.get_poses(Hand::Right); - // if left_hand_data.is_none() || right_hand_data.is_none() { - // error!("something is very wrong for hand_tracking!! doesn't have data for both hands!"); - // } - - bones - .par_iter_mut() - .for_each(|(mut transform, hand, bone, mut radius, mut status)| { - match (&hand, disabled_tracking.as_ref().map(|d| d.as_ref())) { - (Hand::Left, Some(DisableHandTracking::OnlyLeft)) => { - *status = BoneTrackingStatus::Emulated; - return; - } - (Hand::Right, Some(DisableHandTracking::OnlyRight)) => { - *status = BoneTrackingStatus::Emulated; - return; - } - _ => {} - } - let bone_data = match (hand, &left_hand_data, &right_hand_data) { - (Hand::Left, Some(data), _) => data.get_joint(*bone), - (Hand::Right, _, Some(data)) => data.get_joint(*bone), - (hand, left_data, right_data) => { - *status = BoneTrackingStatus::Emulated; - return; - } - }; - if *status == BoneTrackingStatus::Emulated { - *status = BoneTrackingStatus::Tracked; - } - radius.0 = bone_data.radius; - transform.translation = bone_data.position; - transform.rotation = bone_data.orientation; - }); -} diff --git a/src/xr_input/hands/mod.rs b/src/xr_input/hands/mod.rs deleted file mode 100644 index c36917f..0000000 --- a/src/xr_input/hands/mod.rs +++ /dev/null @@ -1,174 +0,0 @@ -use bevy::prelude::*; -use openxr::FormFactor; - -use crate::{ - resources::{XrInstance, XrSession}, - xr_init::{XrCleanup, XrPreSetup, XrSetup}, -}; - -use self::{ - common::{spawn_hand_entities, HandBoneRadius, HandsResource}, - hand_tracking::{DisableHandTracking, HandTrackingData}, -}; - -use super::{trackers::OpenXRTracker, Hand}; - -pub mod common; -pub mod emulated; -pub mod hand_tracking; - -pub struct HandPlugin; - -impl Plugin for HandPlugin { - fn build(&self, app: &mut App) { - app.add_systems(XrPreSetup, check_for_handtracking); - app.add_systems(XrSetup, spawn_hand_entities); - app.add_systems(XrCleanup, despawn_hand_entities); - } -} - -#[allow(clippy::type_complexity)] -fn despawn_hand_entities( - mut commands: Commands, - hand_entities: Query< - Entity, - ( - With, - With, - With, - ), - >, -) { - for e in &hand_entities { - commands.entity(e).despawn_recursive(); - } - commands.remove_resource::() -} - -fn check_for_handtracking( - mut commands: Commands, - instance: Res, - session: Res, -) { - let hands = instance.exts().ext_hand_tracking.is_some() - && instance - .supports_hand_tracking(instance.system(FormFactor::HEAD_MOUNTED_DISPLAY).unwrap()) - .is_ok_and(|v| v); - if hands { - info!("handtracking!"); - commands.insert_resource(HandTrackingData::new(&session).unwrap()); - } else { - commands.insert_resource(DisableHandTracking::Both); - } -} - -#[derive(Component, Debug, Clone, Copy, PartialEq)] -pub enum BoneTrackingStatus { - Emulated, - Tracked, -} - -#[derive(Component, Debug, Clone, Copy)] -pub enum HandBone { - Palm, - Wrist, - ThumbMetacarpal, - ThumbProximal, - ThumbDistal, - ThumbTip, - IndexMetacarpal, - IndexProximal, - IndexIntermediate, - IndexDistal, - IndexTip, - MiddleMetacarpal, - MiddleProximal, - MiddleIntermediate, - MiddleDistal, - MiddleTip, - RingMetacarpal, - RingProximal, - RingIntermediate, - RingDistal, - RingTip, - LittleMetacarpal, - LittleProximal, - LittleIntermediate, - LittleDistal, - LittleTip, -} -impl HandBone { - pub fn is_finger(&self) -> bool { - !matches!(self, HandBone::Wrist | HandBone::Palm) - } - pub fn is_metacarpal(&self) -> bool { - matches!( - self, - HandBone::ThumbMetacarpal - | HandBone::IndexMetacarpal - | HandBone::MiddleMetacarpal - | HandBone::RingMetacarpal - | HandBone::LittleMetacarpal - ) - } - pub const fn get_all_bones() -> [HandBone; 26] { - [ - HandBone::Palm, - HandBone::Wrist, - HandBone::ThumbMetacarpal, - HandBone::ThumbProximal, - HandBone::ThumbDistal, - HandBone::ThumbTip, - HandBone::IndexMetacarpal, - HandBone::IndexProximal, - HandBone::IndexIntermediate, - HandBone::IndexDistal, - HandBone::IndexTip, - HandBone::MiddleMetacarpal, - HandBone::MiddleProximal, - HandBone::MiddleIntermediate, - HandBone::MiddleDistal, - HandBone::MiddleTip, - HandBone::RingMetacarpal, - HandBone::RingProximal, - HandBone::RingIntermediate, - HandBone::RingDistal, - HandBone::RingTip, - HandBone::LittleMetacarpal, - HandBone::LittleProximal, - HandBone::LittleIntermediate, - HandBone::LittleDistal, - HandBone::LittleTip, - ] - } - pub fn get_index_from_bone(&self) -> usize { - match &self { - HandBone::Palm => 0, - HandBone::Wrist => 1, - HandBone::ThumbMetacarpal => 2, - HandBone::ThumbProximal => 3, - HandBone::ThumbDistal => 4, - HandBone::ThumbTip => 5, - HandBone::IndexMetacarpal => 6, - HandBone::IndexProximal => 7, - HandBone::IndexIntermediate => 8, - HandBone::IndexDistal => 9, - HandBone::IndexTip => 10, - HandBone::MiddleMetacarpal => 11, - HandBone::MiddleProximal => 12, - HandBone::MiddleIntermediate => 13, - HandBone::MiddleDistal => 14, - HandBone::MiddleTip => 15, - HandBone::RingMetacarpal => 16, - HandBone::RingProximal => 17, - HandBone::RingIntermediate => 18, - HandBone::RingDistal => 19, - HandBone::RingTip => 20, - HandBone::LittleMetacarpal => 21, - HandBone::LittleProximal => 22, - HandBone::LittleIntermediate => 23, - HandBone::LittleDistal => 24, - HandBone::LittleTip => 25, - } - } -} diff --git a/src/xr_input/interactions.rs b/src/xr_input/interactions.rs deleted file mode 100644 index 1e265af..0000000 --- a/src/xr_input/interactions.rs +++ /dev/null @@ -1,385 +0,0 @@ -use std::f32::consts::PI; - -use bevy::color::palettes; -use bevy::log::{info, warn}; -use bevy::prelude::{ - Color, Component, Entity, Event, EventReader, EventWriter, Gizmos, GlobalTransform, Quat, - Query, Transform, Vec3, With, Without, -}; - -use super::trackers::{AimPose, OpenXRTrackingRoot}; - -#[derive(Component)] -pub struct XRDirectInteractor; - -#[derive(Component)] -pub struct XRRayInteractor; - -#[derive(Component)] -pub struct XRSocketInteractor; - -#[derive(Component)] -pub struct Touched(pub bool); - -#[derive(Component, Clone, Copy, PartialEq, PartialOrd, Debug)] -pub enum XRInteractableState { - Idle, - Hover, - Select, -} - -impl Default for XRInteractableState { - fn default() -> Self { - XRInteractableState::Idle - } -} - -#[derive(Component)] -pub enum XRInteractorState { - Idle, - Selecting, -} -impl Default for XRInteractorState { - fn default() -> Self { - XRInteractorState::Idle - } -} -#[derive(Component)] -pub enum XRSelection { - Empty, - Full(Entity), -} -impl Default for XRSelection { - fn default() -> Self { - XRSelection::Empty - } -} - -#[derive(Component)] -pub struct XRInteractable; - -pub fn draw_socket_gizmos( - mut gizmos: Gizmos, - interactor_query: Query<( - &GlobalTransform, - &XRInteractorState, - Entity, - &XRSocketInteractor, - )>, -) { - for (global, state, _entity, _socket) in interactor_query.iter() { - let mut transform = global.compute_transform().clone(); - transform.scale = Vec3::splat(0.1); - let color = match state { - XRInteractorState::Idle => palettes::css::BLUE, - XRInteractorState::Selecting => palettes::css::PURPLE, - }; - gizmos.cuboid(transform, color) - } -} - -pub fn draw_interaction_gizmos( - mut gizmos: Gizmos, - interactable_query: Query< - (&GlobalTransform, &XRInteractableState), - (With, Without), - >, - interactor_query: Query< - ( - &GlobalTransform, - &XRInteractorState, - Option<&XRDirectInteractor>, - Option<&XRRayInteractor>, - Option<&AimPose>, - ), - Without, - >, - tracking_root_query: Query<&mut Transform, With>, -) { - let Ok(root) = tracking_root_query.get_single() else { - warn!("no or more than one tracking root"); - return; - }; - for (global_transform, interactable_state) in interactable_query.iter() { - let transform = global_transform.compute_transform(); - let color = match interactable_state { - XRInteractableState::Idle => palettes::css::RED, - XRInteractableState::Hover => palettes::css::YELLOW, - XRInteractableState::Select => palettes::css::GREEN, - }; - gizmos.sphere(transform.translation, transform.rotation, 0.1, color); - } - - for (interactor_global_transform, interactor_state, direct, ray, aim) in interactor_query.iter() - { - let transform = interactor_global_transform.compute_transform(); - match direct { - Some(_) => { - let mut local = transform.clone(); - local.scale = Vec3::splat(0.1); - let quat = Quat::from_euler( - bevy::prelude::EulerRot::XYZ, - 45.0 * (PI / 180.0), - 0.0, - 45.0 * (PI / 180.0), - ); - local.rotation = quat; - let color = match interactor_state { - XRInteractorState::Idle => palettes::css::BLUE, - XRInteractorState::Selecting => palettes::css::PURPLE, - }; - gizmos.cuboid(local, color); - } - None => (), - } - match ray { - Some(_) => match aim { - Some(aim) => { - let color = match interactor_state { - XRInteractorState::Idle => palettes::css::BLUE, - XRInteractorState::Selecting => palettes::css::PURPLE, - }; - gizmos.ray( - root.translation + root.rotation.mul_vec3(aim.0.translation), - root.rotation.mul_vec3(*aim.0.forward()), - color, - ); - } - None => todo!(), - }, - None => (), - } - } -} - -#[derive(Event)] -pub struct InteractionEvent { - pub interactor: Entity, - pub interactable: Entity, - pub interactable_state: XRInteractableState, -} - -pub fn socket_interactions( - interactable_query: Query< - (&GlobalTransform, &mut XRInteractableState, Entity), - (With, Without), - >, - interactor_query: Query< - ( - &GlobalTransform, - &XRInteractorState, - Entity, - &XRSocketInteractor, - ), - Without, - >, - mut writer: EventWriter, -) { - for interactable in interactable_query.iter() { - //for the interactables - for socket in interactor_query.iter() { - let interactor_global_transform = socket.0; - let xr_interactable_global_transform = interactable.0; - let interactor_state = socket.1; - //check for sphere overlaps - let size = 0.1; - if interactor_global_transform - .compute_transform() - .translation - .distance_squared( - xr_interactable_global_transform - .compute_transform() - .translation, - ) - < (size * size) * 2.0 - { - //check for selections first - match interactor_state { - XRInteractorState::Idle => { - let event = InteractionEvent { - interactor: socket.2, - interactable: interactable.2, - interactable_state: XRInteractableState::Hover, - }; - writer.send(event); - } - XRInteractorState::Selecting => { - let event = InteractionEvent { - interactor: socket.2, - interactable: interactable.2, - interactable_state: XRInteractableState::Select, - }; - writer.send(event); - } - } - } - } - } -} - -pub fn interactions( - interactable_query: Query< - (&GlobalTransform, Entity), - (With, Without), - >, - interactor_query: Query< - ( - &GlobalTransform, - &XRInteractorState, - Entity, - Option<&XRDirectInteractor>, - Option<&XRRayInteractor>, - Option<&AimPose>, - ), - Without, - >, - tracking_root_query: Query<&mut Transform, With>, - mut writer: EventWriter, -) { - for (xr_interactable_global_transform, interactable_entity) in interactable_query.iter() { - for (interactor_global_transform, interactor_state, interactor_entity, direct, ray, aim) in - interactor_query.iter() - { - match direct { - Some(_) => { - //check for sphere overlaps - let size = 0.1; - if interactor_global_transform - .compute_transform() - .translation - .distance_squared( - xr_interactable_global_transform - .compute_transform() - .translation, - ) - < (size * size) * 2.0 - { - //check for selections first - match interactor_state { - XRInteractorState::Idle => { - let event = InteractionEvent { - interactor: interactor_entity, - interactable: interactable_entity, - interactable_state: XRInteractableState::Hover, - }; - writer.send(event); - } - XRInteractorState::Selecting => { - let event = InteractionEvent { - interactor: interactor_entity, - interactable: interactable_entity, - interactable_state: XRInteractableState::Select, - }; - writer.send(event); - } - } - } - } - None => (), - } - match ray { - Some(_) => { - //check for ray-sphere intersection - let sphere_transform = xr_interactable_global_transform.compute_transform(); - let center = sphere_transform.translation; - let radius: f32 = 0.1; - //I hate this but the aim pose needs the root for now - let root = tracking_root_query.get_single().unwrap(); - match aim { - Some(aim) => { - let ray_origin = - root.translation + root.rotation.mul_vec3(aim.0.translation); - let ray_dir = root.rotation.mul_vec3(*aim.0.forward()); - - if ray_sphere_intersection( - center, - radius, - ray_origin, - ray_dir.normalize_or_zero(), - ) { - //check for selections first - match interactor_state { - XRInteractorState::Idle => { - let event = InteractionEvent { - interactor: interactor_entity, - interactable: interactable_entity, - interactable_state: XRInteractableState::Hover, - }; - writer.send(event); - } - XRInteractorState::Selecting => { - let event = InteractionEvent { - interactor: interactor_entity, - interactable: interactable_entity, - interactable_state: XRInteractableState::Select, - }; - writer.send(event); - } - } - } - } - None => info!("no aim pose"), - } - } - None => (), - } - } - } -} - -pub fn update_interactable_states( - mut events: EventReader, - mut interactable_query: Query< - (Entity, &mut XRInteractableState, &mut Touched), - With, - >, -) { - //i very much dislike this - for (_entity, _state, mut touched) in interactable_query.iter_mut() { - *touched = Touched(false); - } - for event in events.read() { - //lets change the state - match interactable_query.get_mut(event.interactable) { - Ok((_entity, mut entity_state, mut touched)) => { - //since we have an event we were touched this frame, i hate this name - *touched = Touched(true); - if event.interactable_state > *entity_state { - // info!( - // "event.state: {:?}, interactable.state: {:?}", - // event.interactable_state, entity_state - // ); - // info!("event has a higher state"); - } - *entity_state = event.interactable_state; - } - Err(_) => {} - } - } - //lets go through all the untouched interactables and set them to idle - for (_entity, mut state, touched) in interactable_query.iter_mut() { - if !touched.0 { - *state = XRInteractableState::Idle; - } - } -} - -fn ray_sphere_intersection(center: Vec3, radius: f32, ray_origin: Vec3, ray_dir: Vec3) -> bool { - let l = center - ray_origin; - let adj = l.dot(ray_dir); - let d2 = l.dot(l) - (adj * adj); - let radius2 = radius * radius; - if d2 > radius2 { - return false; - } - let thc = (radius2 - d2).sqrt(); - let t0 = adj - thc; - let t1 = adj + thc; - - if t0 < 0.0 && t1 < 0.0 { - return false; - } - - // let distance = if t0 < t1 { t0 } else { t1 }; - return true; -} diff --git a/src/xr_input/mod.rs b/src/xr_input/mod.rs deleted file mode 100644 index 998bea1..0000000 --- a/src/xr_input/mod.rs +++ /dev/null @@ -1,126 +0,0 @@ -pub mod actions; -pub mod controllers; -pub mod debug_gizmos; -pub mod hand_poses; -pub mod hands; -pub mod interactions; -pub mod oculus_touch; -pub mod prototype_locomotion; -pub mod trackers; -pub mod xr_camera; - -use crate::resources::{XrInstance, XrSession}; -use crate::xr_init::{xr_only, XrCleanup, XrPostSetup, XrPreSetup, XrSetup}; -use crate::xr_input::oculus_touch::setup_oculus_controller; -use crate::xr_input::xr_camera::{xr_camera_head_sync, Eye, XRProjection, XrCameraBundle}; -use crate::{locate_views, xr_wait_frame}; -use bevy::app::{App, PostUpdate, Startup}; -use bevy::ecs::entity::Entity; -use bevy::ecs::query::With; -use bevy::ecs::system::Query; -use bevy::hierarchy::DespawnRecursiveExt; -use bevy::log::{info, warn}; -use bevy::math::Vec2; -use bevy::prelude::{BuildChildren, Component, Deref, DerefMut, IntoSystemConfigs, Resource}; -use bevy::prelude::{Commands, Plugin, PreUpdate, Quat, Res, SpatialBundle, Update, Vec3}; -use bevy::render::camera::CameraProjectionPlugin; -use bevy::render::extract_component::ExtractComponentPlugin; -use bevy::render::view::{update_frusta, VisibilitySystems}; -use bevy::transform::TransformSystem; -use bevy::utils::HashMap; -use openxr::Binding; - -use self::actions::{setup_oxr_actions, XrActionsPlugin}; -use self::oculus_touch::{ - init_subaction_path, post_action_setup_oculus_controller, ActionSets, OculusController, -}; -use self::trackers::{ - adopt_open_xr_trackers, update_open_xr_controllers, OpenXRLeftEye, OpenXRRightEye, - OpenXRTrackingRoot, -}; -use self::xr_camera::{/* GlobalTransformExtract, TransformExtract, */ XrCamera}; - -#[derive(Copy, Clone)] -pub struct XrInputPlugin; -#[derive(Clone, Copy, Debug, Ord, PartialOrd, Eq, PartialEq, Component)] -pub enum Hand { - Left, - Right, -} - -impl Plugin for XrInputPlugin { - fn build(&self, app: &mut App) { - app.add_systems(XrPostSetup, post_action_setup_oculus_controller); - app.add_systems(XrSetup, setup_oculus_controller); - app.add_systems(XrCleanup, cleanup_oculus_controller); - //adopt any new trackers - app.add_systems(PreUpdate, adopt_open_xr_trackers.run_if(xr_only())); - // app.add_systems(PreUpdate, action_set_system.run_if(xr_only())); - //update controller trackers - app.add_systems(Update, update_open_xr_controllers.run_if(xr_only())); - app.add_systems(XrPreSetup, init_subaction_path); - app.add_systems(XrSetup, setup_xr_root); - app.add_systems(XrCleanup, cleanup_xr_root); - } -} - -fn cleanup_oculus_controller(mut commands: Commands) { - commands.remove_resource::(); -} - -fn cleanup_xr_root( - mut commands: Commands, - tracking_root_query: Query>, -) { - for e in &tracking_root_query { - commands.entity(e).despawn_recursive(); - } -} -fn setup_xr_root( - mut commands: Commands, - tracking_root_query: Query>, -) { - if tracking_root_query.get_single().is_err() { - info!("Creating XrTrackingRoot!"); - commands.spawn((SpatialBundle::default(), OpenXRTrackingRoot)); - } -} - -// pub fn action_set_system(action_sets: Res, session: Res) { -// let mut active_action_sets = vec![]; -// for i in &action_sets.0 { -// active_action_sets.push(openxr::ActiveActionSet::new(i)); -// } -// //info!("action sets: {:#?}", action_sets.0.len()); -// if let Err(err) = session.sync_actions(&active_action_sets) { -// warn!("{}", err); -// } -// } - -pub trait Vec2Conv { - fn to_vec2(&self) -> Vec2; -} - -impl Vec2Conv for openxr::Vector2f { - fn to_vec2(&self) -> Vec2 { - Vec2::new(self.x, self.y) - } -} -pub trait Vec3Conv { - fn to_vec3(&self) -> Vec3; -} - -impl Vec3Conv for openxr::Vector3f { - fn to_vec3(&self) -> Vec3 { - Vec3::new(self.x, self.y, self.z) - } -} -pub trait QuatConv { - fn to_quat(&self) -> Quat; -} - -impl QuatConv for openxr::Quaternionf { - fn to_quat(&self) -> Quat { - Quat::from_xyzw(self.x, self.y, self.z, self.w) - } -} diff --git a/src/xr_input/oculus_touch.rs b/src/xr_input/oculus_touch.rs deleted file mode 100644 index 27111c4..0000000 --- a/src/xr_input/oculus_touch.rs +++ /dev/null @@ -1,546 +0,0 @@ -use crate::input::XrInput; -use crate::resources::{XrInstance, XrSession}; -use crate::xr_input::controllers::Handed; -use crate::xr_input::Hand; -use bevy::prelude::{default, Commands, Res, ResMut, Resource}; -use openxr::{ - ActionSet, AnyGraphics, FrameState, Instance, Path, Posef, Session, Space, SpaceLocation, - SpaceVelocity, -}; - -use std::sync::OnceLock; - -use super::actions::{ActionHandednes, ActionType, SetupActionSets, XrActionSets, XrBinding}; - -pub fn post_action_setup_oculus_controller( - action_sets: Res, - mut controller: ResMut, - instance: Res, - session: Res, -) { - let s = Session::::clone(&session); - let left_path = instance.string_to_path("/user/hand/left").unwrap(); - let right_path = instance.string_to_path("/user/hand/right").unwrap(); - let grip_action = action_sets - .get_action_posef("oculus_input", "hand_pose") - .unwrap(); - let aim_action = action_sets - .get_action_posef("oculus_input", "pointer_pose") - .unwrap(); - controller.grip_space = Some(Handed { - left: grip_action - .create_space(s.clone(), left_path, Posef::IDENTITY) - .unwrap(), - right: grip_action - .create_space(s.clone(), right_path, Posef::IDENTITY) - .unwrap(), - }); - controller.aim_space = Some(Handed { - left: aim_action - .create_space(s.clone(), left_path, Posef::IDENTITY) - .unwrap(), - right: aim_action - .create_space(s.clone(), right_path, Posef::IDENTITY) - .unwrap(), - }) -} -pub fn setup_oculus_controller( - mut commands: Commands, - instance: Res, - action_sets: ResMut, -) { - let oculus_controller = OculusController::new(action_sets).unwrap(); - commands.insert_resource(oculus_controller); -} - -#[derive(Resource, Clone)] -pub struct ActionSets(pub Vec); - -pub struct OculusControllerRef<'a> { - oculus_controller: &'a OculusController, - action_sets: &'a XrActionSets, - session: &'a Session, - frame_state: &'a FrameState, - xr_input: &'a XrInput, -} - -pub static RIGHT_SUBACTION_PATH: OnceLock = OnceLock::new(); -pub static LEFT_SUBACTION_PATH: OnceLock = OnceLock::new(); - -pub fn init_subaction_path(instance: Res) { - let _ = LEFT_SUBACTION_PATH.set(instance.string_to_path("/user/hand/left").unwrap()); - let _ = RIGHT_SUBACTION_PATH.set(instance.string_to_path("/user/hand/right").unwrap()); -} - -pub fn subaction_path(hand: Hand) -> Path { - *match hand { - Hand::Left => LEFT_SUBACTION_PATH.get().unwrap(), - Hand::Right => RIGHT_SUBACTION_PATH.get().unwrap(), - } -} - -impl OculusControllerRef<'_> { - pub fn grip_space(&self, hand: Hand) -> (SpaceLocation, SpaceVelocity) { - let d = match hand { - Hand::Left => self - .oculus_controller - .grip_space - .as_ref() - .unwrap() - .left - .relate( - &self.xr_input.stage, - self.frame_state.predicted_display_time, - ), - Hand::Right => self - .oculus_controller - .grip_space - .as_ref() - .unwrap() - .right - .relate( - &self.xr_input.stage, - self.frame_state.predicted_display_time, - ), - }; - match d { - Ok(d) => d, - Err(_) => (SpaceLocation::default(), SpaceVelocity::default()), - } - } - pub fn aim_space(&self, hand: Hand) -> (SpaceLocation, SpaceVelocity) { - let d = match hand { - Hand::Left => self - .oculus_controller - .aim_space - .as_ref() - .unwrap() - .left - .relate( - &self.xr_input.stage, - self.frame_state.predicted_display_time, - ), - Hand::Right => self - .oculus_controller - .aim_space - .as_ref() - .unwrap() - .right - .relate( - &self.xr_input.stage, - self.frame_state.predicted_display_time, - ), - }; - match d { - Ok(d) => d, - Err(_) => (SpaceLocation::default(), SpaceVelocity::default()), - } - } - pub fn squeeze(&self, hand: Hand) -> f32 { - match &self - .action_sets - .get_action_f32("oculus_input", "squeeze") - .unwrap() - .state(&self.session, subaction_path(hand)) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn trigger(&self, hand: Hand) -> f32 { - match self - .action_sets - .get_action_f32("oculus_input", "trigger") - .unwrap() - .state(&self.session, subaction_path(hand)) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn trigger_touched(&self, hand: Hand) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "trigger_touched") - .unwrap() - .state(&self.session, subaction_path(hand)) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn x_button(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "x_button") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn x_button_touched(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "x_button_touch") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn y_button(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "y_button") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn y_button_touched(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "y_button_touch") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn menu_button(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "menu_button") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn a_button(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "a_button") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn a_button_touched(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "a_button_touch") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn b_button(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "b_button") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn b_button_touched(&self) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "b_button_touch") - .unwrap() - .state(&self.session, Path::NULL) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn thumbstick_touch(&self, hand: Hand) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "thumbstick_touch") - .unwrap() - .state(&self.session, subaction_path(hand)) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } - pub fn thumbstick(&self, hand: Hand) -> Thumbstick { - Thumbstick { - x: match self - .action_sets - .get_action_f32("oculus_input", "thumbstick_x") - .unwrap() - .state(&self.session, subaction_path(hand)) - .map(|v| v.current_state) - { - Ok(v) => v, - Err(_) => default(), - }, - y: match self - .action_sets - .get_action_f32("oculus_input", "thumbstick_y") - .unwrap() - .state(&self.session, subaction_path(hand)) - .map(|v| v.current_state) - { - Ok(v) => v, - Err(_) => default(), - }, - click: match self - .action_sets - .get_action_bool("oculus_input", "thumbstick_click") - .unwrap() - .state(&self.session, subaction_path(hand)) - .map(|v| v.current_state) - { - Ok(v) => v, - Err(_) => default(), - }, - } - } - pub fn thumbrest_touch(&self, hand: Hand) -> bool { - match self - .action_sets - .get_action_bool("oculus_input", "thumbrest_touch") - .unwrap() - .state(&self.session, subaction_path(hand)) - { - Ok(v) => v, - Err(_) => return default(), - } - .current_state - } -} - -#[derive(Copy, Clone, Debug)] -pub struct Thumbstick { - pub x: f32, - pub y: f32, - pub click: bool, -} - -impl OculusController { - pub fn get_ref<'a>( - &'a self, - session: &'a Session, - frame_state: &'a FrameState, - xr_input: &'a XrInput, - action_sets: &'a XrActionSets, - ) -> OculusControllerRef { - OculusControllerRef { - oculus_controller: self, - session, - frame_state, - xr_input, - action_sets, - } - } -} - -#[derive(Resource)] -pub struct OculusController { - pub grip_space: Option>, - pub aim_space: Option>, -} -impl OculusController { - pub fn new(mut action_sets: ResMut) -> eyre::Result { - let action_set = - action_sets.add_action_set("oculus_input", "Oculus Touch Controller Input".into(), 0); - action_set.new_action( - "hand_pose", - "Hand Pose".into(), - ActionType::PoseF, - ActionHandednes::Double, - ); - action_set.new_action( - "pointer_pose", - "Pointer Pose".into(), - ActionType::PoseF, - ActionHandednes::Double, - ); - action_set.new_action( - "squeeze", - "Grip Pull".into(), - ActionType::F32, - ActionHandednes::Double, - ); - action_set.new_action( - "trigger", - "Trigger Pull".into(), - ActionType::F32, - ActionHandednes::Double, - ); - action_set.new_action( - "trigger_touched", - "Trigger Touch".into(), - ActionType::Bool, - ActionHandednes::Double, - ); - action_set.new_action( - "haptic_feedback", - "Haptic Feedback".into(), - ActionType::Haptic, - ActionHandednes::Double, - ); - action_set.new_action( - "x_button", - "X Button".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "x_button_touch", - "X Button Touch".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "y_button", - "Y Button".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "y_button_touch", - "Y Button Touch".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "a_button", - "A Button".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "a_button_touch", - "A Button Touch".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "b_button", - "B Button".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "b_button_touch", - "B Button Touch".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "menu_button", - "Menu Button".into(), - ActionType::Bool, - ActionHandednes::Single, - ); - action_set.new_action( - "thumbstick_x", - "Thumbstick X".into(), - ActionType::F32, - ActionHandednes::Double, - ); - action_set.new_action( - "thumbstick_y", - "Thumbstick y".into(), - ActionType::F32, - ActionHandednes::Double, - ); - action_set.new_action( - "thumbstick_touch", - "Thumbstick Touch".into(), - ActionType::Bool, - ActionHandednes::Double, - ); - action_set.new_action( - "thumbstick_click", - "Thumbstick Click".into(), - ActionType::Bool, - ActionHandednes::Double, - ); - action_set.new_action( - "thumbrest_touch", - "Thumbrest Touch".into(), - ActionType::Bool, - ActionHandednes::Double, - ); - - let this = OculusController { - grip_space: None, - aim_space: None, - }; - action_set.suggest_binding( - "/interaction_profiles/oculus/touch_controller", - &[ - XrBinding::new("hand_pose", "/user/hand/left/input/grip/pose"), - XrBinding::new("hand_pose", "/user/hand/right/input/grip/pose"), - XrBinding::new("pointer_pose", "/user/hand/left/input/aim/pose"), - XrBinding::new("pointer_pose", "/user/hand/right/input/aim/pose"), - XrBinding::new("squeeze", "/user/hand/left/input/squeeze/value"), - XrBinding::new("squeeze", "/user/hand/right/input/squeeze/value"), - XrBinding::new("trigger", "/user/hand/left/input/trigger/value"), - XrBinding::new("trigger", "/user/hand/right/input/trigger/value"), - XrBinding::new("trigger_touched", "/user/hand/left/input/trigger/touch"), - XrBinding::new("trigger_touched", "/user/hand/right/input/trigger/touch"), - XrBinding::new("haptic_feedback", "/user/hand/left/output/haptic"), - XrBinding::new("haptic_feedback", "/user/hand/right/output/haptic"), - XrBinding::new("x_button", "/user/hand/left/input/x/click"), - XrBinding::new("x_button_touch", "/user/hand/left/input/x/touch"), - XrBinding::new("y_button", "/user/hand/left/input/y/click"), - XrBinding::new("y_button_touch", "/user/hand/left/input/y/touch"), - XrBinding::new("a_button", "/user/hand/right/input/a/click"), - XrBinding::new("a_button_touch", "/user/hand/right/input/a/touch"), - XrBinding::new("b_button", "/user/hand/right/input/b/click"), - XrBinding::new("b_button_touch", "/user/hand/right/input/b/touch"), - XrBinding::new("menu_button", "/user/hand/left/input/menu/click"), - XrBinding::new("thumbstick_x", "/user/hand/left/input/thumbstick/x"), - XrBinding::new("thumbstick_y", "/user/hand/left/input/thumbstick/y"), - XrBinding::new("thumbstick_x", "/user/hand/right/input/thumbstick/x"), - XrBinding::new("thumbstick_y", "/user/hand/right/input/thumbstick/y"), - XrBinding::new("thumbstick_click", "/user/hand/left/input/thumbstick/click"), - XrBinding::new( - "thumbstick_click", - "/user/hand/right/input/thumbstick/click", - ), - XrBinding::new("thumbstick_touch", "/user/hand/left/input/thumbstick/touch"), - XrBinding::new( - "thumbstick_touch", - "/user/hand/right/input/thumbstick/touch", - ), - XrBinding::new("thumbrest_touch", "/user/hand/left/input/thumbrest/touch"), - XrBinding::new("thumbrest_touch", "/user/hand/right/input/thumbrest/touch"), - ], - ); - Ok(this) - } -} diff --git a/src/xr_input/prototype_locomotion.rs b/src/xr_input/prototype_locomotion.rs deleted file mode 100644 index d70aacc..0000000 --- a/src/xr_input/prototype_locomotion.rs +++ /dev/null @@ -1,175 +0,0 @@ -use std::f32::consts::PI; - -use bevy::{ - color::palettes, - prelude::*, - time::{Time, Timer, TimerMode}, -}; - -use crate::{ - input::XrInput, - resources::{XrFrameState, XrInstance, XrSession, XrViews}, -}; - -use super::{ - actions::XrActionSets, oculus_touch::OculusController, trackers::OpenXRTrackingRoot, Hand, - QuatConv, Vec3Conv, -}; - -pub enum LocomotionType { - Head, - Hand, -} - -pub enum RotationType { - Smooth, - Snap, -} - -#[derive(Resource)] -pub struct RotationTimer { - pub timer: Timer, -} - -#[derive(Resource)] -pub struct PrototypeLocomotionConfig { - pub locomotion_type: LocomotionType, - pub locomotion_speed: f32, - pub rotation_type: RotationType, - pub snap_angle: f32, - pub smooth_rotation_speed: f32, - pub rotation_stick_deadzone: f32, - pub rotation_timer: RotationTimer, -} - -impl Default for PrototypeLocomotionConfig { - fn default() -> Self { - Self { - locomotion_type: LocomotionType::Head, - locomotion_speed: 1.0, - rotation_type: RotationType::Smooth, - snap_angle: 45.0 * (PI / 180.0), - smooth_rotation_speed: 0.5 * PI, - rotation_stick_deadzone: 0.2, - rotation_timer: RotationTimer { - timer: Timer::from_seconds(1.0, TimerMode::Once), - }, - } - } -} - -pub fn proto_locomotion( - time: Res