From a7e8f84841291a9086fa2bdad443ffea1639931f Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sat, 7 Jun 2025 02:28:49 +0200 Subject: [PATCH 01/17] refactor: let the bevy rewrite begin: mostly working model nodes Signed-off-by: Schmarni --- Cargo.lock | 5132 ++++++++++++++++++++++++++++++----- Cargo.toml | 49 +- src/core/client.rs | 4 +- src/main.rs | 155 +- src/nodes/drawable/mod.rs | 1 - src/nodes/drawable/model.rs | 753 +++-- src/nodes/items/camera.rs | 23 +- src/nodes/spatial/mod.rs | 69 + 8 files changed, 5250 insertions(+), 936 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c27716e..3b36cee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,19 +3,92 @@ version = 4 [[package]] -name = "addr2line" -version = "0.21.0" +name = "ab_glyph" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0" dependencies = [ - "gimli", + "ab_glyph_rasterizer", + "owned_ttf_parser", ] [[package]] -name = "adler" -version = "1.0.2" +name = "ab_glyph_rasterizer" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "accesskit" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "becf0eb5215b6ecb0a739c31c21bd83c4f326524c9b46b7e882d77559b60a529" +dependencies = [ + "enumn", + "serde", +] + +[[package]] +name = "accesskit_consumer" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0bf66a7bf0b7ea4fd7742d50b64782a88f99217cf246b3f93b4162528dde520" +dependencies = [ + "accesskit", + "hashbrown 0.15.3", + "immutable-chunkmap", +] + +[[package]] +name = "accesskit_macos" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e230718177753b4e4ad9e1d9f6cfc2f4921212d4c1c480b253f526babb258d" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown 0.15.3", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "accesskit_windows" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65178f3df98a51e4238e584fcb255cb1a4f9111820848eeddd37663be40a625f" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown 0.15.3", + "paste", + "static_assertions", + "windows 0.58.0", + "windows-core 0.58.0", +] + +[[package]] +name = "accesskit_winit" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34d941bb8c414caba6e206de669c7dc0dbeb305640ea890772ee422a40e6b89f" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_windows", + "raw-window-handle 0.6.2", + "winit", +] + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] [[package]] name = "adler2" @@ -23,6 +96,19 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.3", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -32,6 +118,28 @@ dependencies = [ "memchr", ] +[[package]] +name = "alsa" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43" +dependencies = [ + "alsa-sys", + "bitflags 2.9.1", + "cfg-if", + "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.6.0" @@ -39,18 +147,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", - "bitflags 2.6.0", + "bitflags 2.9.1", "cc", "cesu8", - "jni", + "jni 0.21.1", "jni-sys", "libc", "log", - "ndk", + "ndk 0.9.0", "ndk-context", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum 0.7.3", - "thiserror 1.0.63", + "thiserror 1.0.69", ] [[package]] @@ -61,9 +169,9 @@ checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" [[package]] name = "android_log-sys" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" +checksum = "84521a3cf562bc62942e294181d9eef17eb38ceb8c68677bc49f144e4c3d4f8d" [[package]] name = "android_logger" @@ -76,6 +184,15 @@ dependencies = [ "log", ] +[[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 = "angle" version = "0.5.0" @@ -89,9 +206,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -104,43 +221,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "once_cell_polyfill", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "appendlist" @@ -157,6 +275,33 @@ dependencies = [ "num-traits", ] +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + [[package]] name = "ascii-canvas" version = "3.0.0" @@ -167,10 +312,30 @@ dependencies = [ ] [[package]] -name = "async-broadcast" -version = "0.7.1" +name = "ash" +version = "0.38.0+1.3.281" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" +dependencies = [ + "libloading", +] + +[[package]] +name = "assert_type_match" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f548ad2c4031f2902e3edc1f29c29e835829437de49562d8eb5dc5584d3a1043" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ "event-listener", "event-listener-strategy", @@ -192,14 +357,15 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.13.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa" dependencies = [ "async-task", "concurrent-queue", "fastrand", "futures-lite", + "pin-project-lite", "slab", ] @@ -216,9 +382,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "1237c0ae75a0f3765f58910ff9cdd0a12eeb39ab2f4c7de23262f337f0aacbb3" dependencies = [ "async-lock", "cfg-if", @@ -227,7 +393,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix", + "rustix 1.0.7", "slab", "tracing", "windows-sys 0.59.0", @@ -246,9 +412,9 @@ dependencies = [ [[package]] name = "async-process" -version = "2.2.4" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374" +checksum = "cde3f4e40e6021d7acffc90095cbd6dc54cb593903d1de5832f435eb274b85dc" dependencies = [ "async-channel", "async-io", @@ -259,9 +425,8 @@ dependencies = [ "cfg-if", "event-listener", "futures-lite", - "rustix", + "rustix 1.0.7", "tracing", - "windows-sys 0.59.0", ] [[package]] @@ -272,14 +437,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "async-signal" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +checksum = "d7605a4e50d4b06df3898d5a70bf5fde51ed9059b0434b73105193bc27acce0d" dependencies = [ "async-io", "async-lock", @@ -287,7 +452,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix", + "rustix 1.0.7", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -295,9 +460,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -306,13 +471,13 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] @@ -320,16 +485,19 @@ name = "async-task" version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" +dependencies = [ + "portable-atomic", +] [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] @@ -337,18 +505,37 @@ name = "atomic-waker" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "atomic_float" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628d228f918ac3b82fe590352cc719d30664a0c13ca3a60266fe02c7132d480a" + +[[package]] +name = "atomicow" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52e8890bb9844440d0c412fa74b67fd2f14e85248b6e00708059b6da9e5f8bf" +dependencies = [ + "portable-atomic", + "portable-atomic-util", +] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.5" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", @@ -365,17 +552,17 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper 1.0.1", - "tower", + "sync_wrapper", + "tower 0.5.2", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", @@ -386,24 +573,24 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 0.1.2", + "sync_wrapper", "tower-layer", "tower-service", ] [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -424,13 +611,1118 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +[[package]] +name = "bevy" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8369c16b7c017437021341521f8b4a0d98e1c70113fb358c3258ae7d661d79" +dependencies = [ + "bevy_internal", +] + +[[package]] +name = "bevy_a11y" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3561712cf49074d89e9989bfc2e6c6add5d33288f689db9a0c333300d2d004" +dependencies = [ + "accesskit", + "bevy_app", + "bevy_derive", + "bevy_ecs", + "bevy_reflect", + "serde", +] + +[[package]] +name = "bevy_animation" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49796627726d0b9a722ad9a0127719e7c1868f474d6575ec0f411e8299c4d7bb" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_derive", + "bevy_ecs", + "bevy_log", + "bevy_math", + "bevy_mesh", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_time", + "bevy_transform", + "bevy_utils", + "blake3", + "derive_more", + "downcast-rs 2.0.1", + "either", + "petgraph 0.7.1", + "ron", + "serde", + "smallvec", + "thiserror 2.0.12", + "thread_local", + "tracing", + "uuid", +] + +[[package]] +name = "bevy_app" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4491cc4c718ae76b4c6883df58b94cc88b32dcd894ea8d5b603c7c7da72ca967" +dependencies = [ + "bevy_derive", + "bevy_ecs", + "bevy_platform", + "bevy_reflect", + "bevy_tasks", + "bevy_utils", + "cfg-if", + "console_error_panic_hook", + "ctrlc", + "downcast-rs 2.0.1", + "log", + "thiserror 2.0.12", + "variadics_please", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "bevy_asset" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56111d9b88d8649f331a667d9d72163fb26bd09518ca16476d238653823db1e" +dependencies = [ + "async-broadcast", + "async-fs", + "async-lock", + "atomicow", + "bevy_app", + "bevy_asset_macros", + "bevy_ecs", + "bevy_platform", + "bevy_reflect", + "bevy_tasks", + "bevy_utils", + "bevy_window", + "bitflags 2.9.1", + "blake3", + "crossbeam-channel", + "derive_more", + "disqualified", + "downcast-rs 2.0.1", + "either", + "futures-io", + "futures-lite", + "js-sys", + "parking_lot 0.12.4", + "ron", + "serde", + "stackfuture", + "thiserror 2.0.12", + "tracing", + "uuid", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "bevy_asset_macros" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4cca3e67c0ec760d8889d42293d987ce5da92eaf9c592bf5d503728a63b276d" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "bevy_audio" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b4f6f2a5c6c0e7c6825e791d2a061c76c2d6784f114c8f24382163fabbfaaa" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_derive", + "bevy_ecs", + "bevy_math", + "bevy_reflect", + "bevy_transform", + "cpal", + "rodio", + "tracing", +] + +[[package]] +name = "bevy_color" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c101cbe1e26b8d701eb77263b14346e2e0cbbd2a6e254b9b1aead814e5ca8d3" +dependencies = [ + "bevy_math", + "bevy_reflect", + "bytemuck", + "derive_more", + "encase", + "serde", + "thiserror 2.0.12", + "wgpu-types", +] + +[[package]] +name = "bevy_core_pipeline" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed46363cad80dc00f08254c3015232bd6f640738403961c6d63e7ecfc61625" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_derive", + "bevy_diagnostic", + "bevy_ecs", + "bevy_image", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_transform", + "bevy_utils", + "bevy_window", + "bitflags 2.9.1", + "bytemuck", + "nonmax", + "radsort", + "serde", + "smallvec", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "bevy_derive" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b837bf6c51806b10ebfa9edf1844ad80a3a0760d6c5fac4e90761df91a8901a" +dependencies = [ + "bevy_macro_utils", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "bevy_diagnostic" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48797366f312a8f31e237d08ce3ee70162591282d2bfe7c5ad8be196fb263e55" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_platform", + "bevy_tasks", + "bevy_time", + "bevy_utils", + "const-fnv1a-hash", + "log", + "serde", + "sysinfo", +] + +[[package]] +name = "bevy_ecs" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c2bf6521aae57a0ec3487c4bfb59e36c4a378e834b626a4bea6a885af2fdfe7" +dependencies = [ + "arrayvec", + "bevy_ecs_macros", + "bevy_platform", + "bevy_ptr", + "bevy_reflect", + "bevy_tasks", + "bevy_utils", + "bitflags 2.9.1", + "bumpalo", + "concurrent-queue", + "derive_more", + "disqualified", + "fixedbitset 0.5.7", + "indexmap 2.9.0", + "log", + "nonmax", + "serde", + "smallvec", + "thiserror 2.0.12", + "variadics_please", +] + +[[package]] +name = "bevy_ecs_macros" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38748d6f3339175c582d751f410fb60a93baf2286c3deb7efebb0878dce7f413" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "bevy_encase_derive" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8148f4edee470a2ea5cad010184c492a4c94c36d7a7158ea28e134ea87f274ab" +dependencies = [ + "bevy_macro_utils", + "encase_derive_impl", +] + +[[package]] +name = "bevy_gilrs" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97efef87c631949e67d06bb5d7dfd2a5f936b3b379afb6b1485b08edbb219b87" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_input", + "bevy_platform", + "bevy_time", + "bevy_utils", + "gilrs", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "bevy_gizmos" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7823154a9682128c261d8bddb3a4d7192a188490075c527af04520c2f0f8aad6" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_core_pipeline", + "bevy_ecs", + "bevy_gizmos_macros", + "bevy_image", + "bevy_math", + "bevy_pbr", + "bevy_reflect", + "bevy_render", + "bevy_sprite", + "bevy_time", + "bevy_transform", + "bevy_utils", + "bytemuck", + "tracing", +] + +[[package]] +name = "bevy_gizmos_macros" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f378f3b513218ddc78254bbe76536d9de59c1429ebd0c14f5d8f2a25812131ad" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "bevy_gltf" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a080237c0b8842ccc15a06d3379302c68580eeea4497b1c7387e470eda1f07" +dependencies = [ + "base64 0.22.1", + "bevy_animation", + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_core_pipeline", + "bevy_ecs", + "bevy_image", + "bevy_math", + "bevy_mesh", + "bevy_pbr", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_scene", + "bevy_tasks", + "bevy_transform", + "bevy_utils", + "fixedbitset 0.5.7", + "gltf", + "itertools 0.14.0", + "percent-encoding", + "serde", + "serde_json", + "smallvec", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "bevy_image" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65e6e900cfecadbc3149953169e36b9e26f922ed8b002d62339d8a9dc6129328" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_utils", + "bitflags 2.9.1", + "bytemuck", + "futures-lite", + "guillotiere", + "half 2.6.0", + "image", + "ktx2", + "rectangle-pack", + "ruzstd", + "serde", + "thiserror 2.0.12", + "tracing", + "wgpu-types", +] + +[[package]] +name = "bevy_input" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d6b6516433f6f7d680f648d04eb1866bb3927a1782d52f74831b62042f3cd1" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_utils", + "derive_more", + "log", + "serde", + "smol_str", + "thiserror 2.0.12", +] + +[[package]] +name = "bevy_input_focus" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e2d079fda74d1416e0a57dac29ea2b79ff77f420cd6b87f833d3aa29a46bc4d" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_input", + "bevy_math", + "bevy_reflect", + "bevy_window", + "log", + "thiserror 2.0.12", +] + +[[package]] +name = "bevy_internal" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "857da8785678fde537d02944cd20dec9cafb7d4c447efe15f898dc60e733cacd" +dependencies = [ + "bevy_a11y", + "bevy_animation", + "bevy_app", + "bevy_asset", + "bevy_audio", + "bevy_color", + "bevy_core_pipeline", + "bevy_derive", + "bevy_diagnostic", + "bevy_ecs", + "bevy_gilrs", + "bevy_gizmos", + "bevy_gltf", + "bevy_image", + "bevy_input", + "bevy_input_focus", + "bevy_log", + "bevy_math", + "bevy_pbr", + "bevy_picking", + "bevy_platform", + "bevy_ptr", + "bevy_reflect", + "bevy_remote", + "bevy_render", + "bevy_scene", + "bevy_sprite", + "bevy_state", + "bevy_tasks", + "bevy_text", + "bevy_time", + "bevy_transform", + "bevy_ui", + "bevy_utils", + "bevy_window", + "bevy_winit", +] + +[[package]] +name = "bevy_log" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a61ee8aef17a974f5ca481dcedf0c2bd52670e231d4c4bc9ddef58328865f9" +dependencies = [ + "android_log-sys", + "bevy_app", + "bevy_ecs", + "bevy_utils", + "tracing", + "tracing-log", + "tracing-oslog", + "tracing-subscriber", + "tracing-wasm", +] + +[[package]] +name = "bevy_macro_utils" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052eeebcb8e7e072beea5031b227d9a290f8a7fbbb947573ab6ec81df0fb94be" +dependencies = [ + "parking_lot 0.12.4", + "proc-macro2", + "quote", + "syn 2.0.101", + "toml_edit 0.22.27", +] + +[[package]] +name = "bevy_math" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68553e0090fe9c3ba066c65629f636bd58e4ebd9444fdba097b91af6cd3e243f" +dependencies = [ + "approx 0.5.1", + "bevy_reflect", + "derive_more", + "glam", + "itertools 0.14.0", + "libm", + "rand 0.8.5", + "rand_distr", + "serde", + "smallvec", + "thiserror 2.0.12", + "variadics_please", +] + +[[package]] +name = "bevy_mesh" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b10399c7027001edbc0406d7d0198596b1f07206c1aae715274106ba5bdcac40" +dependencies = [ + "bevy_asset", + "bevy_derive", + "bevy_ecs", + "bevy_image", + "bevy_math", + "bevy_mikktspace", + "bevy_platform", + "bevy_reflect", + "bevy_transform", + "bevy_utils", + "bitflags 2.9.1", + "bytemuck", + "hexasphere", + "serde", + "thiserror 2.0.12", + "tracing", + "wgpu-types", +] + +[[package]] +name = "bevy_mikktspace" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb60c753b968a2de0fd279b76a3d19517695e771edb4c23575c7f92156315de" +dependencies = [ + "glam", +] + +[[package]] +name = "bevy_mod_meshtext" +version = "0.1.0" +source = "git+https://github.com/Schmarni-Dev/bevy_mod_meshtext#b623971b5a4d0ee0a93a2f89096726b9b7c9c87a" +dependencies = [ + "atomicow", + "bevy", + "meshtext", +] + +[[package]] +name = "bevy_mod_openxr" +version = "0.3.0" +source = "git+https://github.com/Schmarni-Dev/bevy_openxr?branch=non_default_wait_frame_system#7a30bb2b523739501ba491956b96d9d6464ed8c5" +dependencies = [ + "android_system_properties", + "ash", + "bevy", + "bevy_mod_xr", + "jni 0.20.0", + "ndk-context", + "openxr", + "thiserror 2.0.12", + "wgpu", + "wgpu-hal", + "winapi", +] + +[[package]] +name = "bevy_mod_xr" +version = "0.3.0" +source = "git+https://github.com/Schmarni-Dev/bevy_openxr?branch=non_default_wait_frame_system#7a30bb2b523739501ba491956b96d9d6464ed8c5" +dependencies = [ + "bevy", +] + +[[package]] +name = "bevy_pbr" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5e0b4eb871f364a0d217f70f6c41d7fdc6f9f931fa1abbf222180c03d0ae410" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_core_pipeline", + "bevy_derive", + "bevy_diagnostic", + "bevy_ecs", + "bevy_image", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_transform", + "bevy_utils", + "bevy_window", + "bitflags 2.9.1", + "bytemuck", + "derive_more", + "fixedbitset 0.5.7", + "nonmax", + "offset-allocator", + "radsort", + "smallvec", + "static_assertions", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "bevy_picking" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed04757938655ed8094ea1efb533f99063a8b22abffc22010c694d291522850" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_derive", + "bevy_ecs", + "bevy_input", + "bevy_math", + "bevy_mesh", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_time", + "bevy_transform", + "bevy_utils", + "bevy_window", + "crossbeam-channel", + "tracing", + "uuid", +] + +[[package]] +name = "bevy_platform" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7573dc824a1b08b4c93fdbe421c53e1e8188e9ca1dd74a414455fe571facb47" +dependencies = [ + "cfg-if", + "critical-section", + "foldhash", + "getrandom 0.2.16", + "hashbrown 0.15.3", + "portable-atomic", + "portable-atomic-util", + "serde", + "spin", + "web-time", +] + +[[package]] +name = "bevy_ptr" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df7370d0e46b60e071917711d0860721f5347bc958bf325975ae6913a5dfcf01" + +[[package]] +name = "bevy_reflect" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daeb91a63a1a4df00aa58da8cc4ddbd4b9f16ab8bb647c5553eb156ce36fa8c2" +dependencies = [ + "assert_type_match", + "bevy_platform", + "bevy_ptr", + "bevy_reflect_derive", + "bevy_utils", + "derive_more", + "disqualified", + "downcast-rs 2.0.1", + "erased-serde", + "foldhash", + "glam", + "petgraph 0.7.1", + "serde", + "smallvec", + "smol_str", + "thiserror 2.0.12", + "uuid", + "variadics_please", + "wgpu-types", +] + +[[package]] +name = "bevy_reflect_derive" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ddadc55fe16b45faaa54ab2f9cb00548013c74812e8b018aa172387103cce6" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.101", + "uuid", +] + +[[package]] +name = "bevy_remote" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d073f6104c48d7c0468f682b3b2a00ee709001c3cf2778e0555afdb1305eb0" +dependencies = [ + "anyhow", + "async-channel", + "async-io", + "bevy_app", + "bevy_derive", + "bevy_ecs", + "bevy_platform", + "bevy_reflect", + "bevy_tasks", + "bevy_utils", + "http-body-util", + "hyper", + "serde", + "serde_json", + "smol-hyper", +] + +[[package]] +name = "bevy_render" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef91fed1f09405769214b99ebe4390d69c1af5cdd27967deae9135c550eb1667" +dependencies = [ + "async-channel", + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_derive", + "bevy_diagnostic", + "bevy_ecs", + "bevy_encase_derive", + "bevy_image", + "bevy_math", + "bevy_mesh", + "bevy_platform", + "bevy_reflect", + "bevy_render_macros", + "bevy_tasks", + "bevy_time", + "bevy_transform", + "bevy_utils", + "bevy_window", + "bitflags 2.9.1", + "bytemuck", + "codespan-reporting", + "derive_more", + "downcast-rs 2.0.1", + "encase", + "fixedbitset 0.5.7", + "futures-lite", + "image", + "indexmap 2.9.0", + "js-sys", + "ktx2", + "naga", + "naga_oil", + "nonmax", + "offset-allocator", + "send_wrapper", + "serde", + "smallvec", + "thiserror 2.0.12", + "tracing", + "variadics_please", + "wasm-bindgen", + "web-sys", + "wgpu", +] + +[[package]] +name = "bevy_render_macros" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abd42cf6c875bcf38da859f8e731e119a6aff190d41dd0a1b6000ad57cf2ed3d" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "bevy_scene" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c52ca165200995fe8afd2a1a6c03e4ffee49198a1d4653d32240ea7f217d4ab" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_derive", + "bevy_ecs", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_transform", + "bevy_utils", + "derive_more", + "serde", + "thiserror 2.0.12", + "uuid", +] + +[[package]] +name = "bevy_sk" +version = "0.1.0" +dependencies = [ + "bevy", + "bevy_mod_xr", + "bitflags 2.9.1", +] + +[[package]] +name = "bevy_sprite" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ccae7bab2cb956fb0434004c359e432a3a1a074a6ef4eb471f1fb099f0b620b" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_core_pipeline", + "bevy_derive", + "bevy_ecs", + "bevy_image", + "bevy_math", + "bevy_picking", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_transform", + "bevy_utils", + "bevy_window", + "bitflags 2.9.1", + "bytemuck", + "derive_more", + "fixedbitset 0.5.7", + "nonmax", + "radsort", + "tracing", +] + +[[package]] +name = "bevy_state" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "155d3cd97b900539008cdcaa702f88b724d94b08977b8e591a32536ce66faa8c" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_platform", + "bevy_reflect", + "bevy_state_macros", + "bevy_utils", + "log", + "variadics_please", +] + +[[package]] +name = "bevy_state_macros" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2481c1304fd2a1851a0d4cb63a1ce6421ae40f3f0117cbc9882963ee4c9bb609" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "bevy_tasks" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b674242641cab680688fc3b850243b351c1af49d4f3417a576debd6cca8dcf5" +dependencies = [ + "async-channel", + "async-executor", + "async-task", + "atomic-waker", + "bevy_platform", + "cfg-if", + "concurrent-queue", + "crossbeam-queue", + "derive_more", + "futures-channel", + "futures-lite", + "heapless", + "pin-project", + "wasm-bindgen-futures", +] + +[[package]] +name = "bevy_text" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d76c85366159f5f54110f33321c76d8429cfd8f39638f26793a305dae568b60" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_derive", + "bevy_ecs", + "bevy_image", + "bevy_log", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_sprite", + "bevy_transform", + "bevy_utils", + "bevy_window", + "cosmic-text", + "serde", + "smallvec", + "sys-locale", + "thiserror 2.0.12", + "tracing", + "unicode-bidi", +] + +[[package]] +name = "bevy_time" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc98eb356c75be04fbbc77bb3d8ffa24c8bacd99f76111cee23d444be6ac8c9c" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_platform", + "bevy_reflect", + "crossbeam-channel", + "log", + "serde", +] + +[[package]] +name = "bevy_transform" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df218e440bb9a19058e1b80a68a031c887bcf7bd3a145b55f361359a2fa3100d" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_log", + "bevy_math", + "bevy_reflect", + "bevy_tasks", + "bevy_utils", + "derive_more", + "serde", + "thiserror 2.0.12", +] + +[[package]] +name = "bevy_ui" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea4a4d2ba51865bc3039af29a26b4f52c48b54cc758369f52004caf4b6f03770" +dependencies = [ + "accesskit", + "bevy_a11y", + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_core_pipeline", + "bevy_derive", + "bevy_ecs", + "bevy_image", + "bevy_input", + "bevy_math", + "bevy_picking", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_sprite", + "bevy_text", + "bevy_transform", + "bevy_utils", + "bevy_window", + "bytemuck", + "derive_more", + "nonmax", + "serde", + "smallvec", + "taffy", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "bevy_utils" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f7a8905a125d2017e8561beefb7f2f5e67e93ff6324f072ad87c5fd6ec3b99" +dependencies = [ + "bevy_platform", + "thread_local", +] + +[[package]] +name = "bevy_window" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df7e8ad0c17c3cc23ff5566ae2905c255e6986037fb041f74c446216f5c38431" +dependencies = [ + "android-activity", + "bevy_app", + "bevy_ecs", + "bevy_input", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_utils", + "log", + "raw-window-handle 0.6.2", + "serde", + "smol_str", +] + +[[package]] +name = "bevy_winit" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a5e7f00c6b3b6823df5ec2a5e9067273607208919bc8c211773ebb9643c87f0" +dependencies = [ + "accesskit", + "accesskit_winit", + "approx 0.5.1", + "bevy_a11y", + "bevy_app", + "bevy_asset", + "bevy_derive", + "bevy_ecs", + "bevy_image", + "bevy_input", + "bevy_input_focus", + "bevy_log", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_tasks", + "bevy_utils", + "bevy_window", + "bytemuck", + "cfg-if", + "crossbeam-channel", + "raw-window-handle 0.6.2", + "serde", + "tracing", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "winit", +] + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", + "syn 2.0.101", +] + [[package]] name = "bit-set" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec 0.8.0", ] [[package]] @@ -439,6 +1731,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -447,9 +1745,49 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +dependencies = [ + "serde", +] + +[[package]] +name = "blake3" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +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-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] [[package]] name = "blocking" @@ -465,23 +1803,29 @@ dependencies = [ ] [[package]] -name = "bytemuck" -version = "1.17.1" +name = "bumpalo" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" + +[[package]] +name = "bytemuck" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.7.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" +checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] @@ -491,41 +1835,92 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "bytes" -version = "1.7.1" +name = "byteorder-lite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "calloop" -version = "0.14.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58a38167d6fba8c67cce63c4a91f2a73ca42cbdaf6fb9ba164f1e07b43ecc10" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "log", "polling", - "rustix", + "rustix 0.38.44", "slab", + "thiserror 1.0.69", +] + +[[package]] +name = "calloop" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10929724661d1c43856fd87c7a127ae944ec55579134fb485e4136fb6a46fdcb" +dependencies = [ + "bitflags 2.9.1", + "polling", + "rustix 0.38.44", + "slab", + "tracing", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +dependencies = [ + "calloop 0.13.0", + "rustix 0.38.44", + "wayland-backend", + "wayland-client", ] [[package]] name = "cc" -version = "1.1.16" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "jobserver", "libc", "shlex", ] +[[package]] +name = "cdt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91b872294f63ef586b32aa94141561681aa35ca2d703960cca4f661f4e18184" +dependencies = [ + "geometry-predicates", + "thiserror 1.0.69", +] + [[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" @@ -550,15 +1945,26 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317" dependencies = [ - "approx", + "approx 0.4.0", "num-traits", ] [[package]] -name = "clap" -version = "4.5.17" +name = "clang-sys" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f" dependencies = [ "clap_builder", "clap_derive", @@ -566,9 +1972,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51" dependencies = [ "anstream", "anstyle", @@ -578,21 +1984,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "cluFlock" @@ -606,18 +2012,28 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.51" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" dependencies = [ "cc", ] [[package]] -name = "color-eyre" -version = "0.6.3" +name = "codespan-reporting" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "color-eyre" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5920befb47832a6d61ee3a3a846565cfa39b331331e68a3b1d1116630f2f26d" dependencies = [ "backtrace", "color-spantrace", @@ -630,9 +2046,9 @@ dependencies = [ [[package]] name = "color-spantrace" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" +checksum = "b8b88ea9df13354b55bc7234ebcce36e6ef896aca2e42a15de9e10edce01b427" dependencies = [ "once_cell", "owo-colors", @@ -642,9 +2058,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "combine" @@ -663,13 +2079,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", + "portable-atomic", ] [[package]] name = "console-api" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ed14aa9c9f927213c6e4f3ef75faaad3406134efe84ba2cb7983431d5f0931" +checksum = "8030735ecb0d128428b64cd379809817e620a40e5001c54465b99ec5feec2857" dependencies = [ "futures-core", "prost", @@ -680,9 +2097,9 @@ dependencies = [ [[package]] name = "console-subscriber" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e3a111a37f3333946ebf9da370ba5c5577b18eb342ec683eb488dd21980302" +checksum = "6539aa9c6a4cd31f4b1c040f860a1eac9aa80e7df6b05d506a6e7179936d6a01" dependencies = [ "console-api", "crossbeam-channel", @@ -704,6 +2121,49 @@ dependencies = [ "tracing-subscriber", ] +[[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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2459fc9262a1aa204eb4b5764ad4f189caec88aea9634389c0a25f8be7f6265e" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[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 = "convert_case" version = "0.6.0" @@ -713,6 +2173,131 @@ dependencies = [ "unicode-segmentation", ] +[[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" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "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 0.9.4", + "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.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce857aa0b77d77287acc1ac3e37a05a8c95a2af3647d23b15f263bdaeb7562b" +dependencies = [ + "bindgen", +] + +[[package]] +name = "cosmic-text" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e418dd4f5128c3e93eab12246391c54a20c496811131f85754dc8152ee207892" +dependencies = [ + "bitflags 2.9.1", + "fontdb", + "log", + "rangemap", + "rustc-hash 1.1.0", + "rustybuzz", + "self_cell", + "smol_str", + "swash", + "sys-locale", + "ttf-parser 0.21.1", + "unicode-bidi", + "unicode-linebreak", + "unicode-script", + "unicode-segmentation", +] + +[[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 = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -723,25 +2308,60 @@ dependencies = [ ] [[package]] -name = "crossbeam-channel" -version = "0.5.13" +name = "critical-section" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctrlc" +version = "3.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f93780a459b7d656ef7f071fe699c4d3d2cb201c4b24d085b6ddc505276e73" +dependencies = [ + "nix 0.30.1", + "windows-sys 0.59.0", +] [[package]] name = "cty" @@ -751,9 +2371,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "cursor-icon" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" +checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" [[package]] name = "dashmap" @@ -766,7 +2386,50 @@ dependencies = [ "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.10", + "parking_lot_core 0.9.11", +] + +[[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.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", ] [[package]] @@ -820,6 +2483,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "disqualified" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9c272297e804878a2a4b707cfcfc6d2328b5bb936944613b4fdf2b9269afdfd" + [[package]] name = "dlib" version = "0.5.2" @@ -829,24 +2504,45 @@ dependencies = [ "libloading", ] +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + [[package]] name = "downcast-rs" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "downcast-rs" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea8a8b81cacc08888170eef4d13b775126db426d0b348bee9d18c2c1eaf123cf" + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" + [[package]] name = "drm" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80bc8c5c6c2941f70a55c15f8d9f00f9710ebda3ffda98075f996a0e6c92756f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "bytemuck", "drm-ffi", "drm-fourcc", "libc", - "rustix", + "rustix 0.38.44", ] [[package]] @@ -856,7 +2552,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8e41459d99a9b529845f6d2c909eb9adf3b6d2f82635ae40be8de0601726e8b" dependencies = [ "drm-sys", - "rustix", + "rustix 0.38.44", ] [[package]] @@ -877,9 +2573,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "ena" @@ -890,6 +2586,38 @@ dependencies = [ "log", ] +[[package]] +name = "encase" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0a05902cf601ed11d564128448097b98ebe3c6574bd7b6a653a3d56d54aa020" +dependencies = [ + "const_panic", + "encase_derive", + "glam", + "thiserror 1.0.69", +] + +[[package]] +name = "encase_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "181d475b694e2dd56ae919ce7699d344d1fd259292d590c723a50d1189a2ea85" +dependencies = [ + "encase_derive_impl", +] + +[[package]] +name = "encase_derive_impl" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f97b51c5cc57ef7c5f7a0c57c250251c49ee4c28f819f87ac32f4aceabc36792" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "endi" version = "1.1.0" @@ -898,9 +2626,9 @@ checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] name = "enumflags2" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", "serde", @@ -908,20 +2636,31 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", +] + +[[package]] +name = "enumn" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -929,25 +2668,44 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] [[package]] name = "errno" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "euclid" +version = "0.22.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" +dependencies = [ + "num-traits", ] [[package]] name = "event-listener" -version = "5.3.1" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -956,9 +2714,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ "event-listener", "pin-project-lite", @@ -976,9 +2734,18 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] [[package]] name = "fixedbitset" @@ -987,10 +2754,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] -name = "flatbuffers" -version = "24.3.25" +name = "fixedbitset" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8add37afff2d4ffa83bc748a70b4b1370984f6980768554182424ef71447c35f" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[package]] +name = "flatbuffers" +version = "24.12.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f1baf0dbf96932ec9a3038d57900329c015b0bfb7b63d904f3bc27e2b02a096" dependencies = [ "bitflags 1.3.2", "rustc_version", @@ -998,12 +2771,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.33" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1026,25 +2799,90 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "futures-channel" -version = "0.3.30" +name = "foldhash" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "font-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02a596f5713680923a2080d86de50fe472fb290693cf0f701187a1c8b36996b7" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "fontconfig-parser" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646" +dependencies = [ + "roxmltree", +] + +[[package]] +name = "fontdb" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2", + "slotmap", + "tinyvec", + "ttf-parser 0.20.0", +] + +[[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.101", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -1061,32 +2899,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-macro", @@ -1098,33 +2936,108 @@ dependencies = [ [[package]] name = "generator" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb949699c3e4df3a183b1d2142cb24277057055ed23c68ed58894f76c517223" +checksum = "d18470a76cb7f8ff746cf1f7470914f900252ec36bbc40b569d74b1258446827" dependencies = [ + "cc", "cfg-if", "libc", "log", "rustversion", - "windows", + "windows 0.61.1", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "geometry-predicates" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dba84198cf199c11b83f1cb9243eaeb70dc50b719d2835ebf34bf2481bca010" + +[[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.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", - "wasi", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gilrs" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb2c998745a3c1ac90f64f4f7b3a54219fd3612d7705e7798212935641ed18f" +dependencies = [ + "fnv", + "gilrs-core", + "log", + "uuid", + "vec_map", +] + +[[package]] +name = "gilrs-core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6d95ae10ce5aa99543a28cf74e41c11f3b9e3c14f0452bbde46024753cd683e" +dependencies = [ + "core-foundation 0.10.1", + "inotify", + "io-kit-sys", + "js-sys", + "libc", + "libudev-sys", + "log", + "nix 0.29.0", + "uuid", + "vec_map", + "wasm-bindgen", + "web-sys", + "windows 0.61.1", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gl_generator" @@ -1139,14 +3052,23 @@ dependencies = [ [[package]] name = "glam" -version = "0.29.0" +version = "0.29.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28091a37a5d09b555cb6628fd954da299b536433834f5b8e59eba78e0cbbf8a" +checksum = "8babf46d4c1c9d92deac9f7be466f76dfc4482b6452fc5024b5e8daf6ffeb3ee" dependencies = [ + "bytemuck", + "libm", "mint", + "rand 0.8.5", "serde", ] +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + [[package]] name = "global_counter" version = "0.2.2" @@ -1158,10 +3080,134 @@ dependencies = [ ] [[package]] -name = "h2" -version = "0.4.6" +name = "glow" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gltf" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ce1918195723ce6ac74e80542c5a96a40c2b26162c1957a5cd70799b8cacf7" +dependencies = [ + "byteorder", + "gltf-json", + "lazy_static", + "serde_json", +] + +[[package]] +name = "gltf-derive" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14070e711538afba5d6c807edb74bcb84e5dbb9211a3bf5dea0dfab5b24f4c51" +dependencies = [ + "inflections", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "gltf-json" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6176f9d60a7eab0a877e8e96548605dedbde9190a7ae1e80bbcc1c9af03ab14" +dependencies = [ + "gltf-derive", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.9.1", + "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.9.1", +] + +[[package]] +name = "gpu-allocator" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +dependencies = [ + "log", + "presser", + "thiserror 1.0.69", + "windows 0.58.0", +] + +[[package]] +name = "gpu-descriptor" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" +dependencies = [ + "bitflags 2.9.1", + "gpu-descriptor-types", + "hashbrown 0.15.3", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "grid" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36119f3a540b086b4e436bb2b588cf98a68863470e0e880f4d0842f112a3183a" + +[[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 = "h2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" dependencies = [ "atomic-waker", "bytes", @@ -1169,7 +3215,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.5.0", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", @@ -1182,6 +3228,25 @@ version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" +[[package]] +name = "half" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1194,6 +3259,17 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +dependencies = [ + "equivalent", + "foldhash", + "serde", +] + [[package]] name = "hdrhistogram" version = "7.5.4" @@ -1207,6 +3283,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32", + "portable-atomic", + "stable_deref_trait", +] + [[package]] name = "heck" version = "0.5.0" @@ -1215,15 +3302,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -1232,10 +3313,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "http" -version = "1.1.0" +name = "hexasphere" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "d9c9e718d32b6e6b2b32354e1b0367025efdd0b11d6a740b905ddf5db1074679" +dependencies = [ + "constgebra", + "glam", + "tinyvec", +] + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -1254,12 +3352,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -1267,9 +3365,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -1279,15 +3377,15 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "hyper" -version = "1.4.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", @@ -1306,9 +3404,9 @@ dependencies = [ [[package]] name = "hyper-timeout" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ "hyper", "hyper-util", @@ -1319,24 +3417,46 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" dependencies = [ "bytes", "futures-channel", + "futures-core", "futures-util", "http", "http-body", "hyper", + "libc", "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] +[[package]] +name = "image" +version = "0.25.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", +] + +[[package]] +name = "immutable-chunkmap" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f97096f508d54f8f8ab8957862eee2ccd628847b6217af1a335e1c44dee578" +dependencies = [ + "arrayvec", +] + [[package]] name = "indenter" version = "0.3.3" @@ -1355,12 +3475,39 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.3", + "serde", +] + +[[package]] +name = "inflections" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" + +[[package]] +name = "inotify" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" +dependencies = [ + "bitflags 2.9.1", + "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]] @@ -1379,10 +3526,14 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "2.0.3" +name = "io-kit-sys" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" +checksum = "617ee6cf8e3f66f3b4ea67a4058564628cde41901316e19f559e14c7c72c5e7b" +dependencies = [ + "core-foundation-sys", + "mach2", +] [[package]] name = "is_terminal_polyfill" @@ -1409,10 +3560,33 @@ dependencies = [ ] [[package]] -name = "itoa" -version = "1.0.11" +name = "itertools" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[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 1.0.69", + "walkdir", +] [[package]] name = "jni" @@ -1425,7 +3599,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror 1.0.63", + "thiserror 1.0.69", "walkdir", "windows-sys 0.45.0", ] @@ -1438,22 +3612,44 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.3", "libc", ] [[package]] -name = "kdl" -version = "4.6.0" +name = "js-sys" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062c875482ccb676fd40c804a40e3824d4464c18c364547456d1c8e8e951ae47" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "kdl" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e03e2e96c5926fe761088d66c8c2aee3a4352a2573f4eaca50043ad130af9117" dependencies = [ "miette", "nom", - "thiserror 1.0.63", + "thiserror 1.0.69", +] + +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading", + "pkg-config", ] [[package]] @@ -1462,6 +3658,15 @@ 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 = "lalrpop" version = "0.20.2" @@ -1469,14 +3674,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", - "bit-set", + "bit-set 0.5.3", "ena", "itertools 0.11.0", "lalrpop-util", - "petgraph", + "petgraph 0.6.5", "pico-args", "regex", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", "string_cache", "term", "tiny-keccak", @@ -1490,7 +3695,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.7", + "regex-automata 0.4.9", ] [[package]] @@ -1500,36 +3705,64 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] -name = "libc" -version = "0.2.158" +name = "lewton" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" +dependencies = [ + "byteorder", + "ogg", + "tinyvec", +] + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.53.0", ] +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + [[package]] name = "libredox" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "libc", + "redox_syscall 0.5.12", +] + +[[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.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" @@ -1538,10 +3771,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" [[package]] -name = "lock_api" -version = "0.4.12" +name = "linux-raw-sys" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[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.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -1549,39 +3794,39 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "logos" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1ceb190eb9bdeecdd8f1ad6a71d6d632a50905948771718741b5461fb01e13" +checksum = "7251356ef8cb7aec833ddf598c6cb24d17b689d20b993f9d11a3d764e34e6458" dependencies = [ "logos-derive", ] [[package]] name = "logos-codegen" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90be66cb7bd40cb5cc2e9cfaf2d1133b04a3d93b72344267715010a466e0915a" +checksum = "59f80069600c0d66734f5ff52cc42f2dabd6b29d205f333d61fd7832e9e9963f" dependencies = [ "beef", "fnv", "lazy_static", "proc-macro2", "quote", - "regex-syntax 0.8.4", - "syn 2.0.87", + "regex-syntax 0.8.5", + "syn 2.0.101", ] [[package]] name = "logos-derive" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45154231e8e96586b39494029e58f12f8ffcb5ecf80333a603a13aa205ea8cbd" +checksum = "24fb722b06a9dc12adb0963ed585f19fc61dc5413e6a9be9422ef92c091e731d" dependencies = [ "logos-codegen", ] @@ -1599,6 +3844,24 @@ dependencies = [ "tracing-subscriber", ] +[[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 = "manifest-dir-macros" version = "0.1.18" @@ -1608,7 +3871,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] @@ -1634,9 +3897,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] @@ -1650,6 +3913,33 @@ dependencies = [ "autocfg", ] +[[package]] +name = "meshtext" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c68541f06674ef4bb1f84e3dca654998135ff1a8bb5a60cfbfe5b8615f8e555" +dependencies = [ + "cdt", + "glam", + "owned_ttf_parser", + "ttf-parser 0.25.1", +] + +[[package]] +name = "metal" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f569fb946490b5743ad69813cb19629130ce9374034abe31614a36402d18f99e" +dependencies = [ + "bitflags 2.9.1", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + [[package]] name = "miette" version = "5.10.0" @@ -1658,7 +3948,7 @@ checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ "miette-derive", "once_cell", - "thiserror 1.0.63", + "thiserror 1.0.69", "unicode-width", ] @@ -1670,7 +3960,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] @@ -1687,20 +3977,12 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", + "simd-adler32", ] [[package]] @@ -1714,14 +3996,56 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ - "hermit-abi 0.3.9", "libc", - "wasi", - "windows-sys 0.52.0", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "naga" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e380993072e52eef724eddfcde0ed013b0c023c3f0417336ed041aa9f076994e" +dependencies = [ + "arrayvec", + "bit-set 0.8.0", + "bitflags 2.9.1", + "cfg_aliases 0.2.1", + "codespan-reporting", + "hexf-parse", + "indexmap 2.9.0", + "log", + "pp-rs", + "rustc-hash 1.1.0", + "spirv", + "strum", + "termcolor", + "thiserror 2.0.12", + "unicode-xid", +] + +[[package]] +name = "naga_oil" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2464f7395decfd16bb4c33fb0cb3b2c645cc60d051bc7fb652d3720bfb20f18" +dependencies = [ + "bit-set 0.5.3", + "codespan-reporting", + "data-encoding", + "indexmap 2.9.0", + "naga", + "once_cell", + "regex", + "regex-syntax 0.8.5", + "rustc-hash 1.1.0", + "thiserror 1.0.69", + "tracing", + "unicode-ident", ] [[package]] @@ -1730,7 +4054,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" dependencies = [ - "rand", + "rand 0.8.5", +] + +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.9.1", + "jni-sys", + "log", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.3", + "thiserror 1.0.69", ] [[package]] @@ -1739,15 +4077,15 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "jni-sys", "log", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum 0.7.3", "raw-window-handle 0.4.3", "raw-window-handle 0.5.2", "raw-window-handle 0.6.2", - "thiserror 1.0.63", + "thiserror 1.0.69", ] [[package]] @@ -1756,6 +4094,15 @@ 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" @@ -1777,7 +4124,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "cfg-if", "libc", "memoffset", @@ -1789,7 +4136,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "cfg-if", "cfg_aliases 0.1.1", "libc", @@ -1801,7 +4148,19 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", + "cfg-if", + "cfg_aliases 0.2.1", + "libc", +] + +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.9.1", "cfg-if", "cfg_aliases 0.2.1", "libc", @@ -1818,6 +4177,21 @@ dependencies = [ "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" @@ -1828,6 +4202,17 @@ dependencies = [ "winapi", ] +[[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.101", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1835,6 +4220,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1873,26 +4259,307 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[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.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.9.1", + "block2", + "libc", + "objc2", + "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.9.1", + "block2", + "objc2", + "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", + "objc2", + "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.9.1", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "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", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.9.1", + "block2", + "dispatch", + "libc", + "objc2", +] + +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "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.9.1", + "block2", + "objc2", + "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.9.1", + "block2", + "objc2", + "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", + "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.9.1", + "block2", + "objc2", + "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", + "objc2", + "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.9.1", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] name = "object" -version = "0.32.2" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] -name = "once_cell" -version = "1.19.0" +name = "oboe" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +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 = "offset-allocator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e234d535da3521eb95106f40f0b73483d80bfb3aacf27c40d7e2b72f1a3e00a2" +dependencies = [ + "log", + "nonmax", +] + +[[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.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "openxr" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2d6934d2508f94fd4cbda6c2a326f111f60ce59fd9136df6d478564397dd40" +dependencies = [ + "libc", + "libloading", + "ndk-context", + "openxr-sys", +] [[package]] name = "openxr-sys" @@ -1900,7 +4567,9 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f10e7e38c47f2175fc39363713b656db899fa0b4a14341029702cbdfa6f44d05" dependencies = [ + "cmake", "libc", + "mint", ] [[package]] @@ -1909,6 +4578,24 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "orbclient" +version = "0.3.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba0b26cec2e24f08ed8bb31519a9333140a6599b867dac464bb150bdb796fd43" +dependencies = [ + "libredox", +] + +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", +] + [[package]] name = "ordered-stream" version = "0.2.0" @@ -1926,16 +4613,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "owo-colors" -version = "3.5.0" +name = "owned_ttf_parser" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4" +dependencies = [ + "ttf-parser 0.25.1", +] + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -1950,12 +4646,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", + "parking_lot_core 0.9.11", ] [[package]] @@ -1974,17 +4670,23 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.12", "smallvec", "windows-targets 0.52.6", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1997,68 +4699,71 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ - "fixedbitset", - "indexmap 2.5.0", + "fixedbitset 0.4.2", + "indexmap 2.9.0", +] + +[[package]] +name = "petgraph" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" +dependencies = [ + "fixedbitset 0.5.7", + "indexmap 2.9.0", + "serde", + "serde_derive", ] [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", - "phf_shared 0.11.2", + "phf_shared", ] [[package]] name = "phf_codegen" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" dependencies = [ "phf_generator", - "phf_shared 0.11.2", + "phf_shared", ] [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared 0.11.2", - "rand", + "phf_shared", + "rand 0.8.5", ] [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", - "phf_shared 0.11.2", + "phf_shared", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", "unicase", ] [[package]] name = "phf_shared" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", "unicase", @@ -2072,29 +4777,29 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -2115,30 +4820,67 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] [[package]] name = "polling" -version = "3.7.3" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "b53a684391ad002dd6a596ceb6c74fd004fdce75f4be2e3f615068abbea5fd50" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.4.0", + "hermit-abi", "pin-project-lite", - "rustix", + "rustix 1.0.7", "tracing", "windows-sys 0.59.0", ] [[package]] -name = "ppv-lite86" -version = "0.2.20" +name = "portable-atomic" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + +[[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 = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ "zerocopy", ] @@ -2149,6 +4891,22 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + +[[package]] +name = "prettyplease" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dee91521343f4c5c6a63edd65e54f31f5c92fe8978c40a4282f8372194c6a7d" +dependencies = [ + "proc-macro2", + "syn 2.0.101", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2161,46 +4919,46 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ - "toml_edit 0.22.20", + "toml_edit 0.22.27", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "prost" -version = "0.13.2" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", "prost-derive", @@ -2208,44 +4966,56 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.2" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "prost-types" -version = "0.13.2" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60caa6738c7369b940c3d49246a8d1749323674c65cb13010134f5c9bad5b519" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ "prost", ] [[package]] name = "quick-xml" -version = "0.36.1" +version = "0.37.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "radsort" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "019b4b213425016d7d84a153c4c73afb0946fbb4840e4eece7ba8848b9d6da22" + [[package]] name = "rand" version = "0.8.5" @@ -2253,8 +5023,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", ] [[package]] @@ -2264,7 +5044,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -2273,9 +5063,40 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.16", ] +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "range-alloc" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" + +[[package]] +name = "rangemap" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" + [[package]] name = "raw-window-handle" version = "0.4.3" @@ -2297,6 +5118,22 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +[[package]] +name = "read-fonts" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04ca636dac446b5664bd16c069c00a9621806895b8bb02c2dc68542b23b8f25d" +dependencies = [ + "bytemuck", + "font-types", +] + +[[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.2.16" @@ -2308,11 +5145,20 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags 2.6.0", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags 2.9.1", ] [[package]] @@ -2321,21 +5167,21 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.16", "libredox", - "thiserror 1.0.63", + "thiserror 1.0.69", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] @@ -2349,13 +5195,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -2366,9 +5212,43 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "rodio" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ceb6607dd738c99bc8cb28eff249b7cd5c8ec88b9db96c0608c1480d140fb1" +dependencies = [ + "cpal", + "lewton", +] + +[[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.9.1", + "serde", + "serde_derive", +] + +[[package]] +name = "roxmltree" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rustc-demangle" @@ -2378,9 +5258,15 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc_version" @@ -2393,28 +5279,67 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "errno", "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", ] [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "rustybuzz" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" +dependencies = [ + "bitflags 2.9.1", + "bytemuck", + "libm", + "smallvec", + "ttf-parser 0.21.1", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-properties", + "unicode-script", +] + +[[package]] +name = "ruzstd" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640bec8aad418d7d03c72ea2de10d5c646a598f9883c7babc160d91e3c1b26c" +dependencies = [ + "twox-hash", +] [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -2438,10 +5363,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "semver" -version = "1.0.23" +name = "sctk-adwaita" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia", +] + +[[package]] +name = "self_cell" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f7d95a54511e0c7be3f51e8867aa8cf35148d7b9445d44de2f943e2b206e749" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "send_wrapper" @@ -2451,29 +5395,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.209" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -2483,24 +5427,35 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -2517,7 +5472,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7bea807e4f40f1a3df2717cc134562397b6a8f869f22568388fd5eb14bb1b69" dependencies = [ "angle", - "half", + "half 1.8.3", "num-traits", "serde", "serde_derive", @@ -2531,18 +5486,34 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] [[package]] -name = "siphasher" -version = "0.3.11" +name = "simd-adler32" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "skrifa" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbeb4ca4399663735553a09dd17ce7e49a0a0203f03b706b39628c4d913a8607" +dependencies = [ + "bytemuck", + "read-fonts", +] [[package]] name = "slab" @@ -2564,35 +5535,40 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +dependencies = [ + "serde", +] [[package]] name = "smithay" -version = "0.4.0" -source = "git+https://github.com/smithay/smithay.git#0c2230f858580b52d628087d6dae1795278b8756" +version = "0.6.0" +source = "git+https://github.com/smithay/smithay.git#776ba424423584400e76317e688b160546e68ca7" dependencies = [ "appendlist", - "bitflags 2.6.0", - "calloop", + "atomic_float", + "bitflags 2.9.1", + "calloop 0.14.2", "cgmath", "cursor-icon", - "downcast-rs", + "downcast-rs 1.2.1", "drm", "drm-ffi", "drm-fourcc", "errno", "gl_generator", - "indexmap 2.5.0", + "indexmap 2.9.0", "libc", "libloading", "profiling", - "rand", - "rustix", + "rand 0.9.1", + "rustix 1.0.7", + "sha2", "smallvec", "tempfile", - "thiserror 1.0.63", + "thiserror 2.0.12", "tracing", "wayland-protocols", "wayland-protocols-misc", @@ -2602,21 +5578,98 @@ dependencies = [ ] [[package]] -name = "socket2" -version = "0.5.7" +name = "smithay-client-toolkit" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +dependencies = [ + "bitflags 2.9.1", + "calloop 0.13.0", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2", + "rustix 0.38.44", + "thiserror 1.0.69", + "wayland-backend", + "wayland-client", + "wayland-csd-frame", + "wayland-cursor", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smol-hyper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7428a49d323867702cd12b97b08a6b0104f39ec13b49117911f101271321bc1a" +dependencies = [ + "async-executor", + "async-io", + "futures-io", + "hyper", + "pin-project-lite", +] + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "portable-atomic", +] + +[[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.9.1", +] + [[package]] name = "split-iter" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f2b15926089e5526bb2dd738a2eb0e59034356e06eb71e1cd912358c0e62c4d" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stackfuture" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eae92052b72ef70dafa16eddbabffc77e5ca3574be2f7bc1127b36f0a7ad7f2" + [[package]] name = "stardust-xr" version = "0.45.0" @@ -2628,12 +5681,12 @@ dependencies = [ "global_counter", "mint", "nix 0.27.1", - "parking_lot 0.12.3", - "rustc-hash", + "parking_lot 0.12.4", + "rustc-hash 2.1.1", "serde", "shiva-color-rs", "stardust-xr-schemas", - "thiserror 1.0.63", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -2652,7 +5705,7 @@ dependencies = [ "nanoid", "serde", "serde_repr", - "thiserror 1.0.63", + "thiserror 1.0.69", "tokio", "zbus", ] @@ -2661,6 +5714,11 @@ dependencies = [ name = "stardust-xr-server" version = "0.45.0" dependencies = [ + "bevy", + "bevy_mod_meshtext", + "bevy_mod_openxr", + "bevy_mod_xr", + "bevy_sk", "clap", "color-eyre", "console-subscriber", @@ -2672,9 +5730,10 @@ dependencies = [ "lazy_static", "mint", "nanoid", - "parking_lot 0.12.3", - "rand", - "rustc-hash", + "openxr", + "parking_lot 0.12.4", + "rand 0.8.5", + "rustc-hash 2.1.1", "send_wrapper", "serde", "serde_repr", @@ -2683,7 +5742,7 @@ dependencies = [ "stardust-xr", "stardust-xr-server-codegen", "stereokit-rust", - "thiserror 2.0.9", + "thiserror 2.0.12", "tokio", "toml", "tracing", @@ -2725,29 +5784,34 @@ source = "git+https://github.com/mvvvv/StereoKit-rust.git?rev=73ffaae6f42aa369e5 dependencies = [ "android-activity", "android_logger", - "bitflags 2.6.0", + "bitflags 2.9.1", "cmake", "glam", - "jni", + "jni 0.21.1", "log", - "ndk", + "ndk 0.9.0", "ndk-context", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "openxr-sys", "stereokit-macros", - "thiserror 2.0.9", + "thiserror 2.0.12", ] [[package]] -name = "string_cache" -version = "0.8.7" +name = "strict-num" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" + +[[package]] +name = "string_cache" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" dependencies = [ "new_debug_unreachable", - "once_cell", - "parking_lot 0.12.3", - "phf_shared 0.10.0", + "parking_lot 0.12.4", + "phf_shared", "precomputed-hash", ] @@ -2762,6 +5826,9 @@ name = "strum" version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] [[package]] name = "strum_macros" @@ -2773,7 +5840,24 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.87", + "syn 2.0.101", +] + +[[package]] +name = "svg_fmt" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb" + +[[package]] +name = "swash" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f745de914febc7c9ab4388dfaf94bbc87e69f57bb41133a9b0c84d4be49856f3" +dependencies = [ + "skrifa", + "yazi", + "zeno", ] [[package]] @@ -2789,9 +5873,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -2800,26 +5884,54 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" [[package]] -name = "sync_wrapper" -version = "1.0.1" +name = "sys-locale" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.34.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b93974b3d3aeaa036504b8eefd4c039dced109171c1ae973f1dc63b2c7e4b2" +dependencies = [ + "libc", + "memchr", + "ntapi", + "objc2-core-foundation", + "windows 0.57.0", +] + +[[package]] +name = "taffy" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab4f4d046dd956a47a7e1a2947083d7ac3e6aa3cfaaead36173ceaa5ab11878c" +dependencies = [ + "arrayvec", + "grid", + "serde", + "slotmap", +] [[package]] name = "tempfile" -version = "3.12.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", + "getrandom 0.3.3", "once_cell", - "rustix", + "rustix 1.0.7", "windows-sys 0.59.0", ] @@ -2835,43 +5947,52 @@ dependencies = [ ] [[package]] -name = "thiserror" -version = "1.0.63" +name = "termcolor" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ - "thiserror-impl 1.0.63", + "winapi-util", ] [[package]] name = "thiserror" -version = "2.0.9" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 2.0.9", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "thiserror-impl" -version = "2.0.9" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] @@ -2894,16 +6015,56 @@ dependencies = [ ] [[package]] -name = "tokio" -version = "1.40.0" +name = "tiny-skia" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +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 = "tokio" +version = "1.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", "libc", "mio", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project-lite", "signal-hook-registry", "socket2", @@ -2914,20 +6075,20 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -2936,9 +6097,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", @@ -2949,21 +6110,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.20", + "toml_edit 0.22.27", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] @@ -2974,29 +6135,36 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.9.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "toml_write", + "winnow 0.7.10", ] [[package]] -name = "tonic" -version = "0.12.2" +name = "toml_write" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", @@ -3016,7 +6184,7 @@ dependencies = [ "socket2", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -3033,7 +6201,7 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand", + "rand 0.8.5", "slab", "tokio", "tokio-util", @@ -3042,6 +6210,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -3056,10 +6238,11 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3067,20 +6250,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -3088,9 +6271,9 @@ dependencies = [ [[package]] name = "tracing-error" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" dependencies = [ "tracing", "tracing-subscriber", @@ -3108,10 +6291,25 @@ dependencies = [ ] [[package]] -name = "tracing-subscriber" -version = "0.3.18" +name = "tracing-oslog" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "528bdd1f0e27b5dd9a4ededf154e824b0532731e4af73bb531de46276e0aab1e" +dependencies = [ + "bindgen", + "cc", + "cfg-if", + "once_cell", + "parking_lot 0.12.4", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -3127,9 +6325,9 @@ dependencies = [ [[package]] name = "tracing-tracy" -version = "0.11.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a90519f16f55e5c62ffd5976349f10744435a919ecff83d918300575dfb69b" +checksum = "0eaa1852afa96e0fe9e44caa53dc0bd2d9d05e0f2611ce09f97f8677af56e4ba" dependencies = [ "tracing-core", "tracing-subscriber", @@ -3137,10 +6335,21 @@ dependencies = [ ] [[package]] -name = "tracy-client" -version = "0.17.3" +name = "tracing-wasm" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373db47331c3407b343538df77eea2516884a0b126cdfb4b135acfd400015dd7" +checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" +dependencies = [ + "tracing", + "tracing-subscriber", + "wasm-bindgen", +] + +[[package]] +name = "tracy-client" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3927832d93178f979a970d26deed7b03510586e328f31b0f9ad7a73985b8332a" dependencies = [ "loom", "once_cell", @@ -3149,11 +6358,12 @@ dependencies = [ [[package]] name = "tracy-client-sys" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49cf0064dcb31c99aa1244c1b93439359e53f72ed217eef5db50abd442241e9a" +checksum = "c032d68a49d25d9012a864fef1c64ac17aee43c87e0477bf7301d8ae8bfea7b7" dependencies = [ "cc", + "windows-targets 0.52.6", ] [[package]] @@ -3162,6 +6372,42 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ttf-parser" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" + +[[package]] +name = "ttf-parser" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "twox-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7b17f197b3050ba473acf9181f7b1d3b66d1cf7356c6cc57886662276e65908" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + [[package]] name = "uds_windows" version = "1.1.0" @@ -3175,36 +6421,69 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-bidi-mirroring" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" + +[[package]] +name = "unicode-ccc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[package]] +name = "unicode-script" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb421b350c9aff471779e262955939f565ec18b86c15364e6bdf0d662ca7c1f" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "utf8parse" @@ -3213,10 +6492,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] -name = "valuable" -version = "0.1.0" +name = "uuid" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "variadics_please" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b6d82be61465f97d42bd1d15bf20f3b0a3a0905018f38f9d6f6962055b0b5c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" @@ -3250,38 +6558,153 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wayland-backend" -version = "0.3.7" +name = "wasi" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wayland-backend" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe770181423e5fc79d3e2a7f4410b7799d5aab1de4372853de3c6aa13ca24121" dependencies = [ "cc", - "downcast-rs", - "rustix", + "downcast-rs 1.2.1", + "rustix 0.38.44", "scoped-tls", "smallvec", "wayland-sys", ] [[package]] -name = "wayland-protocols" -version = "0.32.5" +name = "wayland-client" +version = "0.31.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" +checksum = "978fa7c67b0847dbd6a9f350ca2569174974cd4082737054dbb7fbb79d7d9a61" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", + "rustix 0.38.44", "wayland-backend", "wayland-scanner", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.9.1", + "cursor-icon", + "wayland-backend", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65317158dec28d00416cb16705934070aef4f8393353d41126c54264ae0f182" +dependencies = [ + "rustix 0.38.44", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "779075454e1e9a521794fed15886323ea0feda3f8b0fc1390f5398141310422a" +dependencies = [ + "bitflags 2.9.1", + "wayland-backend", + "wayland-client", + "wayland-scanner", "wayland-server", ] [[package]] name = "wayland-protocols-misc" -version = "0.3.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40dd9d2f7f2713724d84b920d6f73ff878f6a353712942f75f78f4dadb72886" +checksum = "635cf2968bd88599445b25a2eeef655d463bb04f9aed04e4bf8c2018f3d4fc41" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "wayland-backend", "wayland-protocols", "wayland-scanner", @@ -3289,13 +6712,27 @@ dependencies = [ ] [[package]] -name = "wayland-protocols-wlr" -version = "0.3.4" +name = "wayland-protocols-plasma" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad87b5fd1b1d3ca2f792df8f686a2a11e3fe1077b71096f7a175ab699f89109" +checksum = "4fd38cdad69b56ace413c6bcc1fbf5acc5e2ef4af9d5f8f1f9570c0c83eae175" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb6cdc73399c0e06504c437fe3cf886f25568dd5454473d565085b36d6a8bbf" +dependencies = [ + "bitflags 2.9.1", + "wayland-backend", + "wayland-client", "wayland-protocols", "wayland-scanner", "wayland-server", @@ -3303,9 +6740,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.5" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" dependencies = [ "proc-macro2", "quick-xml", @@ -3314,29 +6751,158 @@ dependencies = [ [[package]] name = "wayland-server" -version = "0.31.6" +version = "0.31.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89532cc712a2adb119eb4d09694b402576052254d0bb284f82ac1c47fb786ad" +checksum = "485dfb8ccf0daa0d34625d34e6ac15f99e550a7999b6fd88a0835ccd37655785" dependencies = [ - "bitflags 2.6.0", - "downcast-rs", - "io-lifetimes", - "rustix", + "bitflags 2.9.1", + "downcast-rs 1.2.1", + "rustix 0.38.44", "wayland-backend", "wayland-scanner", ] [[package]] name = "wayland-sys" -version = "0.31.5" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" dependencies = [ "dlib", "log", "pkg-config", ] +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +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 = "24.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b0b3436f0729f6cdf2e6e9201f3d39dc95813fad61d826c1ed07918b4539353" +dependencies = [ + "arrayvec", + "bitflags 2.9.1", + "cfg_aliases 0.2.1", + "document-features", + "js-sys", + "log", + "naga", + "parking_lot 0.12.4", + "profiling", + "raw-window-handle 0.6.2", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "24.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f0aa306497a238d169b9dc70659105b4a096859a34894544ca81719242e1499" +dependencies = [ + "arrayvec", + "bit-vec 0.8.0", + "bitflags 2.9.1", + "cfg_aliases 0.2.1", + "document-features", + "indexmap 2.9.0", + "log", + "naga", + "once_cell", + "parking_lot 0.12.4", + "profiling", + "raw-window-handle 0.6.2", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 2.0.12", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "24.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f112f464674ca69f3533248508ee30cb84c67cf06c25ff6800685f5e0294e259" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set 0.8.0", + "bitflags 2.9.1", + "block", + "bytemuck", + "cfg_aliases 0.2.1", + "core-graphics-types", + "glow", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "ordered-float", + "parking_lot 0.12.4", + "profiling", + "range-alloc", + "raw-window-handle 0.6.2", + "renderdoc-sys", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 2.0.12", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "windows 0.58.0", + "windows-core 0.58.0", +] + +[[package]] +name = "wgpu-types" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50ac044c0e76c03a0378e7786ac505d010a873665e2d51383dcff8dd227dc69c" +dependencies = [ + "bitflags 2.9.1", + "js-sys", + "log", + "serde", + "web-sys", +] + [[package]] name = "winapi" version = "0.3.9" @@ -3368,13 +6934,77 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[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-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows" version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-core", + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.61.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", "windows-targets 0.52.6", ] @@ -3384,13 +7014,48 @@ version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-strings", + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "windows-implement" version = "0.58.0" @@ -3399,7 +7064,29 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] @@ -3410,7 +7097,43 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3422,16 +7145,34 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-strings" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-result", + "windows-result 0.2.0", "windows-targets 0.52.6", ] +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -3507,13 +7248,38 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -3532,6 +7298,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -3550,6 +7322,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -3568,12 +7346,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -3592,6 +7382,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -3610,6 +7406,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -3628,6 +7430,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -3646,6 +7454,64 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winit" +version = "0.30.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4409c10174df8779dc29a4788cac85ed84024ccbc1743b776b21a520ee1aaf4" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.9.1", + "block2", + "bytemuck", + "calloop 0.13.0", + "cfg_aliases 0.2.1", + "concurrent-queue", + "core-foundation 0.9.4", + "core-graphics", + "cursor-icon", + "dpi", + "js-sys", + "libc", + "memmap2", + "ndk 0.9.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "orbclient", + "percent-encoding", + "pin-project", + "raw-window-handle 0.6.2", + "redox_syscall 0.4.1", + "rustix 0.38.44", + "sctk-adwaita", + "smithay-client-toolkit", + "smol_str", + "tracing", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.52.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + [[package]] name = "winnow" version = "0.5.40" @@ -3657,32 +7523,60 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.18" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" dependencies = [ "memchr", ] [[package]] -name = "winnow" -version = "0.7.4" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "memchr", + "bitflags 2.9.1", ] [[package]] -name = "xdg-home" -version = "1.3.0" +name = "x11-dl" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" dependencies = [ "libc", - "windows-sys 0.59.0", + "once_cell", + "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading", + "once_cell", + "rustix 0.38.44", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "xcursor" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61" + [[package]] name = "xkbcommon" version = "0.8.0" @@ -3695,23 +7589,36 @@ dependencies = [ ] [[package]] -name = "xkbcommon-rs" -version = "0.1.0" +name = "xkbcommon-dl" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d02316af6831aee03a1ecc7b887ec1e983f4cc43792b80faade552cd7e710c6" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.6.0", - "indexmap 2.5.0", + "bitflags 2.9.1", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkbcommon-rs" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88e7409adab994ba3fb241b9d7f71335ccc2216525b990be568064e1ae2e3705" +dependencies = [ + "bitflags 2.9.1", + "indexmap 2.9.0", "lalrpop", "lalrpop-util", "log", "logos", "nix 0.28.0", "phf", - "phf_shared 0.11.2", + "phf_shared", "strum", "strum_macros", - "thiserror 1.0.63", + "thiserror 1.0.69", "unicase", "xkbcommon-rs-codegen", "xkeysym", @@ -3719,9 +7626,9 @@ dependencies = [ [[package]] name = "xkbcommon-rs-codegen" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2254a32bc6e1a177d8f6348da65f295487a66987a101a76dcb84b27d72f9f711" +checksum = "3d346404312bc1badb468f2a9b2eeb8e61514eb5892ca8246488f53bac4e3fc8" dependencies = [ "convert_case", "phf", @@ -3738,19 +7645,24 @@ checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" -version = "0.8.21" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" + +[[package]] +name = "yazi" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01738255b5a16e78bbb83e7fbba0a1e7dd506905cfc53f4622d89015a03fbb5" [[package]] name = "zbus" -version = "5.5.0" +version = "5.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c333f648ea1b647bc95dc1d34807c8e25ed7a6feff3394034dc4776054b236" +checksum = "d3a7c7cee313d044fca3f48fa782cb750c79e4ca76ba7bc7718cd4024cdf6f68" dependencies = [ "async-broadcast", "async-executor", - "async-fs", "async-io", "async-lock", "async-process", @@ -3763,17 +7675,15 @@ dependencies = [ "futures-core", "futures-lite", "hex", - "nix 0.29.0", + "nix 0.30.1", "ordered-stream", "serde", "serde_repr", - "static_assertions", "tokio", "tracing", "uds_windows", "windows-sys 0.59.0", - "winnow 0.7.4", - "xdg-home", + "winnow 0.7.10", "zbus_macros", "zbus_names", "zvariant", @@ -3781,14 +7691,14 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "5.5.0" +version = "5.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f325ad10eb0d0a3eb060203494c3b7ec3162a01a59db75d2deee100339709fc0" +checksum = "a17e7e5eec1550f747e71a058df81a9a83813ba0f6a95f39c4e218bdc7ba366a" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", "zbus_names", "zvariant", "zvariant_utils", @@ -3796,60 +7706,66 @@ dependencies = [ [[package]] name = "zbus_names" -version = "4.0.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc27fbd3593ff015cef906527a2ec4115e2e3dbf6204a24d952ac4975c80614" +checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", + "winnow 0.7.10", "zvariant", ] [[package]] -name = "zerocopy" -version = "0.7.35" +name = "zeno" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", ] [[package]] name = "zvariant" -version = "5.0.1" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c690a1da8858fd4377b8cc3134a753b0bea1d8ebd78ad6e5897fab821c5e184e" +checksum = "9d30786f75e393ee63a21de4f9074d4c038d52c5b1bb4471f955db249f9dffb1" dependencies = [ "endi", "enumflags2", "serde", - "static_assertions", + "winnow 0.7.10", "zvariant_derive", "zvariant_utils", ] [[package]] name = "zvariant_derive" -version = "5.0.1" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b6ddc1fed08493e4f2bd9350e7d00a3383467228735f3f169a9f8820fde755" +checksum = "75fda702cd42d735ccd48117b1630432219c0e9616bf6cb0f8350844ee4d9580" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.101", "zvariant_utils", ] @@ -3863,6 +7779,6 @@ dependencies = [ "quote", "serde", "static_assertions", - "syn 2.0.87", - "winnow 0.7.4", + "syn 2.0.101", + "winnow 0.7.10", ] diff --git a/Cargo.toml b/Cargo.toml index e494c63..68d4506 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,37 +21,29 @@ name = "stardust-xr-server" path = "src/main.rs" [features] -default = ["wayland"] +default = [] wayland = ["dep:smithay", "dep:wayland-scanner", "dep:wayland-backend"] profile_tokio = ["dep:console-subscriber", "tokio/tracing"] profile_app = ["dep:tracing-tracy"] -local_deps = ["stereokit-rust/force-local-deps"] [package.metadata.appimage] auto_link = true -auto_link_exclude_list = [ - "libc*", - "libdl*", - "libpthread*", - "ld-linux*", - "libGL*", - "libEGL*", -] +auto_link_exclude_list = ["libc*", "libdl*", "libpthread*", "ld-linux*"] [profile.dev.package."*"] opt-level = 3 -debug = true -strip = false -debug-assertions = true -overflow-checks = true -[profile.release] -opt-level = 3 -debug = "line-tables-only" -strip = true -debug-assertions = true -overflow-checks = false -lto = "thin" +# [profile.release] +# opt-level = 3 +# debug = "line-tables-only" +# strip = true +# debug-assertions = true +# overflow-checks = false +# lto = "thin" + +[patch.crates-io] +bevy_mod_openxr = { git = "https://github.com/Schmarni-Dev/bevy_openxr", branch = "non_default_wait_frame_system" } +bevy_mod_xr = { git = "https://github.com/Schmarni-Dev/bevy_openxr", branch = "non_default_wait_frame_system" } [dependencies] # small utility thingys @@ -63,6 +55,7 @@ send_wrapper = "0.6.0" slotmap = "1.0.7" global_counter = "=0.2.2" parking_lot = "0.12.3" +dashmap = "6.1.0" # rust errors/logging color-eyre = { version = "0.6.3", default-features = false } @@ -83,6 +76,17 @@ glam = { version = "0.29.0", features = ["mint", "serde"] } mint = "0.5.9" tokio = { version = "1.39.2", features = ["rt-multi-thread", "signal", "time"] } +# bevy +bevy = { version = "0.16", features = ["wayland", "bevy_remote"] } +bevy_mod_xr = "0.3" +bevy_mod_openxr = "0.3" +bevy_mod_meshtext.git = "https://github.com/Schmarni-Dev/bevy_mod_meshtext" +# bevy_sk.git = "https://github.com/MalekiRe/bevy_sk" +# bevy_sk = { git = "https://github.com/Schmarni-Dev/bevy_sk", branch = "fix_mat_stuff" } +bevy_sk.path = "../bevy_sk" + +openxr = "0.19" + # linux stuffs input-event-codes = "6.2.0" zbus = { version = "5.0.0", default-features = false, features = ["tokio"] } @@ -92,7 +96,7 @@ xkbcommon-rs = "0.1.0" # wayland wayland-backend = { version = "0.3.7", optional = true, default-features = false } wayland-scanner = { version = "0.31.4", optional = true } -dashmap = "6.1.0" + [dependencies.smithay] git = "https://github.com/smithay/smithay.git" @@ -100,7 +104,6 @@ default-features = false features = ["desktop", "backend_drm", "renderer_gl", "wayland_frontend"] optional = true - [dependencies.stereokit-rust] git = "https://github.com/mvvvv/StereoKit-rust.git" rev = "73ffaae6f42aa369e599a6ea0391f77840d682d8" diff --git a/src/core/client.rs b/src/core/client.rs index fbbcda7..d184eb6 100644 --- a/src/core/client.rs +++ b/src/core/client.rs @@ -26,7 +26,7 @@ use std::{ time::Instant, }; use tokio::{net::UnixStream, sync::watch, task::JoinHandle}; -use tracing::info; +use tracing::{info, warn}; lazy_static! { pub static ref CLIENTS: OwnedRegistry = OwnedRegistry::new(); @@ -201,7 +201,9 @@ impl Client { std::fs::read_link(cwd_proc_path).ok() } pub async fn save_state(&self) -> Option { + println!("start save state"); let internal = self.root.get()?.save_state().await.ok()?; + println!("finished save state"); Some(ClientStateParsed::from_deserialized(self, internal)) } diff --git a/src/main.rs b/src/main.rs index 0b8ae33..ee7fb94 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,11 +10,39 @@ use crate::core::destroy_queue; use crate::nodes::items::camera; use crate::nodes::{audio, drawable, input}; +use bevy::MinimalPlugins; +use bevy::a11y::AccessibilityPlugin; +use bevy::app::{App, ScheduleRunnerPlugin, TerminalCtrlCHandlerPlugin}; +use bevy::asset::{AssetMetaCheck, UnapprovedPathMode}; +use bevy::audio::AudioPlugin; +use bevy::core_pipeline::CorePipelinePlugin; +use bevy::gizmos::GizmoPlugin; +use bevy::gltf::GltfPlugin; +use bevy::input::{InputPlugin, InputSystem}; +use bevy::pbr::PbrPlugin; +use bevy::remote::RemotePlugin; +use bevy::remote::http::RemoteHttpPlugin; +use bevy::render::{RenderDebugFlags, RenderPlugin}; +use bevy::scene::ScenePlugin; +use bevy::text::FontLoader; +use bevy::winit::{WakeUp, WinitPlugin}; +use bevy_mod_meshtext::MeshTextPlugin; +use bevy_mod_openxr::add_xr_plugins; +use bevy_mod_openxr::exts::OxrExtensions; +use bevy_mod_openxr::features::overlay::OxrOverlaySettings; +use bevy_mod_openxr::init::OxrInitPlugin; +use bevy_mod_openxr::reference_space::OxrReferenceSpacePlugin; +use bevy_mod_openxr::resources::OxrSessionConfig; +use bevy_mod_openxr::types::AppInfo; +use bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin; use clap::Parser; use core::client::{Client, tick_internal_client}; use core::task; use directories::ProjectDirs; +use nodes::drawable::model::ModelNodePlugin; +use nodes::spatial::SpatialNodePlugin; use objects::ServerObjects; +use openxr::{EnvironmentBlendMode, ReferenceSpaceType}; use session::{launch_start, save_session}; use stardust_xr::schemas::dbus::object_registry::ObjectRegistry; use stardust_xr::server; @@ -38,6 +66,8 @@ use tracing_subscriber::{EnvFilter, fmt, prelude::*}; use zbus::Connection; use zbus::fdo::ObjectManager; +use bevy::prelude::*; + #[derive(Debug, Clone, Parser)] #[clap(author, version, about, long_about = None)] struct CliArgs { @@ -176,7 +206,7 @@ async fn main() { let cli_args = cli_args.clone(); let dbus_connection = dbus_connection.clone(); move || { - stereokit_loop( + bevy_loop( sk_ready_notifier, project_dirs, cli_args, @@ -209,6 +239,129 @@ async fn main() { static DEFAULT_SKYTEX: OnceLock = OnceLock::new(); static DEFAULT_SKYLIGHT: OnceLock = OnceLock::new(); +fn bevy_loop( + ready_notifier: Arc, + project_dirs: Option, + args: CliArgs, + dbus_connection: Connection, + object_registry: ObjectRegistry, +) { + let mut app = App::new(); + app.add_plugins(AssetPlugin { + meta_check: AssetMetaCheck::Never, + unapproved_path_mode: UnapprovedPathMode::Allow, + ..default() + }); + let mut plugins = MinimalPlugins + .build() + .disable::() + .add(TransformPlugin) + .add(InputPlugin) + /* .add(AccessibilityPlugin) */; + // TODO: figure out headless + { + plugins = plugins.add(WindowPlugin::default()).add({ + let mut winit = WinitPlugin::::default(); + winit.run_on_any_thread = true; + winit + }); + } + plugins = plugins + .add(TerminalCtrlCHandlerPlugin) + // bevy_mod_openxr will replace this, TODO: figure out how to mix this with + // bevy-dmabuf + .add(RenderPlugin::default()) + .add(ImagePlugin::default()) + .add(CorePipelinePlugin) + // theoretically we shouldn't need this because of bevy_sk, but everything is tangled in + // there and idk what we actually need to run + .add(PbrPlugin { + // this seems to only apply to StandardMaterial, we don't use that + prepass_enabled: true, + add_default_deferred_lighting_plugin: false, + use_gpu_instance_buffer_builder: true, + debug_flags: RenderDebugFlags::default(), + }) + // required for gltf + .add(ScenePlugin) + .add(GltfPlugin::default()) + .add(AudioPlugin::default()) + .add(GizmoPlugin) + .add(AccessibilityPlugin); + app.add_plugins( + add_xr_plugins(plugins) + .set(OxrInitPlugin { + app_info: AppInfo { + name: "Stardust XR".into(), + version: bevy_mod_openxr::types::Version(0, 44, 1), + }, + exts: { + // all OpenXR extensions can be requested here + let mut exts = OxrExtensions::default(); + exts.enable_hand_tracking(); + if args.overlay_priority.is_some() { + exts.enable_extx_overlay(); + } + exts + }, + ..default() + }) + .set(OxrReferenceSpacePlugin { + default_primary_ref_space: ReferenceSpaceType::LOCAL, + }), + ); + app.init_asset::().init_asset_loader::(); + if let Some(priority) = args.overlay_priority { + app.insert_resource(OxrOverlaySettings { + session_layer_placement: priority, + ..default() + }); + } + app.add_plugins(( + bevy_sk::hand::HandPlugin, + bevy_sk::vr_materials::SkMaterialPlugin { + replace_standard_material: true, + }, + bevy_sk::skytext::SphericalHarmonicsPlugin, + )); + app.add_plugins(HandGizmosPlugin); + app.add_plugins(MeshTextPlugin); + app.insert_resource(OxrSessionConfig { + blend_modes: Some(vec![ + EnvironmentBlendMode::ALPHA_BLEND, + EnvironmentBlendMode::ADDITIVE, + EnvironmentBlendMode::OPAQUE, + ]), + ..default() + }); + app.insert_resource(ClearColor(Color::BLACK.with_alpha(0.0))); + app.add_plugins((RemotePlugin::default(), RemoteHttpPlugin::default())); + app.add_plugins((SpatialNodePlugin, ModelNodePlugin)); + ready_notifier.notify_waiters(); + app.add_systems(PreUpdate, main_loop_system.after(InputSystem)); + app.run(); +} + +fn main_loop_system(world: &mut World) { + // camera::update(token); + #[cfg(feature = "wayland")] + wayland.frame_event(); + destroy_queue::clear(); + + // objects.update(&sk, token, &dbus_connection, &object_registry); + // input::process_input(); + let time = world.resource::().delta_secs_f64(); + nodes::root::Root::send_frame_events(time); + + // Wait + + tick_internal_client(); + #[cfg(feature = "wayland")] + wayland.update(); + // drawable::draw(token); + // audio::update(); +} + fn stereokit_loop( sk_ready_notifier: Arc, project_dirs: Option, diff --git a/src/nodes/drawable/mod.rs b/src/nodes/drawable/mod.rs index dda7f9c..58f64d6 100644 --- a/src/nodes/drawable/mod.rs +++ b/src/nodes/drawable/mod.rs @@ -23,7 +23,6 @@ use stereokit_rust::{sk::MainThreadToken, system::Renderer, tex::SHCubemap}; // #[instrument(level = "debug", skip(sk))] pub fn draw(token: &MainThreadToken) { lines::draw_all(token); - model::draw_all(token); text::draw_all(token); match QUEUED_SKYTEX.lock().take() { Some(Some(skytex)) => { diff --git a/src/nodes/drawable/model.rs b/src/nodes/drawable/model.rs index 3335abe..1f99348 100644 --- a/src/nodes/drawable/model.rs +++ b/src/nodes/drawable/model.rs @@ -6,128 +6,350 @@ use crate::core::registry::Registry; use crate::core::resource::get_resource_file; use crate::nodes::Node; use crate::nodes::alias::{Alias, AliasList}; -use crate::nodes::spatial::Spatial; +use crate::nodes::spatial::{Spatial, SpatialNode}; +use bevy::prelude::*; +use bevy_sk::vr_materials::PbrMaterial; use color_eyre::eyre::eyre; -use glam::{Mat4, Vec2, Vec3}; use parking_lot::Mutex; -use rustc_hash::FxHashMap; +use rustc_hash::{FxHashMap, FxHasher}; use stardust_xr::values::ResourceID; use std::ffi::OsStr; use std::hash::{Hash, Hasher}; -use std::sync::{Arc, LazyLock, OnceLock, Weak}; -use stereokit_rust::material::Transparency; +use std::path::PathBuf; +use std::sync::{Arc, OnceLock, Weak}; use stereokit_rust::maths::Bounds; -use stereokit_rust::sk::MainThreadToken; -use stereokit_rust::{material::Material, model::Model as SKModel, tex::Tex, util::Color128}; +use tokio::sync::mpsc; -pub struct MaterialWrapper(pub Material); -impl Drop for MaterialWrapper { - fn drop(&mut self) { - MATERIAL_REGISTRY.remove(self); +static LOAD_MODEL: OnceLock, PathBuf)>> = OnceLock::new(); + +pub struct ModelNodePlugin; +impl Plugin for ModelNodePlugin { + fn build(&self, app: &mut App) { + let (tx, rx) = mpsc::unbounded_channel(); + LOAD_MODEL.set(tx).unwrap(); + app.insert_resource(MpscReceiver(rx)); + app.add_systems(Update, load_models); + app.add_systems(PostUpdate, (gen_model_parts, apply_materials).chain()); } } -impl Hash for MaterialWrapper { - fn hash(&self, state: &mut H) { - self.0.get_shader().0.as_ptr().hash(state); - for param in self.0.get_all_param_info() { - param.name.hash(state); - param.to_string().hash(state); - } - self.0.get_chain().map(MaterialWrapper).hash(state) - } -} -impl PartialEq for MaterialWrapper { - fn eq(&self, other: &Self) -> bool { - if self.0.get_shader().0.as_ptr() != other.0.get_shader().0.as_ptr() { - return false; - } - if self.0.get_all_param_info().count() != other.0.get_all_param_info().count() { - return false; - } - for self_param in self.0.get_all_param_info() { - let Some(other_param) = other - .0 - .get_all_param_info() - .get_data(self_param.get_name(), self_param.get_type()) - else { - return false; - }; - if self_param.to_string() != other_param.to_string() { - return false; - } - } - self.0.get_chain().map(MaterialWrapper) == other.0.get_chain().map(MaterialWrapper) - } -} -impl Eq for MaterialWrapper {} -unsafe impl Send for MaterialWrapper {} -unsafe impl Sync for MaterialWrapper {} +#[derive(Resource)] +struct MpscReceiver(mpsc::UnboundedReceiver); +#[derive(Component)] +struct ModelNode(Weak); -#[derive(Default)] -struct MaterialRegistry(Mutex>>); -impl MaterialRegistry { - fn add_or_get(&self, material: Arc) -> Arc { - let hash = { - use std::hash::{Hash, Hasher}; - let mut hasher = std::collections::hash_map::DefaultHasher::new(); - material.hash(&mut hasher); - hasher.finish() +fn load_models( + asset_server: Res, + mut cmds: Commands, + mut mpsc_receiver: ResMut, PathBuf)>>, +) { + while let Ok((model, path)) = mpsc_receiver.0.try_recv() { + // idk of the asset label is the correct approach here + let handle = asset_server.load(GltfAssetLabel::Scene(0).from_asset(path)); + let entity = cmds + .spawn(( + SceneRoot(handle), + ModelNode(Arc::downgrade(&model)), + SpatialNode(Arc::downgrade(&model.space)), + )) + .id(); + model.bevy_scene_entity.set(entity).unwrap(); + } +} + +fn apply_materials( + mut query: Query<&mut MeshMaterial3d>, + mut material_registry: Local, + asset_server: Res, + mut materials: ResMut>, +) -> bevy::prelude::Result { + for model_part in MODEL_REGISTRY + .get_valid_contents() + .iter() + .filter_map(|p| p.parts.get()) + .flatten() + { + let mut mesh_mat = query.get_mut(*model_part.mesh_entity.get().unwrap())?; + if let Some(material) = model_part.pending_material_replacement.lock().take() { + let pbr_mat = material.to_pbr_mat(&asset_server); + let handle = material_registry.get_handle(pbr_mat, &mut materials); + mesh_mat.0 = handle; + } + for (param_name, param) in model_part.pending_material_parameters.lock().drain() { + let mut new_mat = materials.get(&mesh_mat.0).unwrap().clone(); + param.apply_to_material( + &model_part.space.node().unwrap().get_client().unwrap(), + &mut new_mat, + ¶m_name, + &asset_server, + ); + let handle = material_registry.get_handle(new_mat, &mut materials); + mesh_mat.0 = handle; + } + } + + Ok(()) +} + +fn gen_model_parts( + scenes: Res>, + query: Query<(Entity, &SceneRoot, &ModelNode, &Children)>, + children_query: Query<&Children>, + part_query: Query<(&Name, Option<&Children>, &Transform), Without>, + has_mesh: Query>, + mut cmds: Commands, +) { + for (entity, scene_root, model_node, model_children) in query.iter() { + let Some(model) = model_node.0.upgrade() else { + cmds.entity(entity).despawn(); + return; }; - - let mut lock = self.0.lock(); - if let Some(mat) = lock.get(&hash) { - if let Some(mat) = mat.upgrade() { - return mat; - } + if model.parts.get().is_some() { + continue; } - - lock.insert(hash, Arc::downgrade(&material)); - material - } - fn remove(&self, material: &MaterialWrapper) { - let hash = { - use std::hash::{Hash, Hasher}; - let mut hasher = std::collections::hash_map::DefaultHasher::new(); - material.hash(&mut hasher); - hasher.finish() - }; - let mut lock = self.0.lock(); - lock.remove(&hash); + if scenes.get(scene_root.0.id()).is_none() { + continue; + } + let mut parts = Vec::new(); + for entity in model_children + .iter() + .filter_map(|e| children_query.get(e).ok()) + .flat_map(|c| c.iter()) + { + gen_path( + entity, + &part_query, + None, + &mut |entity, name, transform, parent| { + let path = parent + .as_ref() + .map(|p| format!("{}/{}", &p.path, name.as_str())) + .unwrap_or_else(|| name.to_string()); + let parent_spatial = parent + .as_ref() + .map(|p| p.space.clone()) + .unwrap_or_else(|| model.space.clone()); + let client = model.space.node()?.get_client()?; + let (spatial, model_part) = + match model.pre_bound_parts.lock().iter().find(|v| v.path == path) { + None => { + let node = + client.scenegraph.add_node(Node::generate(&client, false)); + let spatial = Spatial::add_to( + &node, + Some(parent_spatial), + transform.compute_matrix(), + false, + ); + let model_part = node.add_aspect(ModelPart { + entity: OnceLock::new(), + mesh_entity: OnceLock::new(), + path, + space: spatial.clone(), + model: Arc::downgrade(&model), + pending_material_parameters: Mutex::default(), + pending_material_replacement: Mutex::default(), + aliases: AliasList::default(), + }); + (spatial, model_part) + } + Some(part) => { + part.space + .set_spatial_parent(Some(&parent_spatial)) + .unwrap(); + (part.space.clone(), part.clone()) + } + }; + _ = spatial.bounding_box_calc.set(|_| { + // TODO: actually impl aabb + Bounds::default() + }); + cmds.entity(entity) + .insert(SpatialNode(Arc::downgrade(&spatial))); + let mesh_entity = children_query + .get(entity) + .iter() + .flat_map(|v| v.iter()) + .find(|e| has_mesh.get(*e).unwrap_or(false))?; + _ = model_part.entity.set(entity); + _ = model_part.mesh_entity.set(mesh_entity); + parts.push(model_part.clone()); + Some(model_part) + }, + ); + } + _ = model.parts.set(parts); } } -static MATERIAL_REGISTRY: LazyLock = LazyLock::new(MaterialRegistry::default); +fn gen_path( + current_entity: Entity, + part_query: &Query<(&Name, Option<&Children>, &Transform), Without>, + parent: Option>, + func: &mut dyn FnMut( + Entity, + &Name, + &Transform, + Option>, + ) -> Option>, +) { + let Ok((name, children, transform)) = part_query.get(current_entity) else { + return; + }; + let Some(parent) = func(current_entity, name, transform, parent) else { + return; + }; + for e in children.iter().flat_map(|c| c.iter()) { + gen_path(e, part_query, Some(parent.clone()), func); + } +} + +#[derive(PartialEq, Deref, DerefMut, Clone, Copy, Eq, PartialOrd, Ord, Hash)] +struct HashedPbrMaterial(u64); +impl HashedPbrMaterial { + fn new(material: &PbrMaterial) -> Self { + let mut hasher = FxHasher::default(); + Self::hash_pbr_mat(material, &mut hasher); + Self(hasher.finish()) + } + fn hash_pbr_mat(mat: &PbrMaterial, state: &mut H) { + hash_color(mat.color, state); + hash_color(mat.emission_factor, state); + state.write_u32(mat.metallic.to_bits()); + state.write_u32(mat.roughness.to_bits()); + mat.use_stereokit_uvs.hash(state); + match mat.alpha_mode { + AlphaMode::Opaque => state.write_u8(0), + AlphaMode::Mask(v) => { + state.write_u8(1); + state.write_u32(v.to_bits()); + } + AlphaMode::Blend => state.write_u8(2), + AlphaMode::Premultiplied => state.write_u8(3), + AlphaMode::AlphaToCoverage => state.write_u8(4), + AlphaMode::Add => state.write_u8(5), + AlphaMode::Multiply => state.write_u8(6), + } + state.write_u8(mat.double_sided as u8); + mat.diffuse_texture.hash(state); + mat.emission_texture.hash(state); + mat.metal_texture.hash(state); + mat.occlusion_texture.hash(state); + // should always be the same, TODO: make the spherical harmonics buffer a per mesh instance thing + mat.spherical_harmonics.hash(state); + } +} +fn hash_color(color: Color, state: &mut H) { + match color { + Color::Srgba(srgba) => { + state.write_u8(0); + state.write(&srgba.to_u8_array()); + } + Color::LinearRgba(linear_rgba) => { + state.write_u8(1); + state.write(&linear_rgba.to_u8_array()); + } + Color::Hsla(hsla) => { + state.write_u8(2); + hsla.to_f32_array() + .iter() + .for_each(|v| state.write_u32(v.to_bits())); + } + Color::Hsva(hsva) => { + state.write_u8(3); + hsva.to_f32_array() + .iter() + .for_each(|v| state.write_u32(v.to_bits())); + } + Color::Hwba(hwba) => { + state.write_u8(4); + hwba.to_f32_array() + .iter() + .for_each(|v| state.write_u32(v.to_bits())); + } + Color::Laba(laba) => { + state.write_u8(5); + laba.to_f32_array() + .iter() + .for_each(|v| state.write_u32(v.to_bits())); + } + Color::Lcha(lcha) => { + state.write_u8(6); + lcha.to_f32_array() + .iter() + .for_each(|v| state.write_u32(v.to_bits())); + } + Color::Oklaba(oklaba) => { + state.write_u8(7); + oklaba + .to_f32_array() + .iter() + .for_each(|v| state.write_u32(v.to_bits())); + } + Color::Oklcha(oklcha) => { + state.write_u8(8); + oklcha + .to_f32_array() + .iter() + .for_each(|v| state.write_u32(v.to_bits())); + } + Color::Xyza(xyza) => { + state.write_u8(9); + xyza.to_f32_array() + .iter() + .for_each(|v| state.write_u32(v.to_bits())); + } + } +} static MODEL_REGISTRY: Registry = Registry::new(); -static HOLDOUT_MATERIAL: OnceLock> = OnceLock::new(); impl MaterialParameter { - fn apply_to_material(&self, client: &Client, material: &Material, parameter_name: &str) { - let mut params = material.get_all_param_info(); + fn apply_to_material( + &self, + client: &Client, + mat: &mut PbrMaterial, + parameter_name: &str, + asset_server: &AssetServer, + ) { match self { - MaterialParameter::Bool(val) => { - params.set_bool(parameter_name, *val); + MaterialParameter::Bool(val) => match parameter_name { + "double_sided" => mat.double_sided = *val, + v => { + error!("unknown param_name ({v}) for color") + } + }, + MaterialParameter::Int(_val) => { + // nothing uses an int } - MaterialParameter::Int(val) => { - params.set_int(parameter_name, &[*val]); - } - MaterialParameter::UInt(val) => { - params.set_uint(parameter_name, &[*val]); + MaterialParameter::UInt(_val) => { + // nothing uses an uint } MaterialParameter::Float(val) => { - params.set_float(parameter_name, *val); + match parameter_name { + "metallic" => mat.metallic = *val, + "roughness" => mat.roughness = *val, + // we probably don't want to expose tex_scale + // "tex_scale" => mat.tex_scale = *val, + v => { + error!("unknown param_name ({v}) for float") + } + } } - MaterialParameter::Vec2(val) => { - params.set_vec2(parameter_name, Vec2::from(*val)); + MaterialParameter::Vec2(_val) => { + // nothing uses a Vec2 } - MaterialParameter::Vec3(val) => { - params.set_vec3(parameter_name, Vec3::from(*val)); + MaterialParameter::Vec3(_val) => { + // nothing uses a Vec3 } MaterialParameter::Color(val) => { - params.set_color( - parameter_name, - Color128::new(val.c.r, val.c.g, val.c.b, val.a), - ); + let rgba = Srgba::new(val.c.r, val.c.g, val.c.b, val.a); + match parameter_name { + "color" => mat.color = rgba.into(), + "emission_factor" => mat.emission_factor = rgba.into(), + v => { + error!("unknown param_name ({v}) for color") + } + } } MaterialParameter::Texture(resource) => { let Some(texture_path) = @@ -135,180 +357,103 @@ impl MaterialParameter { else { return; }; - if let Ok(tex) = Tex::from_file(texture_path, true, None) { - params.set_texture(parameter_name, &tex); + info!(texture_param = parameter_name, path = ?texture_path); + let handle = asset_server.load(texture_path); + match parameter_name { + "diffuse" => mat.diffuse_texture = Some(handle), + "emission" => mat.emission_texture = Some(handle), + "metal" => mat.metal_texture = Some(handle), + "occlusion" => mat.occlusion_texture = Some(handle), + v => { + error!("unknown param_name ({v}) for texture"); + return; + } } + mat.alpha_mode = AlphaMode::AlphaToCoverage; + mat.use_stereokit_uvs = true; } } } } +pub struct Material { + pub color: Color, + pub emission_factor: Color, + pub metallic: f32, + pub roughness: f32, + pub alpha_mode: AlphaMode, + pub double_sided: bool, + + pub diffuse_texture: Option, + pub emission_texture: Option, + pub metal_texture: Option, + pub occlusion_texture: Option, +} + +impl Material { + fn to_pbr_mat(&self, asset_server: &AssetServer) -> PbrMaterial { + PbrMaterial { + color: self.color, + emission_factor: self.emission_factor, + metallic: self.metallic, + roughness: self.roughness, + alpha_mode: self.alpha_mode, + double_sided: self.double_sided, + diffuse_texture: self + .diffuse_texture + .as_ref() + .map(|p| asset_server.load(p.as_path())), + emission_texture: self + .emission_texture + .as_ref() + .map(|p| asset_server.load(p.as_path())), + metal_texture: self + .metal_texture + .as_ref() + .map(|p| asset_server.load(p.as_path())), + occlusion_texture: self + .occlusion_texture + .as_ref() + .map(|p| asset_server.load(p.as_path())), + spherical_harmonics: bevy_sk::skytext::SPHERICAL_HARMONICS_HANDLE, + use_stereokit_uvs: true, + } + } +} + pub struct ModelPart { - id: i32, + entity: OnceLock, + mesh_entity: OnceLock, path: String, space: Arc, model: Weak, - material: Mutex>>, pending_material_parameters: Mutex>, - pending_material_replacement: Mutex>>, + pending_material_replacement: Mutex>, aliases: AliasList, } impl ModelPart { - fn create_for_model(model: &Arc, sk_model: &SKModel) { - HOLDOUT_MATERIAL.get_or_init(|| { - let mut mat = Material::copy(&Material::unlit()); - mat.transparency(Transparency::None); - mat.color_tint(Color128::BLACK_TRANSPARENT); - Arc::new(MaterialWrapper(mat)) - }); - - let nodes = sk_model.get_nodes(); - for part in nodes.all() { - ModelPart::create(model, &part); - } - } - - fn create(model: &Arc, part: &stereokit_rust::model::ModelNode) -> Option> { - let mut parts = model.parts.lock(); - let parent_part = part - .get_parent() - .and_then(|part| parts.iter().find(|p| p.id == *part.get_id())); - - let stardust_model_part = model.space.node()?; - let client = stardust_model_part.get_client()?; - let mut part_path = parent_part - .map(|n| n.path.clone() + "/") - .unwrap_or_default(); - part_path += part.get_name().unwrap(); - - let node = client.scenegraph.add_node(Node::generate(&client, false)); - let spatial_parent = parent_part - .map(|n| n.space.clone()) - .unwrap_or_else(|| model.space.clone()); - - let local_transform = unsafe { part.get_local_transform().m }; - let space = Spatial::add_to( - &node, - Some(spatial_parent), - Mat4::from_cols_array(&local_transform), - false, - ); - - let _ = space.bounding_box_calc.set(|node| { - let Ok(model_part) = node.get_aspect::() else { - return Bounds::default(); - }; - let Some(model) = model_part.model.upgrade() else { - return Bounds::default(); - }; - let Some(sk_model) = model.sk_model.get() else { - return Bounds::default(); - }; - let model_nodes = sk_model.get_nodes(); - let Some(model_node) = model_nodes.get_index(model_part.id) else { - return Bounds::default(); - }; - let Some(sk_mesh) = model_node.get_mesh() else { - return Bounds::default(); - }; - sk_mesh.get_bounds() - }); - - let model_part = Arc::new(ModelPart { - id: *part.get_id(), - path: part_path, - space, - model: Arc::downgrade(model), - pending_material_parameters: Mutex::new(FxHashMap::default()), - pending_material_replacement: Mutex::new(None), - aliases: AliasList::default(), - material: Mutex::new(part.get_material().map(MaterialWrapper).map(Arc::new)), - }); - node.add_aspect_raw(model_part.clone()); - parts.push(model_part.clone()); - Some(model_part) - } - - pub fn replace_material(&self, replacement: Arc) { - let shared_material = MATERIAL_REGISTRY.add_or_get(replacement); + pub fn replace_material(&self, replacement: Material) { self.pending_material_replacement .lock() - .replace(shared_material); - } - /// only to be run on the main thread - pub fn replace_material_now(&self, replacement: &Material) { - let Some(model) = self.model.upgrade() else { - return; - }; - let Some(sk_model) = model.sk_model.get() else { - return; - }; - let nodes = sk_model.get_nodes(); - let Some(mut part) = nodes.get_index(self.id) else { - return; - }; - let shared_material = - MATERIAL_REGISTRY.add_or_get(Arc::new(MaterialWrapper(replacement.copy()))); - - let mut lock = self.material.lock(); - part.material(&shared_material.0); - lock.replace(shared_material); - } - - fn update(&self) { - let Some(model) = self.model.upgrade() else { - return; - }; - let Some(sk_model) = model.sk_model.get() else { - return; - }; - let Some(node) = model.space.node() else { - return; - }; - let nodes = sk_model.get_nodes(); - let Some(mut part) = nodes.get_index(self.id) else { - return; - }; - part.model_transform(Spatial::space_to_space_matrix( - Some(&self.space), - Some(&model.space), - )); - - let Some(client) = node.get_client() else { - return; - }; - - if let Some(material_replacement) = self.pending_material_replacement.lock().take() { - let mut lock = self.material.lock(); - part.material(&material_replacement.0); - lock.replace(material_replacement); - } - - 'mat_params: { - let mut material_parameters = self.pending_material_parameters.lock(); - if !material_parameters.is_empty() { - let Some(material) = part.get_material() else { - break 'mat_params; - }; - let new_material = material.copy(); - for (parameter_name, parameter_value) in material_parameters.drain() { - parameter_value.apply_to_material(&client, &new_material, ¶meter_name); - } - - let shared_material = - MATERIAL_REGISTRY.add_or_get(Arc::new(MaterialWrapper(new_material))); - let mut lock = self.material.lock(); - part.material(&shared_material.0); - lock.replace(shared_material); - } - } + .replace(replacement); } } impl ModelPartAspect for ModelPart { #[doc = "Set this model part's material to one that cuts a hole in the world. Often used for overlays/passthrough where you want to show the background through an object."] fn apply_holdout_material(node: Arc, _calling_client: Arc) -> Result<()> { let model_part = node.get_aspect::()?; - model_part.replace_material(HOLDOUT_MATERIAL.get().unwrap().clone()); + model_part.replace_material(Material { + color: Color::BLACK.with_alpha(0.0), + emission_factor: Color::BLACK, + metallic: 0.0, + roughness: 1.0, + alpha_mode: AlphaMode::Opaque, + double_sided: false, + diffuse_texture: None, + emission_texture: None, + metal_texture: None, + occlusion_texture: None, + }); Ok(()) } @@ -328,12 +473,37 @@ impl ModelPartAspect for ModelPart { Ok(()) } } +#[derive(Default)] +struct MaterialRegistry(FxHashMap>); +impl MaterialRegistry { + /// returns strong handle for PbrMaterial elminitating duplications + fn get_handle( + &mut self, + material: PbrMaterial, + materials: &mut ResMut>, + ) -> Handle { + let hash = HashedPbrMaterial::new(&material); + match self + .0 + .get(&hash) + .and_then(|v| materials.get_strong_handle(v.id())) + { + Some(v) => v, + None => { + let handle = materials.add(material); + self.0.insert(hash, handle.clone_weak()); + handle + } + } + } +} pub struct Model { space: Arc, _resource_id: ResourceID, - sk_model: OnceLock, - parts: Mutex>>, + bevy_scene_entity: OnceLock, + parts: OnceLock>>, + pre_bound_parts: Mutex>>, } impl Model { pub fn add_to(node: &Arc, resource_id: ResourceID) -> Result> { @@ -347,42 +517,21 @@ impl Model { let model = Arc::new(Model { space: node.get_aspect::().unwrap().clone(), _resource_id: resource_id, - sk_model: OnceLock::new(), - parts: Mutex::new(Vec::default()), + bevy_scene_entity: OnceLock::new(), + pre_bound_parts: Mutex::default(), + parts: OnceLock::new(), }); + LOAD_MODEL + .get() + .unwrap() + .send((model.clone(), pending_model_path)) + .unwrap(); MODEL_REGISTRY.add_raw(&model); - // technically doing this in anything but the main thread isn't a good idea but dangit we need those model nodes ASAP - let sk_model = SKModel::copy(SKModel::from_file( - pending_model_path.to_str().unwrap(), - None, - )?); - ModelPart::create_for_model(&model, &sk_model); - let _ = model.sk_model.set(sk_model); node.add_aspect_raw(model.clone()); Ok(model) } - - fn draw(&self, token: &MainThreadToken) { - let Some(sk_model) = self.sk_model.get() else { - return; - }; - let parts = self.parts.lock(); - for model_node in &*parts { - model_node.update(); - } - drop(parts); - - if let Some(node) = self.space.node() { - if node.enabled() { - sk_model.draw(token, self.space.global_transform(), None, None); - } - } - } } -// TODO: proper hread safety in stereokit_rust (probably just bind stereokit directly) -unsafe impl Send for Model {} -unsafe impl Sync for Model {} impl ModelAspect for Model { #[doc = "Bind a model part to the node with the ID input."] fn bind_model_part( @@ -392,10 +541,44 @@ impl ModelAspect for Model { part_path: String, ) -> Result<()> { let model = node.get_aspect::()?; - let parts = model.parts.lock(); - let Some(part) = parts.iter().find(|p| p.path == part_path) else { - let paths = parts.iter().map(|p| &p.path).collect::>(); - bail!("Couldn't find model part at path {part_path}, all available paths: {paths:?}",); + let part = match model + .parts + .get() + .map(|v| v.iter().find(|p| p.path == part_path)) + { + Some(Some(part)) => part.clone(), + Some(None) => { + let paths = model + .parts + .get() + .unwrap() + .iter() + .map(|p| &p.path) + .collect::>(); + bail!( + "Couldn't find model part at path {part_path}, all available paths: {paths:?}", + ); + } + None => { + let part_node = calling_client + .scenegraph + .add_node(Node::generate(&calling_client, false)); + let model = node.get_aspect::()?; + let spatial = + Spatial::add_to(&part_node, Some(model.space.clone()), Mat4::IDENTITY, false); + let part = part_node.add_aspect(ModelPart { + entity: OnceLock::new(), + mesh_entity: OnceLock::new(), + path: part_path, + space: spatial, + model: Arc::downgrade(&model), + pending_material_parameters: Mutex::default(), + pending_material_replacement: Mutex::default(), + aliases: AliasList::default(), + }); + model.pre_bound_parts.lock().push(part.clone()); + part + } }; Alias::create_with_id( &part.space.node().unwrap(), @@ -412,9 +595,3 @@ impl Drop for Model { MODEL_REGISTRY.remove(self); } } - -pub fn draw_all(token: &MainThreadToken) { - for model in MODEL_REGISTRY.get_valid_contents() { - model.draw(token); - } -} diff --git a/src/nodes/items/camera.rs b/src/nodes/items/camera.rs index 65bdc9d..3f4c15c 100644 --- a/src/nodes/items/camera.rs +++ b/src/nodes/items/camera.rs @@ -9,10 +9,7 @@ use crate::{ core::{client::Client, registry::Registry, scenegraph::MethodResponseSender}, nodes::{ Message, Node, - drawable::{ - model::{MaterialWrapper, ModelPart}, - shaders::UNLIT_SHADER_BYTES, - }, + drawable::{model::ModelPart, shaders::UNLIT_SHADER_BYTES}, items::TypeInfo, spatial::{Spatial, Transform}, }, @@ -68,7 +65,6 @@ pub struct CameraItem { space: Arc, frame_info: Mutex, sk_tex: OnceLock, - sk_mat: OnceLock>, applied_to: Registry, apply_to: Registry, } @@ -82,7 +78,6 @@ impl CameraItem { px_size, }), sk_tex: OnceLock::new(), - sk_mat: OnceLock::new(), applied_to: Registry::new(), apply_to: Registry::new(), }); @@ -139,15 +134,15 @@ impl CameraItem { TexFormat::RGBA32Linear, )) }); - let sk_mat = self.sk_mat.get_or_init(|| { - let shader = Shader::from_memory(UNLIT_SHADER_BYTES).unwrap(); - let mut mat = Material::new(&shader, None); - mat.get_all_param_info().set_texture("diffuse", &sk_tex.0); - mat.transparency(Transparency::Blend); - Arc::new(MaterialWrapper(mat)) - }); + // let sk_mat = self.sk_mat.get_or_init(|| { + // let shader = Shader::from_memory(UNLIT_SHADER_BYTES).unwrap(); + // let mut mat = Material::new(&shader, None); + // mat.get_all_param_info().set_texture("diffuse", &sk_tex.0); + // mat.transparency(Transparency::Blend); + // Arc::new(MaterialWrapper(mat)) + // }); for model_part in self.apply_to.take_valid_contents() { - model_part.replace_material(sk_mat.clone()) + // model_part.replace_material(sk_mat.clone()) } if !self.applied_to.is_empty() { diff --git a/src/nodes/spatial/mod.rs b/src/nodes/spatial/mod.rs index 6bb2de9..41bfdcd 100644 --- a/src/nodes/spatial/mod.rs +++ b/src/nodes/spatial/mod.rs @@ -9,16 +9,85 @@ use crate::core::client::Client; use crate::core::error::Result; use crate::core::registry::Registry; use crate::nodes::{Node, OWNED_ASPECT_ALIAS_INFO}; +use bevy::ecs::entity_disabling::Disabled; +use bevy::prelude::Transform as BevyTransform; +use bevy::prelude::*; use color_eyre::eyre::OptionExt; use glam::{Mat4, Quat, Vec3, vec3a}; use mint::Vector3; use parking_lot::Mutex; use rustc_hash::FxHashMap; use std::fmt::Debug; +use std::sync::atomic::Ordering; use std::sync::{Arc, OnceLock, Weak}; use std::{f32, ptr}; use stereokit_rust::maths::Bounds; +pub struct SpatialNodePlugin; +impl Plugin for SpatialNodePlugin { + fn build(&self, app: &mut App) { + app.add_systems( + PostUpdate, + (replace_childof, update_spatial_nodes).before(TransformSystem::TransformPropagate), + ); + } +} + +fn update_spatial_nodes( + mut query: Query<(Entity, &mut BevyTransform, &SpatialNode, Has)>, + cmds: ParallelCommands, +) { + query + .par_iter_mut() + .for_each(|(entity, mut transform, spatial_node, disabled)| { + let Some(spatial) = spatial_node.0.upgrade() else { + return; + }; + if !spatial + .node() + .map(|n| n.enabled.load(Ordering::Relaxed)) + .unwrap_or(true) + { + // cmds.command_scope(|mut cmds| { + // cmds.entity(entity).insert(Visibility::Hidden); + // }); + // return; + } + let mat4 = spatial.global_transform(); + + let scale_zero = mat4.to_scale_rotation_translation().0.length_squared() > 0.0; + if scale_zero { + // cmds.command_scope(|mut cmds| { + // cmds.entity(entity).insert(Visibility::Hidden); + // }); + } else if disabled { + // cmds.command_scope(|mut cmds| { + // cmds.entity(entity).insert(Visibility::Visible); + // }); + } + *transform = BevyTransform::from_matrix(mat4); + }); +} + +fn replace_childof(query: Query<(Entity, &ChildOf), With>, mut cmds: Commands) { + for (entity, parent) in &query { + cmds.entity(entity) + .insert(NonSpatialChildOf(parent.0)) + .remove::(); + } +} + +#[derive(Component, Default, Debug, PartialEq, Eq)] +#[relationship_target(relationship = NonSpatialChildOf, linked_spawn)] +pub struct NonSpatialChildren(Vec); +#[derive(Component, Debug, PartialEq, Eq)] +#[relationship(relationship_target = NonSpatialChildren)] +pub struct NonSpatialChildOf(Entity); + +#[derive(Clone, Component, Debug)] +#[require(BevyTransform)] +pub struct SpatialNode(pub Weak); + stardust_xr_server_codegen::codegen_spatial_protocol!(); impl Transform { pub fn to_mat4(&self, position: bool, rotation: bool, scale: bool) -> Mat4 { -- 2.49.1 From ab39b8b21126e189a6a0f74436f00419aa33a5d1 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Tue, 17 Jun 2025 14:29:22 +0200 Subject: [PATCH 02/17] feat: working handtracking input methodsRUST_LOG=info,naga=warn dbus-run-session cargo run -- -e ~/build/stardust/env.sh -o 300! Signed-off-by: Schmarni --- Cargo.lock | 21 +-- src/main.rs | 135 +++++++++++--- src/objects/input/sk_hand.rs | 353 ++++++++++++++++++++++++++--------- src/objects/mod.rs | 38 ++-- src/objects/play_space.rs | 160 ++++++++++++++-- 5 files changed, 542 insertions(+), 165 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b36cee..6caba97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1179,7 +1179,7 @@ dependencies = [ [[package]] name = "bevy_mod_openxr" version = "0.3.0" -source = "git+https://github.com/Schmarni-Dev/bevy_openxr?branch=non_default_wait_frame_system#7a30bb2b523739501ba491956b96d9d6464ed8c5" +source = "git+https://github.com/Schmarni-Dev/bevy_openxr?branch=non_default_wait_frame_system#f0fd9a3086f1d898cf8d1a5338a3deae7ef66e2f" dependencies = [ "android_system_properties", "ash", @@ -1197,7 +1197,7 @@ dependencies = [ [[package]] name = "bevy_mod_xr" version = "0.3.0" -source = "git+https://github.com/Schmarni-Dev/bevy_openxr?branch=non_default_wait_frame_system#7a30bb2b523739501ba491956b96d9d6464ed8c5" +source = "git+https://github.com/Schmarni-Dev/bevy_openxr?branch=non_default_wait_frame_system#f0fd9a3086f1d898cf8d1a5338a3deae7ef66e2f" dependencies = [ "bevy", ] @@ -1696,7 +1696,7 @@ dependencies = [ "bitflags 2.9.1", "cexpr", "clang-sys", - "itertools 0.13.0", + "itertools 0.11.0", "log", "prettyplease", "proc-macro2", @@ -3550,15 +3550,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.14.0" @@ -4259,7 +4250,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 2.0.101", @@ -4971,7 +4962,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.14.0", + "itertools 0.11.0", "proc-macro2", "quote", "syn 2.0.101", @@ -6925,7 +6916,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/src/main.rs b/src/main.rs index ee7fb94..756c246 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,10 +12,11 @@ use crate::nodes::{audio, drawable, input}; use bevy::MinimalPlugins; use bevy::a11y::AccessibilityPlugin; -use bevy::app::{App, ScheduleRunnerPlugin, TerminalCtrlCHandlerPlugin}; +use bevy::app::{App, MainScheduleOrder, ScheduleRunnerPlugin, TerminalCtrlCHandlerPlugin}; use bevy::asset::{AssetMetaCheck, UnapprovedPathMode}; use bevy::audio::AudioPlugin; use bevy::core_pipeline::CorePipelinePlugin; +use bevy::ecs::schedule::{ExecutorKind, ScheduleLabel}; use bevy::gizmos::GizmoPlugin; use bevy::gltf::GltfPlugin; use bevy::input::{InputPlugin, InputSystem}; @@ -27,14 +28,21 @@ use bevy::scene::ScenePlugin; use bevy::text::FontLoader; use bevy::winit::{WakeUp, WinitPlugin}; use bevy_mod_meshtext::MeshTextPlugin; +use bevy_mod_openxr::action_binding::OxrActionBindingPlugin; +use bevy_mod_openxr::action_set_attaching::OxrActionAttachingPlugin; +use bevy_mod_openxr::action_set_syncing::OxrActionSyncingPlugin; use bevy_mod_openxr::add_xr_plugins; use bevy_mod_openxr::exts::OxrExtensions; +use bevy_mod_openxr::features::handtracking::HandTrackingPlugin; use bevy_mod_openxr::features::overlay::OxrOverlaySettings; -use bevy_mod_openxr::init::OxrInitPlugin; +use bevy_mod_openxr::features::passthrough::OxrPassthroughPlugin; +use bevy_mod_openxr::init::{OxrInitPlugin, should_run_frame_loop}; use bevy_mod_openxr::reference_space::OxrReferenceSpacePlugin; -use bevy_mod_openxr::resources::OxrSessionConfig; +use bevy_mod_openxr::render::{OxrRenderPlugin, OxrWaitFrameSystem}; +use bevy_mod_openxr::resources::{OxrFrameState, OxrFrameWaiter, OxrSessionConfig}; use bevy_mod_openxr::types::AppInfo; use bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin; +use bevy_mod_xr::session::{XrFirst, XrHandleEvents, session_running}; use clap::Parser; use core::client::{Client, tick_internal_client}; use core::task; @@ -42,6 +50,8 @@ use directories::ProjectDirs; use nodes::drawable::model::ModelNodePlugin; use nodes::spatial::SpatialNodePlugin; use objects::ServerObjects; +use objects::input::sk_hand::HandPlugin; +use objects::play_space::PlaySpacePlugin; use openxr::{EnvironmentBlendMode, ReferenceSpaceType}; use session::{launch_start, save_session}; use stardust_xr::schemas::dbus::object_registry::ObjectRegistry; @@ -239,6 +249,13 @@ async fn main() { static DEFAULT_SKYTEX: OnceLock = OnceLock::new(); static DEFAULT_SKYLIGHT: OnceLock = OnceLock::new(); +#[derive(ScheduleLabel, Hash, Debug, PartialEq, Eq, Clone, Copy)] +pub struct PreFrameWait; +#[derive(Resource, Deref)] +pub struct ObjectRegistryRes(ObjectRegistry); +#[derive(Resource, Deref)] +pub struct DbusConnection(Connection); + fn bevy_loop( ready_notifier: Arc, project_dirs: Option, @@ -247,6 +264,7 @@ fn bevy_loop( object_registry: ObjectRegistry, ) { let mut app = App::new(); + app.insert_resource(DbusConnection(dbus_connection)); app.add_plugins(AssetPlugin { meta_check: AssetMetaCheck::Never, unapproved_path_mode: UnapprovedPathMode::Allow, @@ -254,18 +272,18 @@ fn bevy_loop( }); let mut plugins = MinimalPlugins .build() - .disable::() + // .disable::() .add(TransformPlugin) .add(InputPlugin) /* .add(AccessibilityPlugin) */; // TODO: figure out headless - { - plugins = plugins.add(WindowPlugin::default()).add({ - let mut winit = WinitPlugin::::default(); - winit.run_on_any_thread = true; - winit - }); - } + // { + // plugins = plugins.add(WindowPlugin::default()).add({ + // let mut winit = WinitPlugin::::default(); + // winit.run_on_any_thread = true; + // winit + // }); + // } plugins = plugins .add(TerminalCtrlCHandlerPlugin) // bevy_mod_openxr will replace this, TODO: figure out how to mix this with @@ -288,8 +306,23 @@ fn bevy_loop( .add(AudioPlugin::default()) .add(GizmoPlugin) .add(AccessibilityPlugin); + let mut task_pool_plugin = TaskPoolPlugin::default(); + // make tokio work + let handle = tokio::runtime::Handle::current(); + let enter_runtime_context = Arc::new(move || { + // TODO: this might be a memory leak + std::mem::forget(handle.enter()); + }); + task_pool_plugin.task_pool_options.io.on_thread_spawn = Some(enter_runtime_context.clone()); + task_pool_plugin.task_pool_options.compute.on_thread_spawn = + Some(enter_runtime_context.clone()); + task_pool_plugin + .task_pool_options + .async_compute + .on_thread_spawn = Some(enter_runtime_context.clone()); + plugins = plugins.set(task_pool_plugin); app.add_plugins( - add_xr_plugins(plugins) + add_xr_plugins(plugins.add(WindowPlugin::default())) .set(OxrInitPlugin { app_info: AppInfo { name: "Stardust XR".into(), @@ -306,17 +339,21 @@ fn bevy_loop( }, ..default() }) + .set(OxrRenderPlugin { + default_wait_frame: false, + ..default() + }) .set(OxrReferenceSpacePlugin { default_primary_ref_space: ReferenceSpaceType::LOCAL, - }), + }) + // Disable a bunch of unneeded plugins + // this plugin uses the fb extention, blend mode still works + .disable::() + // we don't do any action stuff that needs to integrate with the ecosystem + .disable::() + .disable::() + .disable::(), ); - app.init_asset::().init_asset_loader::(); - if let Some(priority) = args.overlay_priority { - app.insert_resource(OxrOverlaySettings { - session_layer_placement: priority, - ..default() - }); - } app.add_plugins(( bevy_sk::hand::HandPlugin, bevy_sk::vr_materials::SkMaterialPlugin { @@ -325,7 +362,14 @@ fn bevy_loop( bevy_sk::skytext::SphericalHarmonicsPlugin, )); app.add_plugins(HandGizmosPlugin); - app.add_plugins(MeshTextPlugin); + // app.add_plugins(MeshTextPlugin); + // app.init_asset::().init_asset_loader::(); + if let Some(priority) = args.overlay_priority { + app.insert_resource(OxrOverlaySettings { + session_layer_placement: priority, + ..default() + }); + } app.insert_resource(OxrSessionConfig { blend_modes: Some(vec![ EnvironmentBlendMode::ALPHA_BLEND, @@ -334,26 +378,63 @@ fn bevy_loop( ]), ..default() }); + let mut pre_frame_wait = Schedule::new(PreFrameWait); + pre_frame_wait.set_executor_kind(ExecutorKind::MultiThreaded); + app.add_schedule(pre_frame_wait); app.insert_resource(ClearColor(Color::BLACK.with_alpha(0.0))); + app.insert_resource(ObjectRegistryRes(object_registry)); app.add_plugins((RemotePlugin::default(), RemoteHttpPlugin::default())); - app.add_plugins((SpatialNodePlugin, ModelNodePlugin)); + // the Stardust server plugins + app.add_plugins(( + SpatialNodePlugin, + ModelNodePlugin, + PlaySpacePlugin, + HandPlugin, + )); ready_notifier.notify_waiters(); - app.add_systems(PreUpdate, main_loop_system.after(InputSystem)); + app.add_systems( + XrFirst, + xr_step + .in_set(OxrWaitFrameSystem) + .in_set(XrHandleEvents::FrameLoop), + ); app.run(); } -fn main_loop_system(world: &mut World) { +fn xr_step(world: &mut World) { // camera::update(token); #[cfg(feature = "wayland")] wayland.frame_event(); destroy_queue::clear(); - // objects.update(&sk, token, &dbus_connection, &object_registry); - // input::process_input(); + // update things like the Xr input methods + world.run_schedule(PreFrameWait); + input::process_input(); let time = world.resource::().delta_secs_f64(); nodes::root::Root::send_frame_events(time); - // Wait + // we are targeting the frame after the wait + if let Some(mut state) = world.get_resource_mut::() { + state.predicted_display_time = openxr::Time::from_nanos( + state.predicted_display_time.as_nanos() + state.predicted_display_period.as_nanos(), + ); + } + + let should_wait = world + .run_system_cached(should_run_frame_loop) + .unwrap_or(false); + if should_wait { + world.resource_scope::(|world, mut waiter| { + let state = waiter + .wait() + .inspect_err(|err| error!("failed to wait OpenXR frame: {err}")) + .ok(); + + if let Some(state) = state { + world.insert_resource(OxrFrameState(state)); + } + }); + } tick_internal_client(); #[cfg(feature = "wayland")] diff --git a/src/objects/input/sk_hand.rs b/src/objects/input/sk_hand.rs index e6653fe..c55a2a5 100644 --- a/src/objects/input/sk_hand.rs +++ b/src/objects/input/sk_hand.rs @@ -1,15 +1,27 @@ use crate::core::client::INTERNAL_CLIENT; use crate::nodes::OwnedNode; use crate::nodes::fields::{Field, FieldTrait}; -use crate::nodes::input::{INPUT_HANDLER_REGISTRY, InputDataType, InputHandler}; +use crate::nodes::input::{Finger, INPUT_HANDLER_REGISTRY, InputDataType, InputHandler, Thumb}; use crate::nodes::{ Node, input::{Hand, InputMethod, Joint}, spatial::Spatial, }; use crate::objects::{ObjectHandle, SpatialRef, Tracked}; +use crate::{DbusConnection, ObjectRegistryRes, PreFrameWait}; +use bevy::prelude::Transform as BevyTransform; +use bevy::prelude::*; +use bevy_mod_openxr::helper_traits::{ToQuat, ToVec3}; +use bevy_mod_openxr::resources::OxrFrameState; +use bevy_mod_openxr::session::OxrSession; +use bevy_mod_xr::hands::{HandBone, HandSide, XrHandBoneEntities, XrHandBoneRadius}; +use bevy_mod_xr::session::{XrPreDestroySession, XrSessionCreated}; +use bevy_mod_xr::spaces::{XrPrimaryReferenceSpace, XrSpaceLocationFlags}; +use bevy_sk::hand::GRADIENT_TEXTURE_HANDLE; +use bevy_sk::vr_materials::PbrMaterial; use color_eyre::eyre::Result; use glam::{Mat4, Quat, Vec3}; +use openxr::{HandJointLocation, SpaceLocationFlags}; use serde::{Deserialize, Serialize}; use stardust_xr::values::Datamap; use std::sync::Arc; @@ -21,15 +33,146 @@ use zbus::Connection; use super::{CaptureManager, get_sorted_handlers}; -fn convert_joint(joint: HandJoint) -> Joint { +pub struct HandPlugin; +impl Plugin for HandPlugin { + fn build(&self, app: &mut App) { + app.add_systems(PreFrameWait, update_hands); + app.add_systems(XrSessionCreated, create_trackers); + app.add_systems(XrPreDestroySession, destroy_trackers); + app.add_systems(PostUpdate, update_hand_material); + app.add_systems(Startup, setup); + } +} +fn update_hands( + mut hands: ResMut, + session: Option>, + state: Option>, + ref_space: Option>, + mut materials: ResMut>, + mut joint_query: Query<( + &mut BevyTransform, + &mut XrSpaceLocationFlags, + &mut XrHandBoneRadius, + )>, + joints_query: Query<&XrHandBoneEntities>, +) { + let (Some(session), Some(state), Some(ref_space)) = (session, state, ref_space) else { + tokio::task::spawn({ + let left = hands.left.tracked.clone(); + let right = hands.right.tracked.clone(); + async move { + left.set_tracked(false); + right.set_tracked(false); + } + }); + return; + }; + let get_joints = |hand: &mut SkHand| -> Option { + let Some(tracker) = hand.tracker.as_ref() else { + hand.input.spatial.node().unwrap().set_enabled(false); + let handle = hand.tracked.clone(); + tokio::task::spawn(async move { + handle.set_tracked(false); + }); + return None; + }; + // this won't be correct with pipelined rendering + session + .locate_hand_joints(tracker, &ref_space, state.predicted_display_time) + .inspect_err(|err| error!("Error while locating hand joints")) + .ok() + .flatten() + }; + let joints_left = get_joints(&mut hands.left); + let joints_right = get_joints(&mut hands.right); + hands.left.update(joints_left.as_ref(), &mut materials); + hands.right.update(joints_right.as_ref(), &mut materials); +} + +fn pinch_between(joint_1: &Joint, joint_2: &Joint) -> f32 { + const PINCH_MAX: f32 = 0.11; + const PINCH_ACTIVACTION_DISTANCE: f32 = 0.01; + let combined_radius = joint_1.radius + joint_2.radius; + let pinch_dist = + Vec3::from(joint_1.position).distance(Vec3::from(joint_2.position)) - combined_radius; + (1.0 - ((pinch_dist - PINCH_ACTIVACTION_DISTANCE) / (PINCH_MAX - PINCH_ACTIVACTION_DISTANCE))) + .clamp(0.0, 1.0) +} + +fn create_trackers(session: Res, mut hands: ResMut) { + hands.left.tracker = session + .create_hand_tracker(openxr::HandEXT::LEFT) + .inspect_err(|err| error!("failed to create left hand tracker")) + .ok(); + hands.right.tracker = session + .create_hand_tracker(openxr::HandEXT::RIGHT) + .inspect_err(|err| error!("failed to create right hand tracker")) + .ok(); +} +fn destroy_trackers(mut hands: ResMut) { + hands.left.tracker.take(); + hands.right.tracker.take(); +} +#[derive(Component)] +struct CorrectHandMaterial; +fn update_hand_material( + query: Query< + (Entity, &HandSide), + ( + With, + With>, + Without, + ), + >, + mut cmds: Commands, + hands: Res, +) { + for (entity, side) in &query { + let handle = match side { + HandSide::Left => hands.left.material.clone(), + HandSide::Right => hands.right.material.clone(), + }; + cmds.entity(entity) + .insert(MeshMaterial3d(handle)) + .insert(CorrectHandMaterial); + } +} + +fn setup( + connection: Res, + mut cmds: Commands, + mut materials: ResMut>, +) { + tokio::task::spawn({ + let connection = connection.clone(); + async move { + connection + .request_name("org.stardustxr.Hands") + .await + .unwrap(); + } + }); + cmds.insert_resource(Hands { + left: SkHand::new(&connection, HandSide::Left, &mut materials).unwrap(), + right: SkHand::new(&connection, HandSide::Right, &mut materials).unwrap(), + }); +} + +fn convert_joint(joint: HandJointLocation) -> Joint { Joint { - position: Vec3::from(joint.position).into(), - rotation: Quat::from(joint.orientation).into(), + position: joint.pose.position.to_vec3().into(), + rotation: joint.pose.orientation.to_quat().into(), radius: joint.radius, distance: 0.0, } } +#[derive(Resource)] +struct Hands { + left: SkHand, + right: SkHand, +} + #[derive(Default, Deserialize, Serialize)] struct HandDatamap { pinch_strength: f32, @@ -40,117 +183,158 @@ pub struct SkHand { _node: OwnedNode, palm_spatial: Arc, palm_object: ObjectHandle, - handed: Handed, + side: HandSide, input: Arc, capture_manager: CaptureManager, datamap: HandDatamap, tracked: ObjectHandle, + tracker: Option, + captured: bool, + material: Handle, } impl SkHand { - pub fn new(connection: &Connection, handed: Handed) -> Result { + pub fn new( + connection: &Connection, + side: HandSide, + materials: &mut Assets, + ) -> Result { let (palm_spatial, palm_object) = SpatialRef::create( connection, &("/org/stardustxr/Hand/".to_string() - + match handed { - Handed::Left => "left", - _ => "right", + + match side { + HandSide::Left => "left", + HandSide::Right => "right", } + "/palm"), ); let tracked = Tracked::new( connection, &("/org/stardustxr/Hand/".to_string() - + match handed { - Handed::Left => "left", - _ => "right", + + match side { + HandSide::Left => "left", + HandSide::Right => "right", }), ); - let _node = Node::generate(&INTERNAL_CLIENT, false).add_to_scenegraph_owned()?; - Spatial::add_to(&_node.0, None, Mat4::IDENTITY, false); + let node = Node::generate(&INTERNAL_CLIENT, false).add_to_scenegraph_owned()?; + Spatial::add_to(&node.0, None, Mat4::IDENTITY, false); let hand = InputDataType::Hand(Hand { - right: handed == Handed::Right, + right: matches!(side, HandSide::Right), ..Default::default() }); let datamap = Datamap::from_typed(HandDatamap::default())?; - let input = InputMethod::add_to(&_node.0, hand, datamap)?; - Input::hand_visible(handed, true); + let input = InputMethod::add_to(&node.0, hand, datamap)?; + let material = materials.add(PbrMaterial { + color: Srgba::new(1.0, 1.0, 1.0, 1.0).into(), + alpha_mode: AlphaMode::Blend, + use_stereokit_uvs: false, + diffuse_texture: Some(GRADIENT_TEXTURE_HANDLE), + roughness: 1.0, + ..default() + }); Ok(SkHand { - _node, + _node: node, palm_spatial, palm_object, - handed, + side, input, tracked, capture_manager: CaptureManager::default(), datamap: Default::default(), + tracker: None, + material, + captured: false, }) } - pub fn update(&mut self, sk: &Sk, token: &MainThreadToken, material: &mut Material) { - let sk_hand = Input::hand(self.handed); - let real_hand = Input::hand_source(self.handed) as u32 == HandSource::Articulated as u32; - if let InputDataType::Hand(hand) = &mut *self.input.data.lock() { - let input_node = self.input.spatial.node().unwrap(); - input_node.set_enabled( - (real_hand || sk.get_active_display_mode() == DisplayMode::Flatscreen) - && sk_hand.tracked.is_active(), - ); - let enabled = input_node.enabled(); - tokio::spawn({ - // this is suboptimal since it probably allocates a fresh string every frame - let handle = self.tracked.clone(); - async move { - handle.set_tracked(enabled).await; - } + fn update( + &mut self, + joints: Option<&openxr::HandJointLocations>, + materials: &mut ResMut>, + ) { + // TODO: use the hand data source ext + let real_hand = true; + let input_node = self.input.spatial.node().unwrap(); + let is_tracked = real_hand + && joints.is_some_and(|v| { + v.iter().all(|v| { + v.location_flags.contains( + SpaceLocationFlags::POSITION_VALID + | SpaceLocationFlags::POSITION_TRACKED + | SpaceLocationFlags::ORIENTATION_VALID + | SpaceLocationFlags::ORIENTATION_TRACKED, + ) + }) }); - if enabled { - hand.thumb.tip = convert_joint(sk_hand.fingers[0][4]); - hand.thumb.distal = convert_joint(sk_hand.fingers[0][3]); - hand.thumb.proximal = convert_joint(sk_hand.fingers[0][2]); - hand.thumb.metacarpal = convert_joint(sk_hand.fingers[0][1]); - - for (finger, mut sk_finger) in [ - (&mut hand.index, sk_hand.fingers[1]), - (&mut hand.middle, sk_hand.fingers[2]), - (&mut hand.ring, sk_hand.fingers[3]), - (&mut hand.little, sk_hand.fingers[4]), - ] { - sk_finger[4].radius = 0.0; - finger.tip = convert_joint(sk_finger[4]); - finger.distal = convert_joint(sk_finger[3]); - finger.intermediate = convert_joint(sk_finger[2]); - finger.proximal = convert_joint(sk_finger[1]); - finger.metacarpal = convert_joint(sk_finger[0]); - } - - hand.palm.position = Vec3::from(sk_hand.palm.position).into(); - hand.palm.rotation = Quat::from(sk_hand.palm.orientation).into(); - hand.palm.radius = - (sk_hand.fingers[2][0].radius + sk_hand.fingers[2][1].radius) * 0.5; - - self.palm_spatial - .set_local_transform(Mat4::from_rotation_translation( - hand.palm.rotation.into(), - hand.palm.position.into(), - )); - - hand.wrist.position = Vec3::from(sk_hand.wrist.position).into(); - hand.wrist.rotation = Quat::from(sk_hand.wrist.orientation).into(); - hand.wrist.radius = - (sk_hand.fingers[0][0].radius + sk_hand.fingers[4][0].radius) * 0.5; - - hand.elbow = None; - - let hand_color = if self.capture_manager.capture.upgrade().is_none() { - Color128::new_rgb(1.0, 1.0, 1.0) - } else { - Color128::new_rgb(0.0, 1.0, 0.75) - }; - material.color_tint(hand_color); + input_node.set_enabled(is_tracked); + tokio::task::spawn({ + let handle = self.tracked.clone(); + async move { + handle.set_tracked(is_tracked); } + }); + if is_tracked { + // cannot ever crash, is_tracked is only true of joints is some + let joints = joints.unwrap(); + let new_hand = Hand { + right: matches!(self.side, HandSide::Right), + thumb: Thumb { + tip: convert_joint(joints[HandBone::ThumbTip as usize]), + distal: convert_joint(joints[HandBone::ThumbDistal as usize]), + proximal: convert_joint(joints[HandBone::ThumbProximal as usize]), + metacarpal: convert_joint(joints[HandBone::ThumbMetacarpal as usize]), + }, + index: Finger { + tip: convert_joint(joints[HandBone::IndexTip as usize]), + distal: convert_joint(joints[HandBone::IndexDistal as usize]), + intermediate: convert_joint(joints[HandBone::IndexIntermediate as usize]), + proximal: convert_joint(joints[HandBone::IndexProximal as usize]), + metacarpal: convert_joint(joints[HandBone::IndexMetacarpal as usize]), + }, + middle: Finger { + tip: convert_joint(joints[HandBone::MiddleTip as usize]), + distal: convert_joint(joints[HandBone::MiddleDistal as usize]), + intermediate: convert_joint(joints[HandBone::MiddleIntermediate as usize]), + proximal: convert_joint(joints[HandBone::MiddleProximal as usize]), + metacarpal: convert_joint(joints[HandBone::MiddleMetacarpal as usize]), + }, + ring: Finger { + tip: convert_joint(joints[HandBone::RingTip as usize]), + distal: convert_joint(joints[HandBone::RingDistal as usize]), + intermediate: convert_joint(joints[HandBone::RingIntermediate as usize]), + proximal: convert_joint(joints[HandBone::RingProximal as usize]), + metacarpal: convert_joint(joints[HandBone::RingMetacarpal as usize]), + }, + little: Finger { + tip: convert_joint(joints[HandBone::LittleTip as usize]), + distal: convert_joint(joints[HandBone::LittleDistal as usize]), + intermediate: convert_joint(joints[HandBone::LittleIntermediate as usize]), + proximal: convert_joint(joints[HandBone::LittleProximal as usize]), + metacarpal: convert_joint(joints[HandBone::LittleMetacarpal as usize]), + }, + palm: convert_joint(joints[HandBone::Palm as usize]), + wrist: convert_joint(joints[HandBone::Wrist as usize]), + elbow: None, + }; + self.palm_spatial + .set_local_transform(Mat4::from_rotation_translation( + new_hand.palm.rotation.into(), + new_hand.palm.position.into(), + )); + + self.datamap.pinch_strength = pinch_between(&new_hand.thumb.tip, &new_hand.index.tip); + // this is how stereokit calculates grab + self.datamap.grab_strength = + pinch_between(&new_hand.ring.tip, &new_hand.ring.metacarpal); + + *self.input.data.lock() = InputDataType::Hand(new_hand); + *self.input.datamap.lock() = Datamap::from_typed(&self.datamap).unwrap(); + let captured = self.capture_manager.capture.upgrade().is_some(); + if captured && !self.captured { + materials.get_mut(&self.material).unwrap().color = Srgba::rgb(0., 1., 0.75).into(); + } else if self.captured && !captured { + materials.get_mut(&self.material).unwrap().color = Srgba::rgb(1., 1.0, 1.0).into(); + } + self.captured = captured; } - self.datamap.pinch_strength = sk_hand.pinch_activation; - self.datamap.grab_strength = sk_hand.grip_activation; - *self.input.datamap.lock() = Datamap::from_typed(&self.datamap).unwrap(); let distance_calculator = |space: &Arc, data: &InputDataType, field: &Field| { let InputDataType::Hand(hand) = data else { @@ -183,11 +367,6 @@ impl SkHand { .set_handler_order(sorted_handlers.iter().map(|(handler, _)| handler)); } } -impl Drop for SkHand { - fn drop(&mut self) { - Input::hand_visible(self.handed, false); - } -} fn joint_to_line_point(joint: &Joint, color: Color128) -> LinePoint { LinePoint { diff --git a/src/objects/mod.rs b/src/objects/mod.rs index b848b8e..aae5d36 100644 --- a/src/objects/mod.rs +++ b/src/objects/mod.rs @@ -13,6 +13,7 @@ use input::{ eye_pointer::EyePointer, mouse_pointer::MousePointer, sk_controller::SkController, sk_hand::SkHand, }; +use parking_lot::RwLock; use play_space::PlaySpaceBounds; use stardust_xr::schemas::dbus::object_registry::ObjectRegistry; use std::{ @@ -34,16 +35,16 @@ enum Inputs { XR { controller_left: SkController, controller_right: SkController, - hand_left: SkHand, - hand_right: SkHand, + // hand_left: SkHand, + // hand_right: SkHand, eye_pointer: Option, }, MousePointer(MousePointer), // Controllers((SkController, SkController)), - Hands { - left: SkHand, - right: SkHand, - }, + // Hands { + // left: SkHand, + // right: SkHand, + // }, } pub struct ServerObjects { @@ -69,7 +70,8 @@ impl ServerObjects { if play_space.is_some() { let dbus_connection = connection.clone(); tokio::task::spawn(async move { - PlaySpaceBounds::create(&dbus_connection).await; + let play_space_data = Arc::new(RwLock::default()); + PlaySpaceBounds::create(&dbus_connection, play_space_data).await; dbus_connection .request_name("org.stardustxr.PlaySpace") .await @@ -95,8 +97,8 @@ impl ServerObjects { Inputs::XR { controller_left: SkController::new(&connection, Handed::Left).unwrap(), controller_right: SkController::new(&connection, Handed::Right).unwrap(), - hand_left: SkHand::new(&connection, Handed::Left).unwrap(), - hand_right: SkHand::new(&connection, Handed::Right).unwrap(), + // hand_left: SkHand::new(&connection, Handed::Left).unwrap(), + // hand_right: SkHand::new(&connection, Handed::Right).unwrap(), eye_pointer: Device::has_eye_gaze() .then(EyePointer::new) .transpose() @@ -166,8 +168,6 @@ impl ServerObjects { Inputs::XR { controller_left, controller_right, - hand_left, - hand_right, eye_pointer, } => { if !self.disable_controllers { @@ -176,10 +176,10 @@ impl ServerObjects { } Input::hand_visible(Handed::Left, !self.disable_hands); Input::hand_visible(Handed::Right, !self.disable_hands); - if !self.disable_hands { - hand_left.update(sk, token, &mut self.hand_materials[0]); - hand_right.update(sk, token, &mut self.hand_materials[1]); - } + // if !self.disable_hands { + // hand_left.update(sk, token, &mut self.hand_materials[0]); + // hand_right.update(sk, token, &mut self.hand_materials[1]); + // } if let Some(eye_pointer) = eye_pointer { eye_pointer.update(); } @@ -191,10 +191,10 @@ impl ServerObjects { // left.update(token); // right.update(token); // } - Inputs::Hands { left, right } => { - left.update(sk, token, &mut self.hand_materials[0]); - right.update(sk, token, &mut self.hand_materials[1]); - } + // Inputs::Hands { left, right } => { + // left.update(sk, token, &mut self.hand_materials[0]); + // right.update(sk, token, &mut self.hand_materials[1]); + // } } } } diff --git a/src/objects/play_space.rs b/src/objects/play_space.rs index c392c9b..4639808 100644 --- a/src/objects/play_space.rs +++ b/src/objects/play_space.rs @@ -1,12 +1,151 @@ +use std::sync::Arc; + +use bevy::prelude::*; +use bevy_mod_openxr::{ + helper_traits::{ToQuat, ToVec3}, + resources::OxrFrameState, + session::OxrSession, +}; +use bevy_mod_xr::{ + session::{XrPreDestroySession, XrSessionCreated}, + spaces::{XrPrimaryReferenceSpace, XrReferenceSpace, XrSpace}, +}; +use openxr::SpaceLocationFlags; +use parking_lot::RwLock; use stereokit_rust::system::World; use zbus::{Connection, ObjectServer, interface}; -pub struct PlaySpaceBounds; +use crate::{DbusConnection, PreFrameWait, nodes::spatial::Spatial}; + +use super::{ObjectHandle, SpatialRef, Tracked}; + +pub struct PlaySpacePlugin; +impl Plugin for PlaySpacePlugin { + fn build(&self, app: &mut App) { + app.add_systems(XrPreDestroySession, destroy_stage_space); + app.add_systems(XrSessionCreated, create_stage_space); + app.add_systems(PreFrameWait, update); + app.add_systems(Startup, setup); + } +} + +fn setup(connection: Res, mut cmds: Commands) { + let (spatial, spatial_handle) = SpatialRef::create(&connection, "/org/stardustxr/PlaySpace"); + // the OpenXR session might not exist quite yet + let tracked = Tracked::new(&connection, "/org/stardustxr/PlaySpace"); + let dbus_connection = connection.clone(); + let play_space_data = Arc::new(RwLock::default()); + tokio::task::spawn({ + let data = play_space_data.clone(); + async move { + PlaySpaceBounds::create(&dbus_connection, data).await; + dbus_connection + .request_name("org.stardustxr.PlaySpace") + .await + .unwrap(); + } + }); + cmds.insert_resource(PlaySpace { + spatial, + _spatial_handle: spatial_handle, + tracked_handle: tracked, + bounds: play_space_data, + }); +} + +#[derive(Resource)] +struct StageSpace(XrSpace); +fn create_stage_space(session: Res, mut cmds: Commands) { + let space = session + .create_reference_space(openxr::ReferenceSpaceType::STAGE, Transform::IDENTITY) + .inspect_err(|err| error!("failed to create Stage XrSpace")) + .ok(); + if let Some(space) = space { + cmds.insert_resource(StageSpace(space.0)); + } +} +fn destroy_stage_space(session: Res, mut cmds: Commands, stage: Res) { + session.destroy_space(stage.0); + cmds.remove_resource::(); +} + +/// TODO: impl this +fn update( + session: Option>, + stage: Option>, + ref_space: Option>, + play_space: Res, + state: Option>, +) { + let (Some(session), Some(stage), Some(ref_space), Some(state)) = + (session, stage, ref_space, state) + else { + play_space.bounds.write().drain(..); + tokio::task::spawn({ + let handle = play_space.tracked_handle.clone(); + async move { + handle.set_tracked(false); + } + }); + return; + }; + // this won't be correct with pipelined rendering + let location = session + .locate_space(&stage.0, &ref_space, state.predicted_display_time) + .inspect_err(|err| error!("Error while Locating OpenXR Stage Space {err}")); + if let Ok(location) = location { + let is_tracked = location.location_flags.contains( + SpaceLocationFlags::POSITION_VALID + | SpaceLocationFlags::POSITION_TRACKED + | SpaceLocationFlags::ORIENTATION_VALID + | SpaceLocationFlags::ORIENTATION_TRACKED, + ); + tokio::task::spawn({ + let handle = play_space.tracked_handle.clone(); + async move { + handle.set_tracked(is_tracked); + } + }); + if is_tracked { + play_space + .spatial + .set_local_transform(Mat4::from_rotation_translation( + location.pose.orientation.to_quat(), + location.pose.position.to_vec3(), + )); + } + } + // session.reference_space_bounds_rect(openxr::ReferenceSpaceType::STAGE); + + // if (World::has_bounds() + // && World::get_bounds_size().x != 0.0 + // && World::get_bounds_size().y != 0.0) + // { + // let bounds = World::get_bounds_size(); + // vec![ + // ((bounds.x).into(), (bounds.y).into()), + // ((bounds.x).into(), (-bounds.y).into()), + // ((-bounds.x).into(), (-bounds.y).into()), + // ((-bounds.x).into(), (bounds.y).into()), + // ] + // } else { + // vec![] + // } +} + +#[derive(Resource)] +pub struct PlaySpace { + spatial: Arc, + _spatial_handle: ObjectHandle, + tracked_handle: ObjectHandle, + bounds: Arc>>, +} +pub struct PlaySpaceBounds(Arc>>); impl PlaySpaceBounds { - pub async fn create(connection: &Connection) { + pub async fn create(connection: &Connection, data: Arc>>) { connection .object_server() - .at("/org/stardustxr/PlaySpace", Self) + .at("/org/stardustxr/PlaySpace", Self(data)) .await .unwrap(); } @@ -15,19 +154,6 @@ impl PlaySpaceBounds { impl PlaySpaceBounds { #[zbus(property)] fn bounds(&self) -> Vec<(f64, f64)> { - if (World::has_bounds() - && World::get_bounds_size().x != 0.0 - && World::get_bounds_size().y != 0.0) - { - let bounds = World::get_bounds_size(); - vec![ - ((bounds.x).into(), (bounds.y).into()), - ((bounds.x).into(), (-bounds.y).into()), - ((-bounds.x).into(), (-bounds.y).into()), - ((-bounds.x).into(), (bounds.y).into()), - ] - } else { - vec![] - } + self.0.read().clone() } } -- 2.49.1 From 6977fee10b83bee89607a62b14b1dcde06dbab97 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Tue, 17 Jun 2025 14:29:50 +0200 Subject: [PATCH 03/17] feat: working controller input methods Signed-off-by: Schmarni --- Cargo.lock | 308 ++++++++++++------------ Cargo.toml | 1 + src/main.rs | 9 +- src/nodes/drawable/model.rs | 60 ++--- src/objects/input/sk_controller.rs | 362 +++++++++++++++++++++++++---- src/objects/mod.rs | 18 +- 6 files changed, 523 insertions(+), 235 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6caba97..f621a25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,7 +35,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0bf66a7bf0b7ea4fd7742d50b64782a88f99217cf246b3f93b4162528dde520" dependencies = [ "accesskit", - "hashbrown 0.15.3", + "hashbrown 0.15.4", "immutable-chunkmap", ] @@ -47,7 +47,7 @@ checksum = "09e230718177753b4e4ad9e1d9f6cfc2f4921212d4c1c480b253f526babb258d" dependencies = [ "accesskit", "accesskit_consumer", - "hashbrown 0.15.3", + "hashbrown 0.15.4", "objc2", "objc2-app-kit", "objc2-foundation", @@ -61,7 +61,7 @@ checksum = "65178f3df98a51e4238e584fcb255cb1a4f9111820848eeddd37663be40a625f" dependencies = [ "accesskit", "accesskit_consumer", - "hashbrown 0.15.3", + "hashbrown 0.15.4", "paste", "static_assertions", "windows 0.58.0", @@ -92,9 +92,9 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ahash" @@ -328,7 +328,7 @@ checksum = "f548ad2c4031f2902e3edc1f29c29e835829437de49562d8eb5dc5584d3a1043" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -437,7 +437,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -477,7 +477,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -497,7 +497,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -740,7 +740,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -815,7 +815,7 @@ checksum = "1b837bf6c51806b10ebfa9edf1844ad80a3a0760d6c5fac4e90761df91a8901a" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -873,7 +873,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -937,14 +937,13 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] name = "bevy_gltf" version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a080237c0b8842ccc15a06d3379302c68580eeea4497b1c7387e470eda1f07" +source = "git+https://github.com/Schmarni-Dev/bevy?branch=gltf_backport#1f0b9587326db68611852c70b4c2d45382a51d05" dependencies = [ "base64 0.22.1", "bevy_animation", @@ -1108,7 +1107,7 @@ dependencies = [ "parking_lot 0.12.4", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", "toml_edit 0.22.27", ] @@ -1271,7 +1270,7 @@ dependencies = [ "critical-section", "foldhash", "getrandom 0.2.16", - "hashbrown 0.15.3", + "hashbrown 0.15.4", "portable-atomic", "portable-atomic-util", "serde", @@ -1321,7 +1320,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", "uuid", ] @@ -1409,7 +1408,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -1497,7 +1496,7 @@ dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -1696,7 +1695,7 @@ dependencies = [ "bitflags 2.9.1", "cexpr", "clang-sys", - "itertools 0.11.0", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", @@ -1704,7 +1703,25 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.101", + "syn 2.0.103", +] + +[[package]] +name = "bindgen" +version = "0.72.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f72209734318d0b619a5e0f5129918b848c416e122a3c4ce054e03cb87b726f" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash 2.1.1", + "shlex", + "syn 2.0.103", ] [[package]] @@ -1810,9 +1827,9 @@ checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" [[package]] name = "bytemuck" -version = "1.23.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" dependencies = [ "bytemuck_derive", ] @@ -1825,7 +1842,7 @@ checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -1887,9 +1904,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.26" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ "jobserver", "libc", @@ -1923,9 +1940,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "cfg_aliases" @@ -1962,9 +1979,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.39" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", "clap_derive", @@ -1972,9 +1989,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.39" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -1984,21 +2001,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "cluFlock" @@ -2236,11 +2253,11 @@ dependencies = [ [[package]] name = "coreaudio-sys" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ce857aa0b77d77287acc1ac3e37a05a8c95a2af3647d23b15f263bdaeb7562b" +checksum = "ceec7a6067e62d6f931a2baf6f3a751f4a892595bcec1461a3c94ef9949864b6" dependencies = [ - "bindgen", + "bindgen 0.72.0", ] [[package]] @@ -2418,7 +2435,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", "unicode-xid", ] @@ -2615,7 +2632,7 @@ checksum = "f97b51c5cc57ef7c5f7a0c57c250251c49ee4c28f819f87ac32f4aceabc36792" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -2626,9 +2643,9 @@ checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] name = "enumflags2" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" dependencies = [ "enumflags2_derive", "serde", @@ -2636,13 +2653,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -2653,7 +2670,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -2771,9 +2788,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", "miniz_oxide", @@ -2854,7 +2871,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -2905,7 +2922,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -2945,7 +2962,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows 0.61.1", + "windows 0.61.3", ] [[package]] @@ -2983,7 +3000,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -3030,7 +3047,7 @@ dependencies = [ "vec_map", "wasm-bindgen", "web-sys", - "windows 0.61.1", + "windows 0.61.3", ] [[package]] @@ -3112,7 +3129,7 @@ dependencies = [ "inflections", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -3175,7 +3192,7 @@ checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" dependencies = [ "bitflags 2.9.1", "gpu-descriptor-types", - "hashbrown 0.15.3", + "hashbrown 0.15.4", ] [[package]] @@ -3261,9 +3278,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.15.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ "equivalent", "foldhash", @@ -3302,9 +3319,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" @@ -3480,7 +3497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.3", + "hashbrown 0.15.4", "serde", ] @@ -3550,6 +3567,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.14.0" @@ -3708,9 +3734,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.172" +version = "0.2.173" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb" [[package]] name = "libloading" @@ -3719,7 +3745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.53.0", + "windows-targets 0.53.2", ] [[package]] @@ -3736,7 +3762,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.9.1", "libc", - "redox_syscall 0.5.12", + "redox_syscall 0.5.13", ] [[package]] @@ -3810,7 +3836,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.8.5", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -3862,7 +3888,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -3882,9 +3908,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memmap2" @@ -3951,7 +3977,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -3968,9 +3994,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", "simd-adler32", @@ -3992,7 +4018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.59.0", ] @@ -4201,7 +4227,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -4250,10 +4276,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -4667,7 +4693,7 @@ checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.12", + "redox_syscall 0.5.13", "smallvec", "windows-targets 0.52.6", ] @@ -4746,7 +4772,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", "unicase", ] @@ -4783,7 +4809,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -4890,12 +4916,12 @@ checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" [[package]] name = "prettyplease" -version = "0.2.33" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dee91521343f4c5c6a63edd65e54f31f5c92fe8978c40a4282f8372194c6a7d" +checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" dependencies = [ "proc-macro2", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -4942,7 +4968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -4962,10 +4988,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -5145,9 +5171,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ "bitflags 2.9.1", ] @@ -5243,9 +5269,9 @@ checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" @@ -5401,7 +5427,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -5424,7 +5450,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -5508,12 +5534,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "slotmap" @@ -5526,9 +5549,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" dependencies = [ "serde", ] @@ -5536,7 +5559,7 @@ dependencies = [ [[package]] name = "smithay" version = "0.6.0" -source = "git+https://github.com/smithay/smithay.git#776ba424423584400e76317e688b160546e68ca7" +source = "git+https://github.com/smithay/smithay.git#52107d3d13bbfb7222e3d87cf2588374f83a2a0b" dependencies = [ "appendlist", "atomic_float", @@ -5831,7 +5854,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -5864,9 +5887,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.101" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", @@ -5972,7 +5995,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -5983,17 +6006,16 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -6072,7 +6094,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -6142,7 +6164,7 @@ dependencies = [ "serde_spanned", "toml_datetime", "toml_write", - "winnow 0.7.10", + "winnow 0.7.11", ] [[package]] @@ -6247,7 +6269,7 @@ checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -6287,7 +6309,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528bdd1f0e27b5dd9a4ededf154e824b0532731e4af73bb531de46276e0aab1e" dependencies = [ - "bindgen", + "bindgen 0.70.1", "cc", "cfg-if", "once_cell", @@ -6383,9 +6405,9 @@ checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" [[package]] name = "twox-hash" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7b17f197b3050ba473acf9181f7b1d3b66d1cf7356c6cc57886662276e65908" +checksum = "8b907da542cbced5261bd3256de1b3a1bf340a3d37f93425a07362a1d687de56" [[package]] name = "typeid" @@ -6508,7 +6530,7 @@ checksum = "41b6d82be61465f97d42bd1d15bf20f3b0a3a0905018f38f9d6f6962055b0b5c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -6544,9 +6566,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -6579,7 +6601,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", "wasm-bindgen-shared", ] @@ -6614,7 +6636,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6916,7 +6938,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -6957,9 +6979,9 @@ dependencies = [ [[package]] name = "windows" -version = "0.61.1" +version = "0.61.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ "windows-collections", "windows-core 0.61.2", @@ -7044,7 +7066,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -7055,7 +7077,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -7066,7 +7088,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -7077,7 +7099,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -7088,7 +7110,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -7099,14 +7121,14 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] name = "windows-link" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-numerics" @@ -7248,9 +7270,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.0" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" dependencies = [ "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", @@ -7514,9 +7536,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" dependencies = [ "memchr", ] @@ -7674,7 +7696,7 @@ dependencies = [ "tracing", "uds_windows", "windows-sys 0.59.0", - "winnow 0.7.10", + "winnow 0.7.11", "zbus_macros", "zbus_names", "zvariant", @@ -7689,7 +7711,7 @@ dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", "zbus_names", "zvariant", "zvariant_utils", @@ -7703,7 +7725,7 @@ checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", - "winnow 0.7.10", + "winnow 0.7.11", "zvariant", ] @@ -7730,7 +7752,7 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", ] [[package]] @@ -7742,7 +7764,7 @@ dependencies = [ "endi", "enumflags2", "serde", - "winnow 0.7.10", + "winnow 0.7.11", "zvariant_derive", "zvariant_utils", ] @@ -7756,7 +7778,7 @@ dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.103", "zvariant_utils", ] @@ -7770,6 +7792,6 @@ dependencies = [ "quote", "serde", "static_assertions", - "syn 2.0.101", - "winnow 0.7.10", + "syn 2.0.103", + "winnow 0.7.11", ] diff --git a/Cargo.toml b/Cargo.toml index 68d4506..df31df4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ opt-level = 3 [patch.crates-io] bevy_mod_openxr = { git = "https://github.com/Schmarni-Dev/bevy_openxr", branch = "non_default_wait_frame_system" } bevy_mod_xr = { git = "https://github.com/Schmarni-Dev/bevy_openxr", branch = "non_default_wait_frame_system" } +bevy_gltf = { git = "https://github.com/Schmarni-Dev/bevy", branch = "gltf_backport" } [dependencies] # small utility thingys diff --git a/src/main.rs b/src/main.rs index 756c246..970a8db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,6 +50,7 @@ use directories::ProjectDirs; use nodes::drawable::model::ModelNodePlugin; use nodes::spatial::SpatialNodePlugin; use objects::ServerObjects; +use objects::input::sk_controller::ControllerPlugin; use objects::input::sk_hand::HandPlugin; use objects::play_space::PlaySpacePlugin; use openxr::{EnvironmentBlendMode, ReferenceSpaceType}; @@ -351,8 +352,7 @@ fn bevy_loop( .disable::() // we don't do any action stuff that needs to integrate with the ecosystem .disable::() - .disable::() - .disable::(), + .disable::(), ); app.add_plugins(( bevy_sk::hand::HandPlugin, @@ -390,8 +390,11 @@ fn bevy_loop( ModelNodePlugin, PlaySpacePlugin, HandPlugin, + ControllerPlugin, )); - ready_notifier.notify_waiters(); + app.add_systems(PostStartup, move || { + ready_notifier.notify_waiters(); + }); app.add_systems( XrFirst, xr_step diff --git a/src/nodes/drawable/model.rs b/src/nodes/drawable/model.rs index 1f99348..e893e05 100644 --- a/src/nodes/drawable/model.rs +++ b/src/nodes/drawable/model.rs @@ -146,7 +146,7 @@ fn gen_model_parts( mesh_entity: OnceLock::new(), path, space: spatial.clone(), - model: Arc::downgrade(&model), + _model: Arc::downgrade(&model), pending_material_parameters: Mutex::default(), pending_material_replacement: Mutex::default(), aliases: AliasList::default(), @@ -370,7 +370,7 @@ impl MaterialParameter { } } mat.alpha_mode = AlphaMode::AlphaToCoverage; - mat.use_stereokit_uvs = true; + mat.use_stereokit_uvs = false; } } } @@ -416,7 +416,7 @@ impl Material { .as_ref() .map(|p| asset_server.load(p.as_path())), spherical_harmonics: bevy_sk::skytext::SPHERICAL_HARMONICS_HANDLE, - use_stereokit_uvs: true, + use_stereokit_uvs: false, } } } @@ -426,7 +426,7 @@ pub struct ModelPart { mesh_entity: OnceLock, path: String, space: Arc, - model: Weak, + _model: Weak, pending_material_parameters: Mutex>, pending_material_replacement: Mutex>, aliases: AliasList, @@ -437,6 +437,11 @@ impl ModelPart { .lock() .replace(replacement); } + pub fn set_material_parameter(&self, parameter_name: String, value: MaterialParameter) { + self.pending_material_parameters + .lock() + .insert(parameter_name, value); + } } impl ModelPartAspect for ModelPart { #[doc = "Set this model part's material to one that cuts a hole in the world. Often used for overlays/passthrough where you want to show the background through an object."] @@ -465,11 +470,7 @@ impl ModelPartAspect for ModelPart { value: MaterialParameter, ) -> Result<()> { let model_part = node.get_aspect::()?; - model_part - .pending_material_parameters - .lock() - .insert(parameter_name, value); - + model_part.set_material_parameter(parameter_name, value); Ok(()) } } @@ -531,24 +532,15 @@ impl Model { node.add_aspect_raw(model.clone()); Ok(model) } -} -impl ModelAspect for Model { - #[doc = "Bind a model part to the node with the ID input."] - fn bind_model_part( - node: Arc, - calling_client: Arc, - id: u64, - part_path: String, - ) -> Result<()> { - let model = node.get_aspect::()?; - let part = match model + pub fn get_model_part(self: &Arc, part_path: String) -> Result> { + let part = match self .parts .get() .map(|v| v.iter().find(|p| p.path == part_path)) { Some(Some(part)) => part.clone(), Some(None) => { - let paths = model + let paths = self .parts .get() .unwrap() @@ -560,26 +552,38 @@ impl ModelAspect for Model { ); } None => { - let part_node = calling_client - .scenegraph - .add_node(Node::generate(&calling_client, false)); - let model = node.get_aspect::()?; + // TODO: this could be a denail of service vector + let client = self.space.node().unwrap().get_client().unwrap(); + let part_node = client.scenegraph.add_node(Node::generate(&client, false)); let spatial = - Spatial::add_to(&part_node, Some(model.space.clone()), Mat4::IDENTITY, false); + Spatial::add_to(&part_node, Some(self.space.clone()), Mat4::IDENTITY, false); let part = part_node.add_aspect(ModelPart { entity: OnceLock::new(), mesh_entity: OnceLock::new(), path: part_path, space: spatial, - model: Arc::downgrade(&model), + _model: Arc::downgrade(self), pending_material_parameters: Mutex::default(), pending_material_replacement: Mutex::default(), aliases: AliasList::default(), }); - model.pre_bound_parts.lock().push(part.clone()); + self.pre_bound_parts.lock().push(part.clone()); part } }; + Ok(part) + } +} +impl ModelAspect for Model { + #[doc = "Bind a model part to the node with the ID input."] + fn bind_model_part( + node: Arc, + calling_client: Arc, + id: u64, + part_path: String, + ) -> Result<()> { + let model = node.get_aspect::()?; + let part = model.get_model_part(part_path)?; Alias::create_with_id( &part.space.node().unwrap(), &calling_client, diff --git a/src/objects/input/sk_controller.rs b/src/objects/input/sk_controller.rs index ba35273..086192e 100644 --- a/src/objects/input/sk_controller.rs +++ b/src/objects/input/sk_controller.rs @@ -1,27 +1,236 @@ use super::{CaptureManager, get_sorted_handlers}; use crate::{ + DbusConnection, PreFrameWait, core::client::INTERNAL_CLIENT, nodes::{ Node, OwnedNode, + drawable::{ + MaterialParameter, + model::{Model, ModelPart}, + }, fields::{Field, FieldTrait}, input::{INPUT_HANDLER_REGISTRY, InputDataType, InputHandler, InputMethod, Tip}, spatial::Spatial, }, objects::{ObjectHandle, SpatialRef, Tracked}, }; +use bevy::{asset::Handle, ecs::resource::Resource}; +use bevy::{math::Affine3, prelude::*}; +use bevy_mod_openxr::{ + action_binding::{OxrSendActionBindings, OxrSuggestActionBinding}, + helper_traits::{ToIsometry3d, ToVec2}, + resources::{OxrFrameState, OxrInstance}, + session::OxrSession, +}; +use bevy_mod_xr::{ + hands::HandSide, + session::{XrPreDestroySession, XrSessionCreated, XrSessionCreatedEvent}, + spaces::{XrPrimaryReferenceSpace, XrReferenceSpace, XrSpace}, +}; +use bevy_sk::vr_materials::PbrMaterial; use color_eyre::eyre::Result; -use glam::{Mat4, Vec2, Vec3}; +use glam::{Affine3A, Mat4, Vec2, Vec3}; +use openxr::{Action, ActiveActionSet, SpaceLocationFlags}; use serde::{Deserialize, Serialize}; -use stardust_xr::values::Datamap; -use std::sync::Arc; +use stardust_xr::values::{Datamap, ResourceID, color::Rgb}; +use std::{ + borrow::Cow, + fs, + path::{Path, PathBuf}, + str::FromStr, + sync::Arc, +}; use stereokit_rust::{ material::Material, - model::Model, sk::MainThreadToken, system::{Handed, Input}, util::Color128, }; use zbus::Connection; +pub struct ControllerPlugin; +const CURSOR_MODEL_PATH: &str = "/tmp/stardust_server/models/cursor.glb"; +impl Plugin for ControllerPlugin { + fn build(&self, app: &mut App) { + let cursor = include_bytes!("cursor.glb"); + fs::create_dir_all( + PathBuf::from_str(CURSOR_MODEL_PATH) + .unwrap() + .parent() + .unwrap(), + ); + fs::write(CURSOR_MODEL_PATH, cursor).expect("can't write tmp cursor model file"); + app.add_systems(OxrSendActionBindings, suggest_bindings.run_if(run_once)); + app.add_systems( + PostUpdate, + create_spaces.run_if(on_event::), + ); + app.add_systems(XrPreDestroySession, destroy_spaces); + app.add_systems(Startup, setup.run_if(resource_exists::)); + app.add_systems(PreFrameWait, update); + } +} + +// the api is just slightly nicer when using the bevy_mod_openxr solution okay? +fn suggest_bindings( + instance: Res, + actions: Res, + mut suggest: EventWriter, +) { + let mut bind_all = |interaction_profile: &'static str, + bindings: &[(openxr::sys::Action, &[&'static str])]| { + for (action, bindings) in bindings { + suggest.write(OxrSuggestActionBinding { + action: *action, + interaction_profile: interaction_profile.into(), + bindings: bindings.iter().copied().map(Cow::Borrowed).collect(), + }); + } + }; + bind_all( + "/interaction_profiles/oculus/touch_controller", + &[ + ( + actions.trigger.as_raw(), + &[ + "/user/hand/left/input/trigger/value", + "/user/hand/right/input/trigger/value", + ], + ), + ( + actions.stick_click.as_raw(), + &[ + "/user/hand/left/input/thumbstick/click", + "/user/hand/right/input/thumbstick/click", + ], + ), + ( + actions.button.as_raw(), + &[ + "/user/hand/left/input/x/click", + "/user/hand/left/input/y/click", + "/user/hand/right/input/a/click", + "/user/hand/right/input/b/click", + ], + ), + ( + actions.grip.as_raw(), + &[ + "/user/hand/left/input/squeeze/value", + "/user/hand/right/input/squeeze/value", + ], + ), + ( + actions.stick.as_raw(), + &[ + "/user/hand/left/input/thumbstick", + "/user/hand/right/input/thumbstick", + ], + ), + ( + actions.space.as_raw(), + &[ + "/user/hand/left/input/aim/pose", + "/user/hand/right/input/aim/pose", + ], + ), + ], + ); +} + +fn update( + mut controllers: ResMut, + actions: Res, + session: Option>, + ref_space: Option>, + state: Option>, +) { + info!("calling update"); + let (Some(session), Some(state), Some(ref_space)) = (session, state, ref_space) else { + info!("something is missing"); + controllers.left.set_enabled(false); + controllers.right.set_enabled(false); + return; + }; + session + .sync_actions(&[ActiveActionSet::new(&actions.set)]) + .unwrap(); + let time = state.predicted_display_time; + // stupid bevy gltf loading issue (rotated 180 degrees on the y axis) + controllers + .left + .update(&session, &actions, time, ref_space.0); + controllers + .right + .update(&session, &actions, time, ref_space.0); +} + +fn create_spaces( + session: Res, + mut controllers: ResMut, + actions: Res, +) { + // if we ever need more actions than just these we should fully swith to the + // bevy_mod_openxr provided stuff + session.attach_action_sets(&[&actions.set]); + session + .sync_actions(&[ActiveActionSet::new(&actions.set)]) + .unwrap(); + + let instance = session.instance(); + let left = instance.string_to_path("/user/hand/left").unwrap(); + let right = instance.string_to_path("/user/hand/right").unwrap(); + let left = session + .create_action_space(&actions.space, left, Isometry3d::IDENTITY) + .unwrap(); + let right = session + .create_action_space(&actions.space, right, Isometry3d::IDENTITY) + .unwrap(); + controllers.left.space = Some(left); + controllers.right.space = Some(right); +} + +fn destroy_spaces(session: Res, mut controllers: ResMut) { + if let Some(space) = controllers.left.space.take() { + session.destroy_space(space); + } + if let Some(space) = controllers.right.space.take() { + session.destroy_space(space); + } +} + +fn setup(instance: Res, connection: Res, mut cmds: Commands) { + tokio::task::spawn({ + let connection = connection.clone(); + async move { + connection + .request_name("org.stardustxr.Controllers") + .await + .unwrap(); + } + }); + let set = instance + .create_action_set("input_method_actions", "Input Method Action Source", 0) + .unwrap(); + let paths = &[ + instance.string_to_path("/user/hand/left").unwrap(), + instance.string_to_path("/user/hand/right").unwrap(), + ]; + let actions = Actions { + trigger: set.create_action("trigger", "Select", paths).unwrap(), + stick_click: set.create_action("stick_click", "Middle", paths).unwrap(), + button: set.create_action("face_button", "Context", paths).unwrap(), + grip: set.create_action("grip", "Grab", paths).unwrap(), + stick: set.create_action("stick", "Scroll", paths).unwrap(), + space: set.create_action("pose", "Location", paths).unwrap(), + set, + }; + let controllers = Controllers { + left: SkController::new(&connection, HandSide::Left).unwrap(), + right: SkController::new(&connection, HandSide::Right).unwrap(), + }; + cmds.insert_resource(controllers); + cmds.insert_resource(actions); +} #[derive(Default, Debug, Deserialize, Serialize)] struct ControllerDatamap { @@ -31,58 +240,64 @@ struct ControllerDatamap { grab: f32, scroll: Vec2, } +#[derive(Resource)] +struct Actions { + set: openxr::ActionSet, + trigger: openxr::Action, + stick_click: openxr::Action, + button: openxr::Action, + grip: openxr::Action, + space: openxr::Action, + stick: openxr::Action, +} +#[derive(Resource)] +struct Controllers { + left: SkController, + right: SkController, +} pub struct SkController { object_handle: ObjectHandle, input: Arc, - handed: Handed, - model: Model, - material: Material, + side: HandSide, + model: Arc, + model_part: Arc, capture_manager: CaptureManager, datamap: ControllerDatamap, tracked: ObjectHandle, + space: Option, } impl SkController { - pub fn new(connection: &Connection, handed: Handed) -> Result { - Input::set_controller_model(handed, Some(Model::new())); + fn new(connection: &Connection, side: HandSide) -> Result { let path = "/org/stardustxr/Controller/".to_string() - + match handed { - Handed::Left => "left", - _ => "right", + + match side { + HandSide::Left => "left", + HandSide::Right => "right", }; let (spatial, object_handle) = SpatialRef::create(connection, &path); let tracked = Tracked::new(connection, &path); - let model = Model::copy(&Model::from_memory( - "cursor.glb", - include_bytes!("cursor.glb"), - None, - )?); - let model_nodes = model.get_nodes(); - let mut model_node = model_nodes.visuals().next().unwrap(); - let material = Material::copy(&model_node.get_material().unwrap()); - model_node.material(&material); let tip = InputDataType::Tip(Tip::default()); + let node = spatial.node().unwrap(); + let model = Model::add_to(&node, ResourceID::Direct(CURSOR_MODEL_PATH.into())).unwrap(); + let model_part = model.get_model_part("Cursor".to_string()).unwrap(); let input = InputMethod::add_to( - &spatial.node().unwrap(), + &node, tip, Datamap::from_typed(ControllerDatamap::default())?, )?; Ok(SkController { object_handle, input, - handed, + side, model, - material, + model_part, capture_manager: CaptureManager::default(), datamap: Default::default(), tracked, + space: None, }) } - pub fn update(&mut self, token: &MainThreadToken) { - let controller = Input::controller(self.handed); - let input_node = self.input.spatial.node().unwrap(); - input_node.set_enabled(controller.tracked.is_active()); - let enabled = input_node.enabled(); + pub fn set_enabled(&self, enabled: bool) { tokio::spawn({ // this is suboptimal since it probably allocates a fresh string every frame let handle = self.tracked.clone(); @@ -90,32 +305,77 @@ impl SkController { handle.set_tracked(enabled).await; } }); + } + fn update( + &mut self, + session: &OxrSession, + actions: &Actions, + time: openxr::Time, + ref_space: XrReferenceSpace, + ) { + let Some(space) = self.space.as_ref() else { + info!("no space 3:"); + return; + }; + let Ok(location) = session + .locate_space(space, &ref_space, time) + .inspect_err(|err| error!("error while locating controller space: {err}")) + else { + return; + }; + let enabled = location.location_flags.contains( + SpaceLocationFlags::POSITION_VALID + | SpaceLocationFlags::POSITION_TRACKED + | SpaceLocationFlags::ORIENTATION_VALID + | SpaceLocationFlags::ORIENTATION_TRACKED, + ); + info!("{:#?}", location.location_flags); + self.set_enabled(enabled); if enabled { - let world_transform = Mat4::from_rotation_translation( - controller.aim.orientation.into(), - controller.aim.position.into(), + info!("update"); + let world_transform = Mat4::from(Affine3A::from(location.pose.to_xr_pose())); + self.model_part + .set_material_parameter("roughness".to_string(), MaterialParameter::Float(1.0)); + // self.model_part + // .set_material_parameter("metallic".to_string(), MaterialParameter::Float(0.0)); + self.model_part.set_material_parameter( + "color".to_string(), + MaterialParameter::Color(stardust_xr::values::Color::new( + if self.capture_manager.capture.upgrade().is_none() { + Rgb::new(1.0, 1.0, 1.0) + } else { + Rgb::new(0.0, 1.0, 0.75) + }, + 1.0, + )), ); - self.material - .color_tint(if self.capture_manager.capture.upgrade().is_none() { - Color128::new_rgb(1.0, 1.0, 1.0) - } else { - Color128::new_rgb(0.0, 1.0, 0.75) - }); - self.model.draw( - token, - world_transform * Mat4::from_scale(Vec3::ONE * 0.02), - None, - None, - ); - self.input.spatial.set_local_transform(world_transform); + self.input + .spatial + .set_local_transform(world_transform * Mat4::from_scale(Vec3::splat(0.02))); + } + let path = session + .instance() + .string_to_path(match self.side { + HandSide::Left => "/user/hand/left", + HandSide::Right => "/user/hand/right", + }) + .unwrap(); + fn get( + session: &OxrSession, + path: openxr::Path, + action: &Action, + ) -> T { + action + .state(session, path) + .map(|v| v.current_state) + .unwrap_or_default() } - self.datamap = ControllerDatamap { - select: controller.trigger, - middle: controller.stick_click.is_active() as u32 as f32, - context: controller.is_x2_pressed() as u32 as f32, - grab: controller.grip, - scroll: controller.stick.into(), + select: get(session, path, &actions.trigger), + middle: get(session, path, &actions.stick_click) as u32 as f32, + context: get(session, path, &actions.button) as u32 as f32, + grab: get(session, path, &actions.grip), + scroll: get(session, path, &actions.stick).to_vec2(), }; *self.input.datamap.lock() = Datamap::from_typed(&self.datamap).unwrap(); diff --git a/src/objects/mod.rs b/src/objects/mod.rs index aae5d36..dba3085 100644 --- a/src/objects/mod.rs +++ b/src/objects/mod.rs @@ -33,8 +33,8 @@ pub mod play_space; enum Inputs { XR { - controller_left: SkController, - controller_right: SkController, + // controller_left: SkController, + // controller_right: SkController, // hand_left: SkHand, // hand_right: SkHand, eye_pointer: Option, @@ -95,8 +95,6 @@ impl ServerObjects { let inputs = if sk.get_active_display_mode() == DisplayMode::MixedReality { Inputs::XR { - controller_left: SkController::new(&connection, Handed::Left).unwrap(), - controller_right: SkController::new(&connection, Handed::Right).unwrap(), // hand_left: SkHand::new(&connection, Handed::Left).unwrap(), // hand_right: SkHand::new(&connection, Handed::Right).unwrap(), eye_pointer: Device::has_eye_gaze() @@ -166,14 +164,14 @@ impl ServerObjects { match &mut self.inputs { Inputs::XR { - controller_left, - controller_right, + // controller_left, + // controller_right, eye_pointer, } => { - if !self.disable_controllers { - controller_left.update(token); - controller_right.update(token); - } + // if !self.disable_controllers { + // controller_left.update(token); + // controller_right.update(token); + // } Input::hand_visible(Handed::Left, !self.disable_hands); Input::hand_visible(Handed::Right, !self.disable_hands); // if !self.disable_hands { -- 2.49.1 From 51e8cfd1b2d27495f2386cf36b63db570c3a502d Mon Sep 17 00:00:00 2001 From: Schmarni Date: Thu, 19 Jun 2025 00:57:56 +0200 Subject: [PATCH 04/17] feat: disable controller methods if the interaction profile matches khr/simple_controller Signed-off-by: Schmarni --- src/objects/input/sk_controller.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/objects/input/sk_controller.rs b/src/objects/input/sk_controller.rs index 086192e..d953ece 100644 --- a/src/objects/input/sk_controller.rs +++ b/src/objects/input/sk_controller.rs @@ -135,6 +135,16 @@ fn suggest_bindings( ), ], ); + bind_all( + "/interaction_profiles/khr/simple_controller", + &[( + actions.space.as_raw(), + &[ + "/user/hand/left/input/aim/pose", + "/user/hand/right/input/aim/pose", + ], + )], + ); } fn update( @@ -360,6 +370,13 @@ impl SkController { HandSide::Right => "/user/hand/right", }) .unwrap(); + if let Ok(path) = session.current_interaction_profile(path) { + if session.instance().path_to_string(path).unwrap() + == "/interaction_profiles/khr/simple_controller" + { + self.set_enabled(false); + } + } fn get( session: &OxrSession, path: openxr::Path, -- 2.49.1 From 20d2917847ebad6877bd80dc11ef177d9b0b66bc Mon Sep 17 00:00:00 2001 From: Schmarni Date: Wed, 25 Jun 2025 11:50:57 +0200 Subject: [PATCH 05/17] feat: mostly reimpl text rendering Signed-off-by: Schmarni --- Cargo.lock | 154 +++++++++----- Cargo.toml | 7 +- src/core/mod.rs | 1 + src/main.rs | 30 ++- src/nodes/drawable/mod.rs | 1 - src/nodes/drawable/model.rs | 72 ++++--- src/nodes/drawable/text.rs | 316 +++++++++++++++++++---------- src/nodes/input/mod.rs | 5 + src/nodes/spatial/mod.rs | 59 ++---- src/objects/input/sk_controller.rs | 6 +- 10 files changed, 411 insertions(+), 240 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f621a25..102fd51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -618,6 +618,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b8369c16b7c017437021341521f8b4a0d98e1c70113fb358c3258ae7d661d79" dependencies = [ "bevy_internal", + "tracing", +] + +[[package]] +name = "bevy-mesh-text-3d" +version = "0.1.0" +source = "git+https://github.com/terhechte/bevy-mesh-text-3d#77d8ae6935af636bcb85251b1debbc7f3d618f74" +dependencies = [ + "bevy", + "cosmic-text 0.14.2", + "lyon", + "thiserror 2.0.12", ] [[package]] @@ -686,6 +698,7 @@ dependencies = [ "downcast-rs 2.0.1", "log", "thiserror 2.0.12", + "tracing", "variadics_please", "wasm-bindgen", "web-sys", @@ -861,6 +874,7 @@ dependencies = [ "serde", "smallvec", "thiserror 2.0.12", + "tracing", "variadics_please", ] @@ -1092,9 +1106,11 @@ dependencies = [ "bevy_ecs", "bevy_utils", "tracing", + "tracing-error", "tracing-log", "tracing-oslog", "tracing-subscriber", + "tracing-tracy", "tracing-wasm", ] @@ -1165,16 +1181,6 @@ dependencies = [ "glam", ] -[[package]] -name = "bevy_mod_meshtext" -version = "0.1.0" -source = "git+https://github.com/Schmarni-Dev/bevy_mod_meshtext#b623971b5a4d0ee0a93a2f89096726b9b7c9c87a" -dependencies = [ - "atomicow", - "bevy", - "meshtext", -] - [[package]] name = "bevy_mod_openxr" version = "0.3.0" @@ -1388,11 +1394,13 @@ dependencies = [ "naga_oil", "nonmax", "offset-allocator", + "profiling", "send_wrapper", "serde", "smallvec", "thiserror 2.0.12", "tracing", + "tracy-client", "variadics_please", "wasm-bindgen", "web-sys", @@ -1542,7 +1550,7 @@ dependencies = [ "bevy_transform", "bevy_utils", "bevy_window", - "cosmic-text", + "cosmic-text 0.13.2", "serde", "smallvec", "sys-locale", @@ -1913,16 +1921,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "cdt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91b872294f63ef586b32aa94141561681aa35ca2d703960cca4f661f4e18184" -dependencies = [ - "geometry-predicates", - "thiserror 1.0.69", -] - [[package]] name = "cesu8" version = "1.1.0" @@ -2283,6 +2281,29 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cosmic-text" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da46a9d5a8905cc538a4a5bceb6a4510de7a51049c5588c0114efce102bcbbe8" +dependencies = [ + "bitflags 2.9.1", + "fontdb", + "log", + "rangemap", + "rustc-hash 1.1.0", + "rustybuzz", + "self_cell", + "smol_str", + "swash", + "sys-locale", + "ttf-parser 0.21.1", + "unicode-bidi", + "unicode-linebreak", + "unicode-script", + "unicode-segmentation", +] + [[package]] name = "cpal" version = "0.15.3" @@ -2809,6 +2830,12 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "float_next_after" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" + [[package]] name = "fnv" version = "1.0.7" @@ -2975,12 +3002,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "geometry-predicates" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dba84198cf199c11b83f1cb9243eaeb70dc50b719d2835ebf34bf2481bca010" - [[package]] name = "gethostname" version = "0.4.3" @@ -3861,6 +3882,58 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "lyon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e7f9cda98b5430809e63ca5197b06c7d191bf7e26dfc467d5a3f0290e2a74f" +dependencies = [ + "lyon_algorithms", + "lyon_tessellation", +] + +[[package]] +name = "lyon_algorithms" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f13c9be19d257c7d37e70608ed858e8eab4b2afcea2e3c9a622e892acbf43c08" +dependencies = [ + "lyon_path", + "num-traits", +] + +[[package]] +name = "lyon_geom" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8af69edc087272df438b3ee436c4bb6d7c04aa8af665cfd398feae627dbd8570" +dependencies = [ + "arrayvec", + "euclid", + "num-traits", +] + +[[package]] +name = "lyon_path" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0047f508cd7a85ad6bad9518f68cce7b1bf6b943fb71f6da0ee3bc1e8cb75f25" +dependencies = [ + "lyon_geom", + "num-traits", +] + +[[package]] +name = "lyon_tessellation" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579d42360a4b09846eff2feef28f538696c7d6c7439bfa65874ff3cbe0951b2c" +dependencies = [ + "float_next_after", + "lyon_path", + "num-traits", +] + [[package]] name = "mach2" version = "0.4.2" @@ -3930,18 +4003,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "meshtext" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c68541f06674ef4bb1f84e3dca654998135ff1a8bb5a60cfbfe5b8615f8e555" -dependencies = [ - "cdt", - "glam", - "owned_ttf_parser", - "ttf-parser 0.25.1", -] - [[package]] name = "metal" version = "0.31.0" @@ -4959,6 +5020,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" dependencies = [ "profiling-procmacros", + "tracing", ] [[package]] @@ -5729,13 +5791,14 @@ name = "stardust-xr-server" version = "0.45.0" dependencies = [ "bevy", - "bevy_mod_meshtext", + "bevy-mesh-text-3d", "bevy_mod_openxr", "bevy_mod_xr", "bevy_sk", "clap", "color-eyre", "console-subscriber", + "cosmic-text 0.14.2", "dashmap", "directories", "glam", @@ -6339,8 +6402,7 @@ dependencies = [ [[package]] name = "tracing-tracy" version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eaa1852afa96e0fe9e44caa53dc0bd2d9d05e0f2611ce09f97f8677af56e4ba" +source = "git+https://github.com/nagisa/rust_tracy_client?tag=tracy-client-v0.18.1#7d084307f54959999ca3729c42bd4f4f3f0df54d" dependencies = [ "tracing-core", "tracing-subscriber", @@ -6361,8 +6423,7 @@ dependencies = [ [[package]] name = "tracy-client" version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3927832d93178f979a970d26deed7b03510586e328f31b0f9ad7a73985b8332a" +source = "git+https://github.com/nagisa/rust_tracy_client?tag=tracy-client-v0.18.1#7d084307f54959999ca3729c42bd4f4f3f0df54d" dependencies = [ "loom", "once_cell", @@ -6372,11 +6433,10 @@ dependencies = [ [[package]] name = "tracy-client-sys" version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c032d68a49d25d9012a864fef1c64ac17aee43c87e0477bf7301d8ae8bfea7b7" +source = "git+https://github.com/nagisa/rust_tracy_client?tag=tracy-client-v0.18.1#7d084307f54959999ca3729c42bd4f4f3f0df54d" dependencies = [ "cc", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index df31df4..392f90a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,8 @@ path = "src/main.rs" default = [] wayland = ["dep:smithay", "dep:wayland-scanner", "dep:wayland-backend"] profile_tokio = ["dep:console-subscriber", "tokio/tracing"] -profile_app = ["dep:tracing-tracy"] +profile_app = ["dep:tracing-tracy", "bevy/trace_tracy"] +change_tracking = ["bevy/track_location"] [package.metadata.appimage] auto_link = true @@ -81,9 +82,10 @@ tokio = { version = "1.39.2", features = ["rt-multi-thread", "signal", "time"] } bevy = { version = "0.16", features = ["wayland", "bevy_remote"] } bevy_mod_xr = "0.3" bevy_mod_openxr = "0.3" -bevy_mod_meshtext.git = "https://github.com/Schmarni-Dev/bevy_mod_meshtext" +# bevy_mod_meshtext.git = "https://github.com/Schmarni-Dev/bevy_mod_meshtext" # bevy_sk.git = "https://github.com/MalekiRe/bevy_sk" # bevy_sk = { git = "https://github.com/Schmarni-Dev/bevy_sk", branch = "fix_mat_stuff" } +bevy-mesh-text-3d.git = "https://github.com/terhechte/bevy-mesh-text-3d" bevy_sk.path = "../bevy_sk" openxr = "0.19" @@ -97,6 +99,7 @@ xkbcommon-rs = "0.1.0" # wayland wayland-backend = { version = "0.3.7", optional = true, default-features = false } wayland-scanner = { version = "0.31.4", optional = true } +cosmic-text = "0.14.2" [dependencies.smithay] diff --git a/src/core/mod.rs b/src/core/mod.rs index 594fe29..d2385de 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -7,3 +7,4 @@ pub mod registry; pub mod resource; pub mod scenegraph; pub mod task; +pub mod color; diff --git a/src/main.rs b/src/main.rs index 970a8db..2edb0bc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,28 +12,25 @@ use crate::nodes::{audio, drawable, input}; use bevy::MinimalPlugins; use bevy::a11y::AccessibilityPlugin; -use bevy::app::{App, MainScheduleOrder, ScheduleRunnerPlugin, TerminalCtrlCHandlerPlugin}; +use bevy::app::{App, TerminalCtrlCHandlerPlugin}; use bevy::asset::{AssetMetaCheck, UnapprovedPathMode}; use bevy::audio::AudioPlugin; use bevy::core_pipeline::CorePipelinePlugin; +use bevy::diagnostic::DiagnosticsPlugin; use bevy::ecs::schedule::{ExecutorKind, ScheduleLabel}; use bevy::gizmos::GizmoPlugin; use bevy::gltf::GltfPlugin; -use bevy::input::{InputPlugin, InputSystem}; +use bevy::input::InputPlugin; use bevy::pbr::PbrPlugin; use bevy::remote::RemotePlugin; use bevy::remote::http::RemoteHttpPlugin; use bevy::render::{RenderDebugFlags, RenderPlugin}; use bevy::scene::ScenePlugin; use bevy::text::FontLoader; -use bevy::winit::{WakeUp, WinitPlugin}; -use bevy_mod_meshtext::MeshTextPlugin; -use bevy_mod_openxr::action_binding::OxrActionBindingPlugin; use bevy_mod_openxr::action_set_attaching::OxrActionAttachingPlugin; use bevy_mod_openxr::action_set_syncing::OxrActionSyncingPlugin; use bevy_mod_openxr::add_xr_plugins; use bevy_mod_openxr::exts::OxrExtensions; -use bevy_mod_openxr::features::handtracking::HandTrackingPlugin; use bevy_mod_openxr::features::overlay::OxrOverlaySettings; use bevy_mod_openxr::features::passthrough::OxrPassthroughPlugin; use bevy_mod_openxr::init::{OxrInitPlugin, should_run_frame_loop}; @@ -42,12 +39,13 @@ use bevy_mod_openxr::render::{OxrRenderPlugin, OxrWaitFrameSystem}; use bevy_mod_openxr::resources::{OxrFrameState, OxrFrameWaiter, OxrSessionConfig}; use bevy_mod_openxr::types::AppInfo; use bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin; -use bevy_mod_xr::session::{XrFirst, XrHandleEvents, session_running}; +use bevy_mod_xr::session::{XrFirst, XrHandleEvents}; use clap::Parser; use core::client::{Client, tick_internal_client}; use core::task; use directories::ProjectDirs; use nodes::drawable::model::ModelNodePlugin; +use nodes::drawable::text::TextNodePlugin; use nodes::spatial::SpatialNodePlugin; use objects::ServerObjects; use objects::input::sk_controller::ControllerPlugin; @@ -272,8 +270,7 @@ fn bevy_loop( ..default() }); let mut plugins = MinimalPlugins - .build() - // .disable::() + .build().add(DiagnosticsPlugin) .add(TransformPlugin) .add(InputPlugin) /* .add(AccessibilityPlugin) */; @@ -354,6 +351,7 @@ fn bevy_loop( .disable::() .disable::(), ); + // font size is in meters app.add_plugins(( bevy_sk::hand::HandPlugin, bevy_sk::vr_materials::SkMaterialPlugin { @@ -363,7 +361,7 @@ fn bevy_loop( )); app.add_plugins(HandGizmosPlugin); // app.add_plugins(MeshTextPlugin); - // app.init_asset::().init_asset_loader::(); + app.init_asset::().init_asset_loader::(); if let Some(priority) = args.overlay_priority { app.insert_resource(OxrOverlaySettings { session_layer_placement: priority, @@ -388,6 +386,7 @@ fn bevy_loop( app.add_plugins(( SpatialNodePlugin, ModelNodePlugin, + TextNodePlugin, PlaySpacePlugin, HandPlugin, ControllerPlugin, @@ -401,6 +400,17 @@ fn bevy_loop( .in_set(OxrWaitFrameSystem) .in_set(XrHandleEvents::FrameLoop), ); + use std::process::Command; + + let output = Command::new("fc-match") + .arg("-f") + .arg("%{file}") + .output() + .expect("Failed to run fc-match"); + + let font_path = String::from_utf8_lossy(&output.stdout); + info!("Default font path: {}", font_path); + app.run(); } diff --git a/src/nodes/drawable/mod.rs b/src/nodes/drawable/mod.rs index 58f64d6..a1ec88e 100644 --- a/src/nodes/drawable/mod.rs +++ b/src/nodes/drawable/mod.rs @@ -23,7 +23,6 @@ use stereokit_rust::{sk::MainThreadToken, system::Renderer, tex::SHCubemap}; // #[instrument(level = "debug", skip(sk))] pub fn draw(token: &MainThreadToken) { lines::draw_all(token); - text::draw_all(token); match QUEUED_SKYTEX.lock().take() { Some(Some(skytex)) => { if let Ok(skytex) = SHCubemap::from_cubemap(skytex, true, 100) { diff --git a/src/nodes/drawable/model.rs b/src/nodes/drawable/model.rs index e893e05..2671156 100644 --- a/src/nodes/drawable/model.rs +++ b/src/nodes/drawable/model.rs @@ -1,6 +1,7 @@ use super::{MODEL_PART_ASPECT_ALIAS_INFO, MaterialParameter, ModelAspect, ModelPartAspect}; use crate::bail; use crate::core::client::Client; +use crate::core::color::ColorConvert as _; use crate::core::error::Result; use crate::core::registry::Registry; use crate::core::resource::get_resource_file; @@ -27,9 +28,13 @@ impl Plugin for ModelNodePlugin { fn build(&self, app: &mut App) { let (tx, rx) = mpsc::unbounded_channel(); LOAD_MODEL.set(tx).unwrap(); + app.init_resource::(); app.insert_resource(MpscReceiver(rx)); app.add_systems(Update, load_models); - app.add_systems(PostUpdate, (gen_model_parts, apply_materials).chain()); + app.add_systems( + PostUpdate, + (gen_model_parts, apply_materials, update_visibillity).chain(), + ); } } @@ -38,6 +43,24 @@ struct MpscReceiver(mpsc::UnboundedReceiver); #[derive(Component)] struct ModelNode(Weak); +fn update_visibillity(mut cmds: Commands) { + for model in MODEL_REGISTRY.get_valid_contents().into_iter() { + let Some(entity) = model.bevy_scene_entity.get().copied() else { + continue; + }; + match model.spatial.node().map(|n| n.enabled()).unwrap_or(false) { + true => { + cmds.entity(entity) + .insert_recursive::(Visibility::Visible); + } + false => { + cmds.entity(entity) + .insert_recursive::(Visibility::Hidden); + } + } + } +} + fn load_models( asset_server: Res, mut cmds: Commands, @@ -50,7 +73,7 @@ fn load_models( .spawn(( SceneRoot(handle), ModelNode(Arc::downgrade(&model)), - SpatialNode(Arc::downgrade(&model.space)), + SpatialNode(Arc::downgrade(&model.spatial)), )) .id(); model.bevy_scene_entity.set(entity).unwrap(); @@ -59,7 +82,7 @@ fn load_models( fn apply_materials( mut query: Query<&mut MeshMaterial3d>, - mut material_registry: Local, + mut material_registry: ResMut, asset_server: Res, mut materials: ResMut>, ) -> bevy::prelude::Result { @@ -69,7 +92,9 @@ fn apply_materials( .filter_map(|p| p.parts.get()) .flatten() { - let mut mesh_mat = query.get_mut(*model_part.mesh_entity.get().unwrap())?; + let Ok(mut mesh_mat) = query.get_mut(*model_part.mesh_entity.get().unwrap()) else { + continue; + }; if let Some(material) = model_part.pending_material_replacement.lock().take() { let pbr_mat = material.to_pbr_mat(&asset_server); let handle = material_registry.get_handle(pbr_mat, &mut materials); @@ -128,8 +153,8 @@ fn gen_model_parts( let parent_spatial = parent .as_ref() .map(|p| p.space.clone()) - .unwrap_or_else(|| model.space.clone()); - let client = model.space.node()?.get_client()?; + .unwrap_or_else(|| model.spatial.clone()); + let client = model.spatial.node()?.get_client()?; let (spatial, model_part) = match model.pre_bound_parts.lock().iter().find(|v| v.path == path) { None => { @@ -341,16 +366,13 @@ impl MaterialParameter { MaterialParameter::Vec3(_val) => { // nothing uses a Vec3 } - MaterialParameter::Color(val) => { - let rgba = Srgba::new(val.c.r, val.c.g, val.c.b, val.a); - match parameter_name { - "color" => mat.color = rgba.into(), - "emission_factor" => mat.emission_factor = rgba.into(), - v => { - error!("unknown param_name ({v}) for color") - } + MaterialParameter::Color(color) => match parameter_name { + "color" => mat.color = color.to_bevy(), + "emission_factor" => mat.emission_factor = color.to_bevy(), + v => { + error!("unknown param_name ({v}) for color") } - } + }, MaterialParameter::Texture(resource) => { let Some(texture_path) = get_resource_file(resource, client, &[OsStr::new("png"), OsStr::new("jpg")]) @@ -474,11 +496,11 @@ impl ModelPartAspect for ModelPart { Ok(()) } } -#[derive(Default)] -struct MaterialRegistry(FxHashMap>); +#[derive(Default, Resource)] +pub struct MaterialRegistry(FxHashMap>); impl MaterialRegistry { /// returns strong handle for PbrMaterial elminitating duplications - fn get_handle( + pub fn get_handle( &mut self, material: PbrMaterial, materials: &mut ResMut>, @@ -500,7 +522,7 @@ impl MaterialRegistry { } pub struct Model { - space: Arc, + spatial: Arc, _resource_id: ResourceID, bevy_scene_entity: OnceLock, parts: OnceLock>>, @@ -516,7 +538,7 @@ impl Model { .ok_or_else(|| eyre!("Resource not found"))?; let model = Arc::new(Model { - space: node.get_aspect::().unwrap().clone(), + spatial: node.get_aspect::().unwrap().clone(), _resource_id: resource_id, bevy_scene_entity: OnceLock::new(), pre_bound_parts: Mutex::default(), @@ -553,10 +575,14 @@ impl Model { } None => { // TODO: this could be a denail of service vector - let client = self.space.node().unwrap().get_client().unwrap(); + let client = self.spatial.node().unwrap().get_client().unwrap(); let part_node = client.scenegraph.add_node(Node::generate(&client, false)); - let spatial = - Spatial::add_to(&part_node, Some(self.space.clone()), Mat4::IDENTITY, false); + let spatial = Spatial::add_to( + &part_node, + Some(self.spatial.clone()), + Mat4::IDENTITY, + false, + ); let part = part_node.add_aspect(ModelPart { entity: OnceLock::new(), mesh_entity: OnceLock::new(), diff --git a/src/nodes/drawable/text.rs b/src/nodes/drawable/text.rs index 282553e..b205feb 100644 --- a/src/nodes/drawable/text.rs +++ b/src/nodes/drawable/text.rs @@ -1,48 +1,223 @@ use crate::{ core::{ - client::Client, destroy_queue, error::Result, registry::Registry, + client::Client, color::ColorConvert, error::Result, registry::Registry, resource::get_resource_file, }, - nodes::{Node, spatial::Spatial}, + nodes::{ + Node, + drawable::XAlign, + spatial::{Spatial, SpatialNode}, + }, }; +use bevy::{platform::collections::HashMap, prelude::*}; +use bevy_mesh_text_3d::{ + Align, Attrs, MeshTextPlugin, Settings as FontSettings, generate_meshes, + text_glyphs::TextGlyphs, +}; +use bevy_sk::vr_materials::PbrMaterial; use color_eyre::eyre::eyre; -use glam::{Mat4, Vec2, vec3}; +use core::f32; +use cosmic_text::Metrics; use parking_lot::Mutex; use std::{ ffi::OsStr, + mem, path::PathBuf, sync::{Arc, OnceLock}, }; -use stereokit_rust::{ - font::Font, - sk::MainThreadToken, - system::{TextAlign, TextFit, TextStyle as SkTextStyle}, - util::{Color32, Color128}, -}; +use tokio::sync::mpsc; -use super::{TextAspect, TextStyle}; +static SPAWN_TEXT: OnceLock>> = OnceLock::new(); -static TEXT_REGISTRY: Registry = Registry::new(); +#[derive(Resource)] +struct MpscReceiver(mpsc::UnboundedReceiver); -fn convert_align(x_align: super::XAlign, y_align: super::YAlign) -> TextAlign { - match (x_align, y_align) { - (super::XAlign::Left, super::YAlign::Top) => TextAlign::TopLeft, - (super::XAlign::Left, super::YAlign::Center) => TextAlign::CenterLeft, - (super::XAlign::Left, super::YAlign::Bottom) => TextAlign::BottomLeft, - (super::XAlign::Center, super::YAlign::Top) => TextAlign::Center, - (super::XAlign::Center, super::YAlign::Center) => TextAlign::Center, - (super::XAlign::Center, super::YAlign::Bottom) => TextAlign::BottomCenter, - (super::XAlign::Right, super::YAlign::Top) => TextAlign::TopRight, - (super::XAlign::Right, super::YAlign::Center) => TextAlign::CenterRight, - (super::XAlign::Right, super::YAlign::Bottom) => TextAlign::BottomRight, +pub struct TextNodePlugin; + +impl Plugin for TextNodePlugin { + fn build(&self, app: &mut App) { + // Text init stuff + // app.init_asset::().init_asset_loader::(); + // load_internal_binary_asset!( + // app, + // Handle::default(), + // "assets/FiraMono-subset.ttf", + // |bytes: &[u8], _path: String| { Font::try_from_bytes(bytes.to_vec()).unwrap() } + // ); + // 1.0 for font size in meters + app.add_plugins(MeshTextPlugin::new(1.0)); + app.world_mut() + .resource_mut::() + .font_system + .db_mut() + .load_system_fonts(); + + let (tx, rx) = mpsc::unbounded_channel(); + SPAWN_TEXT.set(tx).unwrap(); + app.init_resource::(); + app.insert_resource(MpscReceiver(rx)); + app.add_systems(Update, (spawn_text, update_visibillity).chain()); } } -pub struct Text { - space: Arc, - font_path: Option, - style: OnceLock, +fn update_visibillity(mut cmds: Commands) { + for text in TEXT_REGISTRY.get_valid_contents().into_iter() { + let Some(entity) = text.entity.lock().as_ref().copied() else { + continue; + }; + match text.spatial.node().map(|n| n.enabled()).unwrap_or(false) { + true => { + cmds.entity(entity) + .insert_recursive::(Visibility::Visible); + } + false => { + cmds.entity(entity) + .insert_recursive::(Visibility::Hidden); + } + } + } +} +fn spawn_text( + mut mpsc: ResMut>>, + mut cmds: Commands, + mut font_settings: ResMut, + mut material_registry: ResMut, + mut materials: ResMut>, + mut meshes: ResMut>, + mut font_registry: Local, +) { + while let Ok(text) = mpsc.0.try_recv() { + if let Some(entity) = text.entity.lock().take() { + cmds.entity(entity).despawn(); + } + let style = text.data.lock(); + let old_db = text.font_path.clone().map(|p| { + let db = font_registry.get(p); + mem::swap(font_settings.font_system.db_mut(), db); + db + }); + let attrs = Attrs::new().weight(cosmic_text::Weight::BOLD); + let alignment = Some(match style.text_align_x { + super::XAlign::Left => Align::Right, + super::XAlign::Center => Align::Center, + super::XAlign::Right => Align::Left, + }); + let text_string = text.text.lock().clone(); + let mut text_glyphs = TextGlyphs::new( + Metrics { + font_size: style.character_height, + line_height: style.character_height, + }, + [(text_string.as_str(), attrs.clone())], + &attrs, + &mut font_settings.font_system, + alignment, + ); + let max_width = style.bounds.as_ref().map(|v| v.bounds.x); + let max_height = style.bounds.as_ref().map(|v| v.bounds.x); + let (width, height) = + text_glyphs.measure(max_width, max_height, &mut font_settings.font_system); + info!(width, height, ?style.text_align_x); + let meshes = generate_meshes( + bevy_mesh_text_3d::InputText::Simple { + text: text_string, + material: material_registry.get_handle( + PbrMaterial { + color: style.color.to_bevy(), + emission_factor: Color::WHITE, + metallic: 0.0, + roughness: 1.0, + // If alpha is supported on text we need to change this + alpha_mode: AlphaMode::Opaque, + double_sided: false, + ..default() + }, + &mut materials, + ), + attrs, + }, + &mut font_settings, + bevy_mesh_text_3d::Parameters { + extrusion_depth: 0.0, + font_size: style.character_height, + line_height: style.character_height, + alignment, + max_width, + max_height, + }, + &mut meshes, + ); + if let Some(db) = old_db { + mem::swap(font_settings.font_system.db_mut(), db); + } + let Ok(meshes) = meshes.inspect_err(|err| error!("unable to create text meshes: {err}")) + else { + continue; + }; + let dist = meshes.iter().fold(f32::MAX, |dist, v| { + dist.min(v.transform.translation.x) + // if dist > v.transform.translation.x { + // v.transform.translation.x + // } else { + // dist + // } + }); + // TODO: text align + let letters = meshes + .into_iter() + .map(|v| { + // info!("{:?}", v.transform); + cmds.spawn(( + Mesh3d(v.mesh), + MeshMaterial3d(v.material), + // rotation is sus, might be related to the gltf coordinate system + Transform::from_rotation(Quat::from_rotation_y(f32::consts::PI)) + * Transform::from_xyz( + -dist + + match style.bounds.as_ref().map(|v| v.anchor_align_x) { + Some(XAlign::Center) => width * -0.5, + Some(XAlign::Right) => width * -1.0, + Some(XAlign::Left) => 0.0, + None => 0.0, + }, + 0.0, + 0.0, + ) * v.transform, + )) + .id() + }) + .collect::>(); + let entity = cmds + .spawn((SpatialNode(Arc::downgrade(&text.spatial)),)) + .add_children(&letters) + .id(); + text.entity.lock().replace(entity); + } +} + +#[derive(Default)] +struct FontDatabaseRegistry(HashMap); +impl FontDatabaseRegistry { + fn get(&mut self, path: PathBuf) -> &mut cosmic_text::fontdb::Database { + self.0.entry(path).or_insert_with_key(|path| { + let mut db = cosmic_text::fontdb::Database::new(); + if let Err(err) = db.load_font_file(path) { + error!("unable to load font file {} {err}", path.to_string_lossy()); + }; + db + }) + } +} + +use super::{TextAspect, TextStyle, model::MaterialRegistry}; + +static TEXT_REGISTRY: Registry = Registry::new(); + +pub struct Text { + spatial: Arc, + font_path: Option, + entity: Mutex>, text: Mutex, data: Mutex, } @@ -50,88 +225,20 @@ impl Text { pub fn add_to(node: &Arc, text: String, style: TextStyle) -> Result> { let client = node.get_client().ok_or_else(|| eyre!("Client not found"))?; let text = TEXT_REGISTRY.add(Text { - space: node.get_aspect::().unwrap().clone(), + spatial: node.get_aspect::().unwrap().clone(), font_path: style.font.as_ref().and_then(|res| { get_resource_file(res, &client, &[OsStr::new("ttf"), OsStr::new("otf")]) }), - style: OnceLock::new(), + entity: Mutex::new(None), text: Mutex::new(text), data: Mutex::new(style), }); node.add_aspect_raw(text.clone()); + _ = SPAWN_TEXT.get().unwrap().send(text.clone()); Ok(text) } - - fn draw(&self, token: &MainThreadToken) { - let style = self.style.get_or_init(|| { - let font = self - .font_path - .as_deref() - .and_then(|path| Font::from_file(path).ok()) - .unwrap_or_default(); - SkTextStyle::from_font(font, 1.0, Color32::WHITE) - }); - - let text = self.text.lock(); - let data = self.data.lock(); - let transform = self.space.global_transform() - * Mat4::from_scale(vec3( - data.character_height, - data.character_height, - data.character_height, - )); - if let Some(bounds) = &data.bounds { - stereokit_rust::system::Text::add_in( - token, - &*text, - transform, - Vec2::from(bounds.bounds) / data.character_height, - match bounds.fit { - super::TextFit::Wrap => TextFit::Wrap, - super::TextFit::Clip => TextFit::Clip, - super::TextFit::Squeeze => TextFit::Squeeze, - super::TextFit::Exact => TextFit::Exact, - super::TextFit::Overflow => TextFit::Overflow, - }, - Some(*style), - Some(Color128::new( - data.color.c.r, - data.color.c.g, - data.color.c.b, - data.color.a, - )), - data.bounds - .as_ref() - .map(|b| convert_align(b.anchor_align_x, b.anchor_align_y)), - Some(convert_align(data.text_align_x, data.text_align_y)), - None, - None, - None, - ); - } else { - stereokit_rust::system::Text::add_at( - token, - &*text, - transform, - Some(*style), - Some(Color128::new( - data.color.c.r, - data.color.c.g, - data.color.c.b, - data.color.a, - )), - data.bounds - .as_ref() - .map(|b| convert_align(b.anchor_align_x, b.anchor_align_y)), - Some(convert_align(data.text_align_x, data.text_align_y)), - None, - None, - None, - ); - } - } } impl TextAspect for Text { fn set_character_height( @@ -141,30 +248,19 @@ impl TextAspect for Text { ) -> Result<()> { let this_text = node.get_aspect::()?; this_text.data.lock().character_height = height; + _ = SPAWN_TEXT.get().unwrap().send(this_text.clone()); Ok(()) } fn set_text(node: Arc, _calling_client: Arc, text: String) -> Result<()> { let this_text = node.get_aspect::()?; *this_text.text.lock() = text; + _ = SPAWN_TEXT.get().unwrap().send(this_text.clone()); Ok(()) } } impl Drop for Text { fn drop(&mut self) { - if let Some(style) = self.style.take() { - destroy_queue::add(style); - } TEXT_REGISTRY.remove(self); } } - -pub fn draw_all(token: &MainThreadToken) { - for text in TEXT_REGISTRY.get_valid_contents() { - if let Some(node) = text.space.node() { - if node.enabled() { - text.draw(token); - } - } - } -} diff --git a/src/nodes/input/mod.rs b/src/nodes/input/mod.rs index 2ae32a6..5ff119e 100644 --- a/src/nodes/input/mod.rs +++ b/src/nodes/input/mod.rs @@ -8,6 +8,7 @@ mod tip; pub use handler::*; pub use method::*; +use tracing::debug_span; use super::Aspect; use super::AspectIdentifier; @@ -120,6 +121,7 @@ pub fn process_input() { node.enabled() }); for handler in INPUT_HANDLER_REGISTRY.get_valid_contents() { + let _span = debug_span!("handle input handler").entered(); for method_alias in handler.method_aliases.get_aliases() { method_alias.set_enabled(false); } @@ -136,6 +138,7 @@ pub fn process_input() { } }; + let ser_span = debug_span!("serializing input").entered(); let (methods, datas) = methods .clone() // filter out methods without the handler in their handler order @@ -161,7 +164,9 @@ pub fn process_input() { // serialize the data .map(|(a, m)| (a.clone(), m.serialize(a.get_id(), &handler))) .unzip::<_, _, Vec<_>, Vec<_>>(); + drop(ser_span); + let _span = debug_span!("client input").entered(); let _ = input_handler_client::input(&handler_node, &methods, &datas); } for method in methods { diff --git a/src/nodes/spatial/mod.rs b/src/nodes/spatial/mod.rs index 41bfdcd..5dd522f 100644 --- a/src/nodes/spatial/mod.rs +++ b/src/nodes/spatial/mod.rs @@ -9,7 +9,6 @@ use crate::core::client::Client; use crate::core::error::Result; use crate::core::registry::Registry; use crate::nodes::{Node, OWNED_ASPECT_ALIAS_INFO}; -use bevy::ecs::entity_disabling::Disabled; use bevy::prelude::Transform as BevyTransform; use bevy::prelude::*; use color_eyre::eyre::OptionExt; @@ -18,7 +17,6 @@ use mint::Vector3; use parking_lot::Mutex; use rustc_hash::FxHashMap; use std::fmt::Debug; -use std::sync::atomic::Ordering; use std::sync::{Arc, OnceLock, Weak}; use std::{f32, ptr}; use stereokit_rust::maths::Bounds; @@ -28,62 +26,39 @@ impl Plugin for SpatialNodePlugin { fn build(&self, app: &mut App) { app.add_systems( PostUpdate, - (replace_childof, update_spatial_nodes).before(TransformSystem::TransformPropagate), + update_spatial_nodes.before(TransformSystem::TransformPropagate), ); } } fn update_spatial_nodes( - mut query: Query<(Entity, &mut BevyTransform, &SpatialNode, Has)>, - cmds: ParallelCommands, + mut query: Query<(&mut BevyTransform, &SpatialNode, Option<&ChildOf>)>, + parent_query: Query<&GlobalTransform>, ) { query .par_iter_mut() - .for_each(|(entity, mut transform, spatial_node, disabled)| { + .for_each(|(mut transform, spatial_node, child_of)| { let Some(spatial) = spatial_node.0.upgrade() else { + // should we despawn the entity? return; }; - if !spatial - .node() - .map(|n| n.enabled.load(Ordering::Relaxed)) - .unwrap_or(true) - { - // cmds.command_scope(|mut cmds| { - // cmds.entity(entity).insert(Visibility::Hidden); - // }); - // return; - } let mat4 = spatial.global_transform(); - - let scale_zero = mat4.to_scale_rotation_translation().0.length_squared() > 0.0; - if scale_zero { - // cmds.command_scope(|mut cmds| { - // cmds.entity(entity).insert(Visibility::Hidden); - // }); - } else if disabled { - // cmds.command_scope(|mut cmds| { - // cmds.entity(entity).insert(Visibility::Visible); - // }); + match child_of { + Some(child_of) => { + let Ok(parent) = parent_query.get(child_of.0) else { + warn!("SpatialNode bevy Parent doesn't have global transform"); + return; + }; + *transform = + BevyTransform::from_matrix(parent.compute_matrix().inverse() * mat4); + } + None => { + *transform = BevyTransform::from_matrix(mat4); + } } - *transform = BevyTransform::from_matrix(mat4); }); } -fn replace_childof(query: Query<(Entity, &ChildOf), With>, mut cmds: Commands) { - for (entity, parent) in &query { - cmds.entity(entity) - .insert(NonSpatialChildOf(parent.0)) - .remove::(); - } -} - -#[derive(Component, Default, Debug, PartialEq, Eq)] -#[relationship_target(relationship = NonSpatialChildOf, linked_spawn)] -pub struct NonSpatialChildren(Vec); -#[derive(Component, Debug, PartialEq, Eq)] -#[relationship(relationship_target = NonSpatialChildren)] -pub struct NonSpatialChildOf(Entity); - #[derive(Clone, Component, Debug)] #[require(BevyTransform)] pub struct SpatialNode(pub Weak); diff --git a/src/objects/input/sk_controller.rs b/src/objects/input/sk_controller.rs index d953ece..31da994 100644 --- a/src/objects/input/sk_controller.rs +++ b/src/objects/input/sk_controller.rs @@ -154,9 +154,7 @@ fn update( ref_space: Option>, state: Option>, ) { - info!("calling update"); let (Some(session), Some(state), Some(ref_space)) = (session, state, ref_space) else { - info!("something is missing"); controllers.left.set_enabled(false); controllers.right.set_enabled(false); return; @@ -288,6 +286,7 @@ impl SkController { let tracked = Tracked::new(connection, &path); let tip = InputDataType::Tip(Tip::default()); let node = spatial.node().unwrap(); + node.set_enabled(false); let model = Model::add_to(&node, ResourceID::Direct(CURSOR_MODEL_PATH.into())).unwrap(); let model_part = model.get_model_part("Cursor".to_string()).unwrap(); let input = InputMethod::add_to( @@ -324,7 +323,6 @@ impl SkController { ref_space: XrReferenceSpace, ) { let Some(space) = self.space.as_ref() else { - info!("no space 3:"); return; }; let Ok(location) = session @@ -339,10 +337,8 @@ impl SkController { | SpaceLocationFlags::ORIENTATION_VALID | SpaceLocationFlags::ORIENTATION_TRACKED, ); - info!("{:#?}", location.location_flags); self.set_enabled(enabled); if enabled { - info!("update"); let world_transform = Mat4::from(Affine3A::from(location.pose.to_xr_pose())); self.model_part .set_material_parameter("roughness".to_string(), MaterialParameter::Float(1.0)); -- 2.49.1 From bd05d9068b968e35e6aacbcb37a300d7ef31a76a Mon Sep 17 00:00:00 2001 From: Schmarni Date: Fri, 27 Jun 2025 21:40:36 +0200 Subject: [PATCH 06/17] feat(lines): line impl mostly done Signed-off-by: Schmarni --- Cargo.lock | 9 +- src/main.rs | 19 ++-- src/nodes/drawable/lines.rs | 169 +++++++++++++++++++++++++++++++++-- src/nodes/drawable/model.rs | 3 - src/objects/input/sk_hand.rs | 1 - 5 files changed, 177 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 102fd51..3404016 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6402,7 +6402,8 @@ dependencies = [ [[package]] name = "tracing-tracy" version = "0.11.4" -source = "git+https://github.com/nagisa/rust_tracy_client?tag=tracy-client-v0.18.1#7d084307f54959999ca3729c42bd4f4f3f0df54d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eaa1852afa96e0fe9e44caa53dc0bd2d9d05e0f2611ce09f97f8677af56e4ba" dependencies = [ "tracing-core", "tracing-subscriber", @@ -6423,7 +6424,8 @@ dependencies = [ [[package]] name = "tracy-client" version = "0.18.1" -source = "git+https://github.com/nagisa/rust_tracy_client?tag=tracy-client-v0.18.1#7d084307f54959999ca3729c42bd4f4f3f0df54d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3927832d93178f979a970d26deed7b03510586e328f31b0f9ad7a73985b8332a" dependencies = [ "loom", "once_cell", @@ -6433,7 +6435,8 @@ dependencies = [ [[package]] name = "tracy-client-sys" version = "0.25.0" -source = "git+https://github.com/nagisa/rust_tracy_client?tag=tracy-client-v0.18.1#7d084307f54959999ca3729c42bd4f4f3f0df54d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c032d68a49d25d9012a864fef1c64ac17aee43c87e0477bf7301d8ae8bfea7b7" dependencies = [ "cc", "windows-targets 0.48.5", diff --git a/src/main.rs b/src/main.rs index 2edb0bc..1b52fe3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,6 +44,7 @@ use clap::Parser; use core::client::{Client, tick_internal_client}; use core::task; use directories::ProjectDirs; +use nodes::drawable::lines::LinesNodePlugin; use nodes::drawable::model::ModelNodePlugin; use nodes::drawable::text::TextNodePlugin; use nodes::spatial::SpatialNodePlugin; @@ -117,6 +118,13 @@ static STARDUST_INSTANCE: OnceLock = OnceLock::new(); // #[tokio::main(flavor = "current_thread")] #[tokio::main] async fn main() { + // let mut out = Vec::new(); + // for i in 0..8 { + // for base in [0, 8, 1, 8, 9, 1] { + // out.push(base + i as u16); + // } + // } + // panic!("{out:?}"); color_eyre::install().unwrap(); let registry = tracing_subscriber::registry(); @@ -387,6 +395,7 @@ fn bevy_loop( SpatialNodePlugin, ModelNodePlugin, TextNodePlugin, + LinesNodePlugin, PlaySpacePlugin, HandPlugin, ControllerPlugin, @@ -400,16 +409,6 @@ fn bevy_loop( .in_set(OxrWaitFrameSystem) .in_set(XrHandleEvents::FrameLoop), ); - use std::process::Command; - - let output = Command::new("fc-match") - .arg("-f") - .arg("%{file}") - .output() - .expect("Failed to run fc-match"); - - let font_path = String::from_utf8_lossy(&output.stdout); - info!("Default font path: {}", font_path); app.run(); } diff --git a/src/nodes/drawable/lines.rs b/src/nodes/drawable/lines.rs index d414e00..ebc5e12 100644 --- a/src/nodes/drawable/lines.rs +++ b/src/nodes/drawable/lines.rs @@ -1,20 +1,170 @@ use super::{Line, LinesAspect}; use crate::{ - core::{client::Client, error::Result, registry::Registry}, - nodes::{Node, spatial::Spatial}, + core::{client::Client, color::ColorConvert, error::Result, registry::Registry}, + nodes::{ + Node, + spatial::{Spatial, SpatialNode}, + }, }; +use bevy::{ + asset::RenderAssetUsages, + prelude::*, + render::mesh::{Indices, PrimitiveTopology}, +}; +use bevy_sk::vr_materials::PbrMaterial; use glam::{FloatExt, Vec3}; use parking_lot::Mutex; -use std::{collections::VecDeque, sync::Arc}; +use std::{ + collections::VecDeque, + sync::{ + Arc, OnceLock, + atomic::{AtomicBool, Ordering}, + }, +}; use stereokit_rust::{ maths::Bounds, sk::MainThreadToken, system::LinePoint as SkLinePoint, util::Color128, }; +pub struct LinesNodePlugin; + +impl Plugin for LinesNodePlugin { + fn build(&self, app: &mut App) { + app.add_systems(Update, build_line_mesh); + } +} +const POINTS: [Vec3; 8] = [ + Vec3::X, + Vec3::new(1., 0., 1.), + Vec3::Z, + Vec3::new(-1., 0., 1.), + Vec3::NEG_X, + Vec3::new(-1., 0., -1.), + Vec3::NEG_Z, + Vec3::new(1., 0., -1.), +]; + +fn build_line_mesh( + mut meshes: ResMut>, + mut cmds: Commands, + mut materials: ResMut>, +) { + for lines in LINES_REGISTRY + .get_valid_contents() + .into_iter() + .filter(|l| l.gen_mesh.load(Ordering::Relaxed)) + { + lines.gen_mesh.store(false, Ordering::Relaxed); + let mut vertex_positions = Vec::::new(); + let mut vertex_normals = Vec::::new(); + let mut vertex_colors = Vec::<[f32; 4]>::new(); + let mut vertex_indecies = Vec::::new(); + let lines_data = lines.data.lock(); + if lines_data.is_empty() { + continue; + } + + let mut idk = 0; + for line in lines_data.iter() { + let optional_points = { + let mut out = Vec::new(); + let mut last = line.cyclic.then(|| line.points.last()).flatten(); + let mut peekable = line.points.iter().peekable(); + while let Some(curr) = peekable.next() { + let next = match peekable.peek() { + Some(v) => Some(*v), + None => line.cyclic.then(|| line.points.first()).flatten(), + }; + + out.push((last, curr, next)); + last = Some(curr); + } + out + }; + for (last, curr, next) in optional_points { + let last_quat = last.map(|v| { + Quat::from_rotation_arc( + Vec3::Y, + (Vec3::from(curr.point) - Vec3::from(v.point)).normalize(), + ) + }); + let next_quat = next.map(|v| { + Quat::from_rotation_arc( + Vec3::Y, + (Vec3::from(v.point) - Vec3::from(curr.point)).normalize(), + ) + }); + let quat = match (last_quat, next_quat) { + (None, None) => unreachable!(), + (None, Some(next)) => next, + (Some(last), None) => last, + (Some(last), Some(next)) => last.lerp(next, 0.5), + }; + let normals = [ + Vec3::X, + Vec3::new(1., 0., 1.).normalize(), + Vec3::Z, + Vec3::new(-1., 0., 1.).normalize(), + Vec3::NEG_X, + Vec3::new(-1., 0., -1.).normalize(), + Vec3::NEG_Z, + Vec3::new(1., 0., -1.).normalize(), + ] + .map(Vec3::normalize) + .map(|v| (quat * v)); + let points = normals.map(|v| (v * curr.thickness) + Vec3::from(curr.point)); + vertex_normals.extend(normals); + vertex_positions.extend(points); + vertex_colors.extend([curr.color.to_bevy().to_srgba().to_f32_array(); 8]); + idk += 1; + } + } + let vertex_indecies = (0..idk - 1).flat_map(indecies).collect::>(); + let mut mesh = Mesh::new( + PrimitiveTopology::TriangleList, + RenderAssetUsages::RENDER_WORLD, + ); + mesh.insert_indices(Indices::U32(vertex_indecies)); + mesh.insert_attribute(Mesh::ATTRIBUTE_COLOR, vertex_colors); + mesh.insert_attribute(Mesh::ATTRIBUTE_NORMAL, vertex_normals); + mesh.insert_attribute(Mesh::ATTRIBUTE_POSITION, vertex_positions); + + match lines.entity.get() { + Some(e) => cmds.entity(*e), + None => cmds.spawn(SpatialNode(Arc::downgrade(&lines.spatial))), + } + .insert(( + Mesh3d(meshes.add(mesh)), + MeshMaterial3d(materials.add(PbrMaterial { + color: Color::WHITE, + roughness: 1.0, + alpha_mode: AlphaMode::Blend, + ..default() + })), + )); + } +} + +// const BASE: [u16; 6] = [0, 8, 1, 8, 9, 1]; +const INDECIES: [u32; 48] = [ + 0, 8, 1, 8, 9, 1, 1, 9, 2, 9, 10, 2, 2, 10, 3, 10, 11, 3, 3, 11, 4, 11, 12, 4, 4, 12, 5, 12, + 13, 5, 5, 13, 6, 13, 14, 6, 6, 14, 7, 14, 15, 7, 7, 15, 0, 15, 8, 0, +]; +fn indecies(base: u32) -> [u32; INDECIES.len()] { + INDECIES.map(|v| v + (base * 8)) +} +fn cyclic_indecies(base: u32) -> [u32; INDECIES.len()] { + let mut out = INDECIES.map(|v| if v >= 8 { v + (base * 8) } else { v }); + out.reverse(); + out +} + static LINES_REGISTRY: Registry = Registry::new(); pub struct Lines { - space: Arc, + spatial: Arc, data: Mutex>, + gen_mesh: AtomicBool, + entity: OnceLock, } impl Lines { pub fn add_to(node: &Arc, lines: Vec) -> Result> { @@ -34,9 +184,12 @@ impl Lines { bounds }); + info!("line::add_to"); let lines = LINES_REGISTRY.add(Lines { - space: node.get_aspect::()?.clone(), + spatial: node.get_aspect::()?.clone(), data: Mutex::new(lines), + gen_mesh: AtomicBool::new(true), + entity: OnceLock::new(), }); node.add_aspect_raw(lines.clone()); @@ -44,7 +197,7 @@ impl Lines { } fn draw(&self, token: &MainThreadToken) { - let transform_mat = self.space.global_transform(); + let transform_mat = self.spatial.global_transform(); let data = self.data.lock().clone(); for line in &data { let mut points: VecDeque = line @@ -82,8 +235,10 @@ impl Lines { } impl LinesAspect for Lines { fn set_lines(node: Arc, _calling_client: Arc, lines: Vec) -> Result<()> { + info!("set_lines"); let lines_aspect = node.get_aspect::()?; *lines_aspect.data.lock() = lines; + lines_aspect.gen_mesh.store(true, Ordering::Relaxed); Ok(()) } } @@ -95,7 +250,7 @@ impl Drop for Lines { pub fn draw_all(token: &MainThreadToken) { for lines in LINES_REGISTRY.get_valid_contents() { - if let Some(node) = lines.space.node() { + if let Some(node) = lines.spatial.node() { if node.enabled() { lines.draw(token); } diff --git a/src/nodes/drawable/model.rs b/src/nodes/drawable/model.rs index 2671156..c042157 100644 --- a/src/nodes/drawable/model.rs +++ b/src/nodes/drawable/model.rs @@ -242,7 +242,6 @@ impl HashedPbrMaterial { hash_color(mat.emission_factor, state); state.write_u32(mat.metallic.to_bits()); state.write_u32(mat.roughness.to_bits()); - mat.use_stereokit_uvs.hash(state); match mat.alpha_mode { AlphaMode::Opaque => state.write_u8(0), AlphaMode::Mask(v) => { @@ -392,7 +391,6 @@ impl MaterialParameter { } } mat.alpha_mode = AlphaMode::AlphaToCoverage; - mat.use_stereokit_uvs = false; } } } @@ -438,7 +436,6 @@ impl Material { .as_ref() .map(|p| asset_server.load(p.as_path())), spherical_harmonics: bevy_sk::skytext::SPHERICAL_HARMONICS_HANDLE, - use_stereokit_uvs: false, } } } diff --git a/src/objects/input/sk_hand.rs b/src/objects/input/sk_hand.rs index c55a2a5..b838898 100644 --- a/src/objects/input/sk_hand.rs +++ b/src/objects/input/sk_hand.rs @@ -226,7 +226,6 @@ impl SkHand { let material = materials.add(PbrMaterial { color: Srgba::new(1.0, 1.0, 1.0, 1.0).into(), alpha_mode: AlphaMode::Blend, - use_stereokit_uvs: false, diffuse_texture: Some(GRADIENT_TEXTURE_HANDLE), roughness: 1.0, ..default() -- 2.49.1 From 880e187dc6b778237b832764ce4322cccb6d7653 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sat, 28 Jun 2025 11:34:09 +0200 Subject: [PATCH 07/17] feat: finish line impl and switch to bevy bounds Signed-off-by: Schmarni --- src/main.rs | 32 +++++- src/nodes/drawable/lines.rs | 150 ++++++++++++----------------- src/nodes/drawable/mod.rs | 1 - src/nodes/drawable/model.rs | 33 +++++-- src/nodes/spatial/mod.rs | 39 ++++---- src/objects/input/sk_controller.rs | 5 +- 6 files changed, 142 insertions(+), 118 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1b52fe3..c35999b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,9 @@ use bevy::app::{App, TerminalCtrlCHandlerPlugin}; use bevy::asset::{AssetMetaCheck, UnapprovedPathMode}; use bevy::audio::AudioPlugin; use bevy::core_pipeline::CorePipelinePlugin; +use bevy::core_pipeline::oit::{ + OrderIndependentTransparencyPlugin, OrderIndependentTransparencySettings, +}; use bevy::diagnostic::DiagnosticsPlugin; use bevy::ecs::schedule::{ExecutorKind, ScheduleLabel}; use bevy::gizmos::GizmoPlugin; @@ -38,6 +41,7 @@ use bevy_mod_openxr::reference_space::OxrReferenceSpacePlugin; use bevy_mod_openxr::render::{OxrRenderPlugin, OxrWaitFrameSystem}; use bevy_mod_openxr::resources::{OxrFrameState, OxrFrameWaiter, OxrSessionConfig}; use bevy_mod_openxr::types::AppInfo; +use bevy_mod_xr::camera::XrProjection; use bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin; use bevy_mod_xr::session::{XrFirst, XrHandleEvents}; use clap::Parser; @@ -56,6 +60,7 @@ use openxr::{EnvironmentBlendMode, ReferenceSpaceType}; use session::{launch_start, save_session}; use stardust_xr::schemas::dbus::object_registry::ObjectRegistry; use stardust_xr::server; +use std::ops::DerefMut as _; use std::path::PathBuf; use std::sync::{Arc, OnceLock}; use std::time::Duration; @@ -359,7 +364,7 @@ fn bevy_loop( .disable::() .disable::(), ); - // font size is in meters + app.add_plugins(( bevy_sk::hand::HandPlugin, bevy_sk::vr_materials::SkMaterialPlugin { @@ -403,6 +408,7 @@ fn bevy_loop( app.add_systems(PostStartup, move || { ready_notifier.notify_waiters(); }); + app.add_systems(Update, update_cameras); app.add_systems( XrFirst, xr_step @@ -412,6 +418,30 @@ fn bevy_loop( app.run(); } +fn update_cameras( + mut camera: Query< + &mut Projection, + ( + With, + ), + >, +) { + for mut projection in &mut camera { + match projection.deref_mut() { + Projection::Perspective(perspective_projection) => perspective_projection.near = 0.003, + Projection::Orthographic(orthographic_projection) => { + orthographic_projection.near = 0.003 + } + Projection::Custom(custom_projection) => { + if let Some(xr) = custom_projection.get_mut::() { + xr.near = 0.003 + } else { + error_once!("unknown custom camera projection"); + } + } + } + } +} fn xr_step(world: &mut World) { // camera::update(token); diff --git a/src/nodes/drawable/lines.rs b/src/nodes/drawable/lines.rs index ebc5e12..1ce6677 100644 --- a/src/nodes/drawable/lines.rs +++ b/src/nodes/drawable/lines.rs @@ -9,20 +9,17 @@ use crate::{ use bevy::{ asset::RenderAssetUsages, prelude::*, - render::mesh::{Indices, PrimitiveTopology}, -}; -use bevy_sk::vr_materials::PbrMaterial; -use glam::{FloatExt, Vec3}; -use parking_lot::Mutex; -use std::{ - collections::VecDeque, - sync::{ - Arc, OnceLock, - atomic::{AtomicBool, Ordering}, + render::{ + mesh::{Indices, MeshAabb, PrimitiveTopology}, + primitives::Aabb, }, }; -use stereokit_rust::{ - maths::Bounds, sk::MainThreadToken, system::LinePoint as SkLinePoint, util::Color128, +use bevy_sk::vr_materials::PbrMaterial; +use glam::Vec3; +use parking_lot::Mutex; +use std::sync::{ + Arc, OnceLock, + atomic::{AtomicBool, Ordering}, }; pub struct LinesNodePlugin; @@ -32,16 +29,6 @@ impl Plugin for LinesNodePlugin { app.add_systems(Update, build_line_mesh); } } -const POINTS: [Vec3; 8] = [ - Vec3::X, - Vec3::new(1., 0., 1.), - Vec3::Z, - Vec3::new(-1., 0., 1.), - Vec3::NEG_X, - Vec3::new(-1., 0., -1.), - Vec3::NEG_Z, - Vec3::new(1., 0., -1.), -]; fn build_line_mesh( mut meshes: ResMut>, @@ -62,25 +49,30 @@ fn build_line_mesh( if lines_data.is_empty() { continue; } - - let mut idk = 0; + + let mut indecies_set = 0; for line in lines_data.iter() { + let start_set = indecies_set; let optional_points = { let mut out = Vec::new(); let mut last = line.cyclic.then(|| line.points.last()).flatten(); let mut peekable = line.points.iter().peekable(); while let Some(curr) = peekable.next() { + let mut end = false; let next = match peekable.peek() { Some(v) => Some(*v), - None => line.cyclic.then(|| line.points.first()).flatten(), + None => { + end = true; + line.cyclic.then(|| line.points.first()).flatten() + } }; - out.push((last, curr, next)); + out.push((last, curr, next, end)); last = Some(curr); } out }; - for (last, curr, next) in optional_points { + for (last, curr, next, end) in optional_points { let last_quat = last.map(|v| { Quat::from_rotation_arc( Vec3::Y, @@ -115,10 +107,18 @@ fn build_line_mesh( vertex_normals.extend(normals); vertex_positions.extend(points); vertex_colors.extend([curr.color.to_bevy().to_srgba().to_f32_array(); 8]); - idk += 1; + if !end { + vertex_indecies.extend(indecies(indecies_set)); + } + indecies_set += 1; + } + if line.cyclic { + vertex_indecies.extend(cyclic_indecies(start_set, indecies_set - 1)); + } else { + vertex_indecies.extend(cap_indecies(start_set, false)); + vertex_indecies.extend(cap_indecies(indecies_set - 1, true)); } } - let vertex_indecies = (0..idk - 1).flat_map(indecies).collect::>(); let mut mesh = Mesh::new( PrimitiveTopology::TriangleList, RenderAssetUsages::RENDER_WORLD, @@ -126,7 +126,10 @@ fn build_line_mesh( mesh.insert_indices(Indices::U32(vertex_indecies)); mesh.insert_attribute(Mesh::ATTRIBUTE_COLOR, vertex_colors); mesh.insert_attribute(Mesh::ATTRIBUTE_NORMAL, vertex_normals); - mesh.insert_attribute(Mesh::ATTRIBUTE_POSITION, vertex_positions); + mesh.insert_attribute(Mesh::ATTRIBUTE_POSITION, vertex_positions.clone()); + if let Some(aabb) = mesh.compute_aabb() { + *lines.bounds.lock() = aabb; + } match lines.entity.get() { Some(e) => cmds.entity(*e), @@ -137,23 +140,38 @@ fn build_line_mesh( MeshMaterial3d(materials.add(PbrMaterial { color: Color::WHITE, roughness: 1.0, - alpha_mode: AlphaMode::Blend, + alpha_mode: AlphaMode::Opaque, ..default() })), )); } } +const END_CAP_INDECIES: [u32; 18] = [0, 1, 7, 7, 1, 2, 7, 2, 6, 6, 2, 3, 6, 3, 5, 5, 3, 4]; +fn cap_indecies(set: u32, flip: bool) -> [u32; END_CAP_INDECIES.len()] { + let mut out = END_CAP_INDECIES.map(|v| v + (set * 8)); + if flip { + out.reverse(); + } + out +} + // const BASE: [u16; 6] = [0, 8, 1, 8, 9, 1]; const INDECIES: [u32; 48] = [ 0, 8, 1, 8, 9, 1, 1, 9, 2, 9, 10, 2, 2, 10, 3, 10, 11, 3, 3, 11, 4, 11, 12, 4, 4, 12, 5, 12, 13, 5, 5, 13, 6, 13, 14, 6, 6, 14, 7, 14, 15, 7, 7, 15, 0, 15, 8, 0, ]; -fn indecies(base: u32) -> [u32; INDECIES.len()] { - INDECIES.map(|v| v + (base * 8)) +fn indecies(set: u32) -> [u32; INDECIES.len()] { + INDECIES.map(|v| v + (set * 8)) } -fn cyclic_indecies(base: u32) -> [u32; INDECIES.len()] { - let mut out = INDECIES.map(|v| if v >= 8 { v + (base * 8) } else { v }); +fn cyclic_indecies(start_set: u32, end_set: u32) -> [u32; INDECIES.len()] { + let mut out = INDECIES.map(|v| { + if v < 8 { + v + ((start_set) * 8) + } else { + v + ((end_set - 1) * 8) + } + }); out.reverse(); out } @@ -165,6 +183,7 @@ pub struct Lines { data: Mutex>, gen_mesh: AtomicBool, entity: OnceLock, + bounds: Mutex, } impl Lines { pub fn add_to(node: &Arc, lines: Vec) -> Result> { @@ -173,15 +192,10 @@ impl Lines { .unwrap() .bounding_box_calc .set(|node| { - let mut bounds = Bounds::default(); - if let Ok(lines) = node.get_aspect::() { - for line in &*lines.data.lock() { - for point in &line.points { - bounds.grown_point(Vec3::from(point.point)); - } - } - } - bounds + node.get_aspect::() + .ok() + .map(|v| v.bounds.lock().clone()) + .unwrap_or_default() }); info!("line::add_to"); @@ -190,48 +204,12 @@ impl Lines { data: Mutex::new(lines), gen_mesh: AtomicBool::new(true), entity: OnceLock::new(), + bounds: Mutex::new(Aabb::default()), }); node.add_aspect_raw(lines.clone()); Ok(lines) } - - fn draw(&self, token: &MainThreadToken) { - let transform_mat = self.spatial.global_transform(); - let data = self.data.lock().clone(); - for line in &data { - let mut points: VecDeque = line - .points - .iter() - .map(|p| SkLinePoint { - pt: transform_mat.transform_point3(Vec3::from(p.point)).into(), - thickness: p.thickness, - color: Color128::new(p.color.c.r, p.color.c.g, p.color.c.b, p.color.a).into(), - }) - .collect(); - if line.cyclic && !points.is_empty() { - let first = line.points.first().unwrap(); - let last = line.points.last().unwrap(); - - let color = Color128 { - r: first.color.c.r.lerp(last.color.c.r, 0.5), - g: first.color.c.g.lerp(last.color.c.g, 0.5), - b: first.color.c.b.lerp(last.color.c.b, 0.5), - a: first.color.a.lerp(last.color.a, 0.5), - }; - let connect_point = SkLinePoint { - pt: transform_mat - .transform_point3(Vec3::from(first.point).lerp(Vec3::from(last.point), 0.5)) - .into(), - thickness: (first.thickness + last.thickness) * 0.5, - color: color.into(), - }; - points.push_front(connect_point); - points.push_back(connect_point); - } - stereokit_rust::system::Lines::add_list(token, points.make_contiguous()); - } - } } impl LinesAspect for Lines { fn set_lines(node: Arc, _calling_client: Arc, lines: Vec) -> Result<()> { @@ -247,13 +225,3 @@ impl Drop for Lines { LINES_REGISTRY.remove(self); } } - -pub fn draw_all(token: &MainThreadToken) { - for lines in LINES_REGISTRY.get_valid_contents() { - if let Some(node) = lines.spatial.node() { - if node.enabled() { - lines.draw(token); - } - } - } -} diff --git a/src/nodes/drawable/mod.rs b/src/nodes/drawable/mod.rs index a1ec88e..2c35494 100644 --- a/src/nodes/drawable/mod.rs +++ b/src/nodes/drawable/mod.rs @@ -22,7 +22,6 @@ use stereokit_rust::{sk::MainThreadToken, system::Renderer, tex::SHCubemap}; // #[instrument(level = "debug", skip(sk))] pub fn draw(token: &MainThreadToken) { - lines::draw_all(token); match QUEUED_SKYTEX.lock().take() { Some(Some(skytex)) => { if let Ok(skytex) = SHCubemap::from_cubemap(skytex, true, 100) { diff --git a/src/nodes/drawable/model.rs b/src/nodes/drawable/model.rs index c042157..480dcae 100644 --- a/src/nodes/drawable/model.rs +++ b/src/nodes/drawable/model.rs @@ -9,6 +9,7 @@ use crate::nodes::Node; use crate::nodes::alias::{Alias, AliasList}; use crate::nodes::spatial::{Spatial, SpatialNode}; use bevy::prelude::*; +use bevy::render::primitives::Aabb; use bevy_sk::vr_materials::PbrMaterial; use color_eyre::eyre::eyre; use parking_lot::Mutex; @@ -18,7 +19,6 @@ use std::ffi::OsStr; use std::hash::{Hash, Hasher}; use std::path::PathBuf; use std::sync::{Arc, OnceLock, Weak}; -use stereokit_rust::maths::Bounds; use tokio::sync::mpsc; static LOAD_MODEL: OnceLock, PathBuf)>> = OnceLock::new(); @@ -121,6 +121,7 @@ fn gen_model_parts( query: Query<(Entity, &SceneRoot, &ModelNode, &Children)>, children_query: Query<&Children>, part_query: Query<(&Name, Option<&Children>, &Transform), Without>, + part_mesh_query: Query<(&Transform, &Aabb), With>, has_mesh: Query>, mut cmds: Commands, ) { @@ -145,7 +146,7 @@ fn gen_model_parts( entity, &part_query, None, - &mut |entity, name, transform, parent| { + &mut |entity, name, transform, parent, children| { let path = parent .as_ref() .map(|p| format!("{}/{}", &p.path, name.as_str())) @@ -175,6 +176,7 @@ fn gen_model_parts( pending_material_parameters: Mutex::default(), pending_material_replacement: Mutex::default(), aliases: AliasList::default(), + bounds: OnceLock::new(), }); (spatial, model_part) } @@ -185,9 +187,24 @@ fn gen_model_parts( (part.space.clone(), part.clone()) } }; - _ = spatial.bounding_box_calc.set(|_| { - // TODO: actually impl aabb - Bounds::default() + let aabb = Aabb::enclosing( + children + .iter() + .flat_map(|v| v.iter()) + .filter_map(|e| part_mesh_query.get(e).ok()) + .flat_map(|(transform, aabb)| { + [ + transform.transform_point(aabb.min().into()), + transform.transform_point(aabb.max().into()), + ] + }), + ) + .unwrap_or_default(); + _ = spatial.bounding_box_calc.set(move |n| { + n.get_aspect::() + .ok() + .and_then(|v| v.bounds.get().copied()) + .unwrap_or_default() }); cmds.entity(entity) .insert(SpatialNode(Arc::downgrade(&spatial))); @@ -196,6 +213,7 @@ fn gen_model_parts( .iter() .flat_map(|v| v.iter()) .find(|e| has_mesh.get(*e).unwrap_or(false))?; + _ = model_part.bounds.set(aabb); _ = model_part.entity.set(entity); _ = model_part.mesh_entity.set(mesh_entity); parts.push(model_part.clone()); @@ -216,12 +234,13 @@ fn gen_path( &Name, &Transform, Option>, + Option<&Children>, ) -> Option>, ) { let Ok((name, children, transform)) = part_query.get(current_entity) else { return; }; - let Some(parent) = func(current_entity, name, transform, parent) else { + let Some(parent) = func(current_entity, name, transform, parent, children) else { return; }; for e in children.iter().flat_map(|c| c.iter()) { @@ -449,6 +468,7 @@ pub struct ModelPart { pending_material_parameters: Mutex>, pending_material_replacement: Mutex>, aliases: AliasList, + bounds: OnceLock, } impl ModelPart { pub fn replace_material(&self, replacement: Material) { @@ -589,6 +609,7 @@ impl Model { pending_material_parameters: Mutex::default(), pending_material_replacement: Mutex::default(), aliases: AliasList::default(), + bounds: OnceLock::new(), }); self.pre_bound_parts.lock().push(part.clone()); part diff --git a/src/nodes/spatial/mod.rs b/src/nodes/spatial/mod.rs index 5dd522f..3e603c0 100644 --- a/src/nodes/spatial/mod.rs +++ b/src/nodes/spatial/mod.rs @@ -11,6 +11,7 @@ use crate::core::registry::Registry; use crate::nodes::{Node, OWNED_ASPECT_ALIAS_INFO}; use bevy::prelude::Transform as BevyTransform; use bevy::prelude::*; +use bevy::render::primitives::Aabb; use color_eyre::eyre::OptionExt; use glam::{Mat4, Quat, Vec3, vec3a}; use mint::Vector3; @@ -19,7 +20,6 @@ use rustc_hash::FxHashMap; use std::fmt::Debug; use std::sync::{Arc, OnceLock, Weak}; use std::{f32, ptr}; -use stereokit_rust::maths::Bounds; pub struct SpatialNodePlugin; impl Plugin for SpatialNodePlugin { @@ -102,7 +102,7 @@ pub struct Spatial { transform: Mutex, zone: Mutex>, children: Registry, - pub bounding_box_calc: OnceLock Bounds>, + pub bounding_box_calc: OnceLock Aabb>, } impl Spatial { @@ -146,9 +146,9 @@ impl Spatial { } // the output bounds are probably way bigger than they need to be - pub fn get_bounding_box(&self) -> Bounds { + pub fn get_bounding_box(&self) -> Aabb { let Some(node) = self.node() else { - return Bounds::default(); + return Aabb::default(); }; let mut bounds = self .bounding_box_calc @@ -156,7 +156,15 @@ impl Spatial { .map(|b| (b)(&node)) .unwrap_or_default(); for child in self.children.get_valid_contents() { - bounds.grown_box(child.get_bounding_box(), child.local_transform()); + let mat = child.local_transform(); + let child_aabb = child.get_bounding_box(); + bounds = Aabb::enclosing([ + bounds.min().into(), + bounds.max().into(), + mat.transform_point3(child_aabb.min().into()), + mat.transform_point3(child_aabb.max().into()), + ]) + .unwrap(); } bounds } @@ -398,7 +406,7 @@ impl SpatialRefAspect for SpatialRef { Ok(BoundingBox { center: Vec3::from(bounds.center).into(), - size: Vec3::from(bounds.dimensions).into(), + size: Vec3::from(bounds.half_extents * 2.0).into(), }) } @@ -409,20 +417,17 @@ impl SpatialRefAspect for SpatialRef { ) -> Result { let this_spatial = node.get_aspect::()?; let relative_spatial = relative_to.get_aspect::()?; - let center = Spatial::space_to_space_matrix(Some(&this_spatial), Some(&relative_spatial)) - .transform_point3([0.0; 3].into()); - let mut bounds = Bounds { - center: center.into(), - dimensions: [0.0; 3].into(), - }; - bounds.grown_box( - this_spatial.get_bounding_box(), - Spatial::space_to_space_matrix(Some(&this_spatial), Some(&relative_spatial)), - ); + let mat = Spatial::space_to_space_matrix(Some(&this_spatial), Some(&relative_spatial)); + let bb = this_spatial.get_bounding_box(); + let bounds = Aabb::enclosing([ + mat.transform_point3(bb.min().into()), + mat.transform_point3(bb.max().into()), + ]) + .unwrap(); Ok(BoundingBox { center: Vec3::from(bounds.center).into(), - size: Vec3::from(bounds.dimensions).into(), + size: Vec3::from(bounds.half_extents * 2.0).into(), }) } diff --git a/src/objects/input/sk_controller.rs b/src/objects/input/sk_controller.rs index 31da994..cbc9b6c 100644 --- a/src/objects/input/sk_controller.rs +++ b/src/objects/input/sk_controller.rs @@ -307,6 +307,9 @@ impl SkController { }) } pub fn set_enabled(&self, enabled: bool) { + if let Some(node) = self.input.spatial.node() { + node.set_enabled(enabled); + } tokio::spawn({ // this is suboptimal since it probably allocates a fresh string every frame let handle = self.tracked.clone(); @@ -342,8 +345,6 @@ impl SkController { let world_transform = Mat4::from(Affine3A::from(location.pose.to_xr_pose())); self.model_part .set_material_parameter("roughness".to_string(), MaterialParameter::Float(1.0)); - // self.model_part - // .set_material_parameter("metallic".to_string(), MaterialParameter::Float(0.0)); self.model_part.set_material_parameter( "color".to_string(), MaterialParameter::Color(stardust_xr::values::Color::new( -- 2.49.1 From 9ffa10569b57fc954dd95acfd42d63c979038fb5 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sat, 28 Jun 2025 12:56:40 +0200 Subject: [PATCH 08/17] feat: add entity handles and a bevy channel abstraction Signed-off-by: Schmarni --- src/core/bevy_channel.rs | 32 +++++++++++++++++++++ src/core/color.rs | 12 ++++++++ src/core/entity_handle.rs | 33 +++++++++++++++++++++ src/core/mod.rs | 2 ++ src/main.rs | 37 +++++++----------------- src/nodes/audio.rs | 14 +++++++-- src/nodes/drawable/lines.rs | 37 ++++++++++++++++++++---- src/nodes/drawable/model.rs | 37 +++++++++++------------- src/nodes/drawable/text.rs | 57 ++++++++++--------------------------- 9 files changed, 163 insertions(+), 98 deletions(-) create mode 100644 src/core/bevy_channel.rs create mode 100644 src/core/color.rs create mode 100644 src/core/entity_handle.rs diff --git a/src/core/bevy_channel.rs b/src/core/bevy_channel.rs new file mode 100644 index 0000000..0e86d8e --- /dev/null +++ b/src/core/bevy_channel.rs @@ -0,0 +1,32 @@ +use std::sync::OnceLock; + +use bevy::prelude::*; +use tokio::sync::mpsc::{self, error::TryRecvError}; + +#[derive(Resource)] +pub struct BevyChannelReader(mpsc::UnboundedReceiver); +pub struct BevyChannel(OnceLock>); +impl BevyChannel { + pub const fn new() -> Self { + Self(OnceLock::new()) + } + pub fn init(&self, app: &mut App) { + let (tx, rx) = mpsc::unbounded_channel(); + self.0.set(tx).unwrap(); + app.insert_resource(BevyChannelReader(rx)); + } + pub fn send(&self, msg: T) -> Option<()> { + self.0.get()?.send(msg).ok() + } +} + +impl BevyChannelReader { + pub fn read(&mut self) -> Option { + match self.0.try_recv() { + Ok(v) => Some(v), + Err(TryRecvError::Disconnected) => panic!("bevy channel should never disconnect"), + Err(TryRecvError::Empty) => None, + } + } +} + diff --git a/src/core/color.rs b/src/core/color.rs new file mode 100644 index 0000000..98cd8c0 --- /dev/null +++ b/src/core/color.rs @@ -0,0 +1,12 @@ +use stardust_xr::values::color::{AlphaColor, Rgb, color_space::LinearRgb}; + +pub trait ColorConvert { + fn to_bevy(&self) -> bevy::color::Color; +} +// even tho its supposed to be linear the values have to be interpreted as Srgba to produce the +// correct result because StereoKit used Srgba while it was assumed that is uses linear rgba +impl ColorConvert for AlphaColor> { + fn to_bevy(&self) -> bevy::color::Color { + bevy::color::Color::srgba(self.c.r, self.c.g, self.c.b, self.a) + } +} diff --git a/src/core/entity_handle.rs b/src/core/entity_handle.rs new file mode 100644 index 0000000..c4d7876 --- /dev/null +++ b/src/core/entity_handle.rs @@ -0,0 +1,33 @@ +use bevy::prelude::*; + +use super::bevy_channel::{BevyChannel, BevyChannelReader}; +pub struct EntityHandlePlugin; + +impl Plugin for EntityHandlePlugin { + fn build(&self, app: &mut App) { + DESTROY.init(app); + app.add_systems(PreUpdate, despawn); + } +} + +fn despawn(mut cmds: Commands, mut reader: ResMut>) { + while let Some(e) = reader.read() { + cmds.entity(e).despawn(); + } +} + +static DESTROY: BevyChannel = BevyChannel::new(); +#[derive(Deref, DerefMut, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +pub struct EntityHandle(pub Entity); +impl Drop for EntityHandle { + fn drop(&mut self) { + if DESTROY.send(self.0).is_none() { + error!("Entity Destroy channel not open"); + } + } +} +impl From for EntityHandle { + fn from(value: Entity) -> Self { + Self(value) + } +} diff --git a/src/core/mod.rs b/src/core/mod.rs index d2385de..ead1b89 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -8,3 +8,5 @@ pub mod resource; pub mod scenegraph; pub mod task; pub mod color; +pub mod entity_handle; +pub mod bevy_channel; diff --git a/src/main.rs b/src/main.rs index c35999b..1f88cac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,9 +16,6 @@ use bevy::app::{App, TerminalCtrlCHandlerPlugin}; use bevy::asset::{AssetMetaCheck, UnapprovedPathMode}; use bevy::audio::AudioPlugin; use bevy::core_pipeline::CorePipelinePlugin; -use bevy::core_pipeline::oit::{ - OrderIndependentTransparencyPlugin, OrderIndependentTransparencySettings, -}; use bevy::diagnostic::DiagnosticsPlugin; use bevy::ecs::schedule::{ExecutorKind, ScheduleLabel}; use bevy::gizmos::GizmoPlugin; @@ -46,6 +43,7 @@ use bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin; use bevy_mod_xr::session::{XrFirst, XrHandleEvents}; use clap::Parser; use core::client::{Client, tick_internal_client}; +use core::entity_handle::EntityHandlePlugin; use core::task; use directories::ProjectDirs; use nodes::drawable::lines::LinesNodePlugin; @@ -283,18 +281,11 @@ fn bevy_loop( ..default() }); let mut plugins = MinimalPlugins - .build().add(DiagnosticsPlugin) + .build() + .add(DiagnosticsPlugin) .add(TransformPlugin) .add(InputPlugin) - /* .add(AccessibilityPlugin) */; - // TODO: figure out headless - // { - // plugins = plugins.add(WindowPlugin::default()).add({ - // let mut winit = WinitPlugin::::default(); - // winit.run_on_any_thread = true; - // winit - // }); - // } + .add(AccessibilityPlugin); plugins = plugins .add(TerminalCtrlCHandlerPlugin) // bevy_mod_openxr will replace this, TODO: figure out how to mix this with @@ -315,8 +306,7 @@ fn bevy_loop( .add(ScenePlugin) .add(GltfPlugin::default()) .add(AudioPlugin::default()) - .add(GizmoPlugin) - .add(AccessibilityPlugin); + .add(GizmoPlugin); let mut task_pool_plugin = TaskPoolPlugin::default(); // make tokio work let handle = tokio::runtime::Handle::current(); @@ -396,15 +386,17 @@ fn bevy_loop( app.insert_resource(ObjectRegistryRes(object_registry)); app.add_plugins((RemotePlugin::default(), RemoteHttpPlugin::default())); // the Stardust server plugins + // infra plugins + app.add_plugins(EntityHandlePlugin); + // node plugins app.add_plugins(( SpatialNodePlugin, ModelNodePlugin, TextNodePlugin, LinesNodePlugin, - PlaySpacePlugin, - HandPlugin, - ControllerPlugin, )); + // object plugins + app.add_plugins((PlaySpacePlugin, HandPlugin, ControllerPlugin)); app.add_systems(PostStartup, move || { ready_notifier.notify_waiters(); }); @@ -418,14 +410,7 @@ fn bevy_loop( app.run(); } -fn update_cameras( - mut camera: Query< - &mut Projection, - ( - With, - ), - >, -) { +fn update_cameras(mut camera: Query<&mut Projection, (With,)>) { for mut projection in &mut camera { match projection.deref_mut() { Projection::Perspective(perspective_projection) => perspective_projection.near = 0.003, diff --git a/src/nodes/audio.rs b/src/nodes/audio.rs index dd74d29..d048dd8 100644 --- a/src/nodes/audio.rs +++ b/src/nodes/audio.rs @@ -14,12 +14,20 @@ use std::ops::DerefMut; use std::sync::{Arc, OnceLock}; use std::{ffi::OsStr, path::PathBuf}; use stereokit_rust::sound::{Sound as SkSound, SoundInst}; +use bevy::prelude::*; + +pub struct AudioNodePlugin; +impl Plugin for AudioNodePlugin { + fn build(&self, app: &mut App) { + todo!() + } +} static SOUND_REGISTRY: Registry = Registry::new(); stardust_xr_server_codegen::codegen_audio_protocol!(); pub struct Sound { - space: Arc, + spatial: Arc, volume: f32, pending_audio_path: PathBuf, @@ -37,7 +45,7 @@ impl Sound { ) .ok_or_else(|| eyre!("Resource not found"))?; let sound = Sound { - space: node.get_aspect::().unwrap().clone(), + spatial: node.get_aspect::().unwrap().clone(), volume: 1.0, pending_audio_path, sk_sound: OnceLock::new(), @@ -64,7 +72,7 @@ impl Sound { self.instance.lock().replace(instance); } if let Some(instance) = self.instance.lock().deref_mut() { - instance.position(self.space.global_transform().w_axis.xyz()); + instance.position(self.spatial.global_transform().w_axis.xyz()); } } } diff --git a/src/nodes/drawable/lines.rs b/src/nodes/drawable/lines.rs index 1ce6677..33e63cd 100644 --- a/src/nodes/drawable/lines.rs +++ b/src/nodes/drawable/lines.rs @@ -1,6 +1,9 @@ use super::{Line, LinesAspect}; use crate::{ - core::{client::Client, color::ColorConvert, error::Result, registry::Registry}, + core::{ + client::Client, color::ColorConvert, entity_handle::EntityHandle, error::Result, + registry::Registry, + }, nodes::{ Node, spatial::{Spatial, SpatialNode}, @@ -26,7 +29,25 @@ pub struct LinesNodePlugin; impl Plugin for LinesNodePlugin { fn build(&self, app: &mut App) { - app.add_systems(Update, build_line_mesh); + app.add_systems(Update, (build_line_mesh, update_visibillity).chain()); + } +} + +fn update_visibillity(mut cmds: Commands) { + for lines in LINES_REGISTRY.get_valid_contents().into_iter() { + let Some(entity) = lines.entity.get().map(|e| **e) else { + continue; + }; + match lines.spatial.node().map(|n| n.enabled()).unwrap_or(false) { + true => { + cmds.entity(entity) + .insert_recursive::(Visibility::Visible); + } + false => { + cmds.entity(entity) + .insert_recursive::(Visibility::Hidden); + } + } } } @@ -132,8 +153,12 @@ fn build_line_mesh( } match lines.entity.get() { - Some(e) => cmds.entity(*e), - None => cmds.spawn(SpatialNode(Arc::downgrade(&lines.spatial))), + Some(e) => cmds.entity(**e), + None => { + let e = cmds.spawn(SpatialNode(Arc::downgrade(&lines.spatial))); + _ = lines.entity.set(e.id().into()); + e + } } .insert(( Mesh3d(meshes.add(mesh)), @@ -182,7 +207,7 @@ pub struct Lines { spatial: Arc, data: Mutex>, gen_mesh: AtomicBool, - entity: OnceLock, + entity: OnceLock, bounds: Mutex, } impl Lines { @@ -194,7 +219,7 @@ impl Lines { .set(|node| { node.get_aspect::() .ok() - .map(|v| v.bounds.lock().clone()) + .map(|v| *v.bounds.lock()) .unwrap_or_default() }); diff --git a/src/nodes/drawable/model.rs b/src/nodes/drawable/model.rs index 480dcae..38fbce3 100644 --- a/src/nodes/drawable/model.rs +++ b/src/nodes/drawable/model.rs @@ -1,7 +1,9 @@ use super::{MODEL_PART_ASPECT_ALIAS_INFO, MaterialParameter, ModelAspect, ModelPartAspect}; use crate::bail; +use crate::core::bevy_channel::{BevyChannel, BevyChannelReader}; use crate::core::client::Client; use crate::core::color::ColorConvert as _; +use crate::core::entity_handle::EntityHandle; use crate::core::error::Result; use crate::core::registry::Registry; use crate::core::resource::get_resource_file; @@ -19,17 +21,14 @@ use std::ffi::OsStr; use std::hash::{Hash, Hasher}; use std::path::PathBuf; use std::sync::{Arc, OnceLock, Weak}; -use tokio::sync::mpsc; -static LOAD_MODEL: OnceLock, PathBuf)>> = OnceLock::new(); +static LOAD_MODEL: BevyChannel<(Arc, PathBuf)> = BevyChannel::new(); pub struct ModelNodePlugin; impl Plugin for ModelNodePlugin { fn build(&self, app: &mut App) { - let (tx, rx) = mpsc::unbounded_channel(); - LOAD_MODEL.set(tx).unwrap(); + LOAD_MODEL.init(app); app.init_resource::(); - app.insert_resource(MpscReceiver(rx)); app.add_systems(Update, load_models); app.add_systems( PostUpdate, @@ -38,23 +37,21 @@ impl Plugin for ModelNodePlugin { } } -#[derive(Resource)] -struct MpscReceiver(mpsc::UnboundedReceiver); #[derive(Component)] struct ModelNode(Weak); fn update_visibillity(mut cmds: Commands) { for model in MODEL_REGISTRY.get_valid_contents().into_iter() { - let Some(entity) = model.bevy_scene_entity.get().copied() else { + let Some(entity) = model.bevy_scene_entity.get() else { continue; }; match model.spatial.node().map(|n| n.enabled()).unwrap_or(false) { true => { - cmds.entity(entity) + cmds.entity(entity.0) .insert_recursive::(Visibility::Visible); } false => { - cmds.entity(entity) + cmds.entity(entity.0) .insert_recursive::(Visibility::Hidden); } } @@ -64,9 +61,9 @@ fn update_visibillity(mut cmds: Commands) { fn load_models( asset_server: Res, mut cmds: Commands, - mut mpsc_receiver: ResMut, PathBuf)>>, + mut mpsc_receiver: ResMut, PathBuf)>>, ) { - while let Ok((model, path)) = mpsc_receiver.0.try_recv() { + while let Some((model, path)) = mpsc_receiver.read() { // idk of the asset label is the correct approach here let handle = asset_server.load(GltfAssetLabel::Scene(0).from_asset(path)); let entity = cmds @@ -76,7 +73,7 @@ fn load_models( SpatialNode(Arc::downgrade(&model.spatial)), )) .id(); - model.bevy_scene_entity.set(entity).unwrap(); + model.bevy_scene_entity.set(entity.into()).unwrap(); } } @@ -92,7 +89,7 @@ fn apply_materials( .filter_map(|p| p.parts.get()) .flatten() { - let Ok(mut mesh_mat) = query.get_mut(*model_part.mesh_entity.get().unwrap()) else { + let Ok(mut mesh_mat) = query.get_mut(**model_part.mesh_entity.get().unwrap()) else { continue; }; if let Some(material) = model_part.pending_material_replacement.lock().take() { @@ -214,8 +211,8 @@ fn gen_model_parts( .flat_map(|v| v.iter()) .find(|e| has_mesh.get(*e).unwrap_or(false))?; _ = model_part.bounds.set(aabb); - _ = model_part.entity.set(entity); - _ = model_part.mesh_entity.set(mesh_entity); + _ = model_part.entity.set(entity.into()); + _ = model_part.mesh_entity.set(mesh_entity.into()); parts.push(model_part.clone()); Some(model_part) }, @@ -460,8 +457,8 @@ impl Material { } pub struct ModelPart { - entity: OnceLock, - mesh_entity: OnceLock, + entity: OnceLock, + mesh_entity: OnceLock, path: String, space: Arc, _model: Weak, @@ -541,7 +538,7 @@ impl MaterialRegistry { pub struct Model { spatial: Arc, _resource_id: ResourceID, - bevy_scene_entity: OnceLock, + bevy_scene_entity: OnceLock, parts: OnceLock>>, pre_bound_parts: Mutex>>, } @@ -562,8 +559,6 @@ impl Model { parts: OnceLock::new(), }); LOAD_MODEL - .get() - .unwrap() .send((model.clone(), pending_model_path)) .unwrap(); MODEL_REGISTRY.add_raw(&model); diff --git a/src/nodes/drawable/text.rs b/src/nodes/drawable/text.rs index b205feb..a701625 100644 --- a/src/nodes/drawable/text.rs +++ b/src/nodes/drawable/text.rs @@ -1,12 +1,9 @@ use crate::{ core::{ - client::Client, color::ColorConvert, error::Result, registry::Registry, - resource::get_resource_file, + bevy_channel::{BevyChannel, BevyChannelReader}, client::Client, color::ColorConvert, entity_handle::EntityHandle, error::Result, registry::Registry, resource::get_resource_file }, nodes::{ - Node, - drawable::XAlign, - spatial::{Spatial, SpatialNode}, + drawable::XAlign, spatial::{Spatial, SpatialNode}, Node }, }; use bevy::{platform::collections::HashMap, prelude::*}; @@ -19,31 +16,15 @@ use color_eyre::eyre::eyre; use core::f32; use cosmic_text::Metrics; use parking_lot::Mutex; -use std::{ - ffi::OsStr, - mem, - path::PathBuf, - sync::{Arc, OnceLock}, -}; -use tokio::sync::mpsc; +use std::{ffi::OsStr, mem, path::PathBuf, sync::Arc}; -static SPAWN_TEXT: OnceLock>> = OnceLock::new(); - -#[derive(Resource)] -struct MpscReceiver(mpsc::UnboundedReceiver); +static SPAWN_TEXT: BevyChannel> = BevyChannel::new(); pub struct TextNodePlugin; impl Plugin for TextNodePlugin { fn build(&self, app: &mut App) { // Text init stuff - // app.init_asset::().init_asset_loader::(); - // load_internal_binary_asset!( - // app, - // Handle::default(), - // "assets/FiraMono-subset.ttf", - // |bytes: &[u8], _path: String| { Font::try_from_bytes(bytes.to_vec()).unwrap() } - // ); // 1.0 for font size in meters app.add_plugins(MeshTextPlugin::new(1.0)); app.world_mut() @@ -52,17 +33,15 @@ impl Plugin for TextNodePlugin { .db_mut() .load_system_fonts(); - let (tx, rx) = mpsc::unbounded_channel(); - SPAWN_TEXT.set(tx).unwrap(); + SPAWN_TEXT.init(app); app.init_resource::(); - app.insert_resource(MpscReceiver(rx)); app.add_systems(Update, (spawn_text, update_visibillity).chain()); } } fn update_visibillity(mut cmds: Commands) { for text in TEXT_REGISTRY.get_valid_contents().into_iter() { - let Some(entity) = text.entity.lock().as_ref().copied() else { + let Some(entity) = text.entity.lock().as_deref().copied() else { continue; }; match text.spatial.node().map(|n| n.enabled()).unwrap_or(false) { @@ -79,7 +58,7 @@ fn update_visibillity(mut cmds: Commands) { } fn spawn_text( - mut mpsc: ResMut>>, + mut mpsc: ResMut>>, mut cmds: Commands, mut font_settings: ResMut, mut material_registry: ResMut, @@ -87,9 +66,9 @@ fn spawn_text( mut meshes: ResMut>, mut font_registry: Local, ) { - while let Ok(text) = mpsc.0.try_recv() { + while let Some(text) = mpsc.read() { if let Some(entity) = text.entity.lock().take() { - cmds.entity(entity).despawn(); + cmds.entity(*entity).despawn(); } let style = text.data.lock(); let old_db = text.font_path.clone().map(|p| { @@ -157,17 +136,11 @@ fn spawn_text( }; let dist = meshes.iter().fold(f32::MAX, |dist, v| { dist.min(v.transform.translation.x) - // if dist > v.transform.translation.x { - // v.transform.translation.x - // } else { - // dist - // } }); // TODO: text align let letters = meshes .into_iter() .map(|v| { - // info!("{:?}", v.transform); cmds.spawn(( Mesh3d(v.mesh), MeshMaterial3d(v.material), @@ -177,7 +150,7 @@ fn spawn_text( -dist + match style.bounds.as_ref().map(|v| v.anchor_align_x) { Some(XAlign::Center) => width * -0.5, - Some(XAlign::Right) => width * -1.0, + Some(XAlign::Right) => -width, Some(XAlign::Left) => 0.0, None => 0.0, }, @@ -192,7 +165,7 @@ fn spawn_text( .spawn((SpatialNode(Arc::downgrade(&text.spatial)),)) .add_children(&letters) .id(); - text.entity.lock().replace(entity); + text.entity.lock().replace(EntityHandle(entity)); } } @@ -217,7 +190,7 @@ static TEXT_REGISTRY: Registry = Registry::new(); pub struct Text { spatial: Arc, font_path: Option, - entity: Mutex>, + entity: Mutex>, text: Mutex, data: Mutex, } @@ -235,7 +208,7 @@ impl Text { data: Mutex::new(style), }); node.add_aspect_raw(text.clone()); - _ = SPAWN_TEXT.get().unwrap().send(text.clone()); + _ = SPAWN_TEXT.send(text.clone()); Ok(text) } @@ -248,14 +221,14 @@ impl TextAspect for Text { ) -> Result<()> { let this_text = node.get_aspect::()?; this_text.data.lock().character_height = height; - _ = SPAWN_TEXT.get().unwrap().send(this_text.clone()); + _ = SPAWN_TEXT.send(this_text); Ok(()) } fn set_text(node: Arc, _calling_client: Arc, text: String) -> Result<()> { let this_text = node.get_aspect::()?; *this_text.text.lock() = text; - _ = SPAWN_TEXT.get().unwrap().send(this_text.clone()); + _ = SPAWN_TEXT.send(this_text); Ok(()) } } -- 2.49.1 From b16ba65fd307c4476d2a155448cc6a2906e4bb87 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sat, 28 Jun 2025 20:24:02 +0200 Subject: [PATCH 09/17] feat: implement audio! thats all nodes! Signed-off-by: Schmarni --- Cargo.lock | 66 ++++++++++++++++++++ Cargo.toml | 2 +- src/main.rs | 4 +- src/nodes/audio.rs | 119 +++++++++++++++++++++++------------- src/nodes/drawable/lines.rs | 7 ++- src/nodes/drawable/model.rs | 2 +- src/nodes/drawable/text.rs | 26 +++++--- 7 files changed, 170 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3404016..47c4c5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2656,6 +2656,15 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "endi" version = "1.1.0" @@ -3367,6 +3376,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" +[[package]] +name = "hound" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f" + [[package]] name = "http" version = "1.3.1" @@ -5308,7 +5323,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7ceb6607dd738c99bc8cb28eff249b7cd5c8ec88b9db96c0608c1480d140fb1" dependencies = [ "cpal", + "hound", "lewton", + "symphonia", ] [[package]] @@ -5937,6 +5954,55 @@ dependencies = [ "zeno", ] +[[package]] +name = "symphonia" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "815c942ae7ee74737bb00f965fa5b5a2ac2ce7b6c01c0cc169bbeaf7abd5f5a9" +dependencies = [ + "lazy_static", + "symphonia-bundle-mp3", + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-bundle-mp3" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c01c2aae70f0f1fb096b6f0ff112a930b1fb3626178fba3ae68b09dce71706d4" +dependencies = [ + "lazy_static", + "log", + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-core" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "798306779e3dc7d5231bd5691f5a813496dc79d3f56bf82e25789f2094e022c3" +dependencies = [ + "arrayvec", + "bitflags 1.3.2", + "bytemuck", + "lazy_static", + "log", +] + +[[package]] +name = "symphonia-metadata" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc622b9841a10089c5b18e99eb904f4341615d5aa55bbf4eedde1be721a4023c" +dependencies = [ + "encoding_rs", + "lazy_static", + "log", + "symphonia-core", +] + [[package]] name = "syn" version = "1.0.109" diff --git a/Cargo.toml b/Cargo.toml index 392f90a..1991456 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,7 +79,7 @@ mint = "0.5.9" tokio = { version = "1.39.2", features = ["rt-multi-thread", "signal", "time"] } # bevy -bevy = { version = "0.16", features = ["wayland", "bevy_remote"] } +bevy = { version = "0.16", features = ["wayland", "bevy_remote", "mp3", "wav"] } bevy_mod_xr = "0.3" bevy_mod_openxr = "0.3" # bevy_mod_meshtext.git = "https://github.com/Schmarni-Dev/bevy_mod_meshtext" diff --git a/src/main.rs b/src/main.rs index 1f88cac..cf75b03 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,6 +42,7 @@ use bevy_mod_xr::camera::XrProjection; use bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin; use bevy_mod_xr::session::{XrFirst, XrHandleEvents}; use clap::Parser; +use nodes::audio::AudioNodePlugin; use core::client::{Client, tick_internal_client}; use core::entity_handle::EntityHandlePlugin; use core::task; @@ -394,6 +395,7 @@ fn bevy_loop( ModelNodePlugin, TextNodePlugin, LinesNodePlugin, + AudioNodePlugin, )); // object plugins app.add_plugins((PlaySpacePlugin, HandPlugin, ControllerPlugin)); @@ -576,7 +578,7 @@ fn stereokit_loop( #[cfg(feature = "wayland")] wayland.update(); drawable::draw(token); - audio::update(); + // audio::update(); } info!("Cleanly shut down StereoKit"); diff --git a/src/nodes/audio.rs b/src/nodes/audio.rs index d048dd8..7c165ba 100644 --- a/src/nodes/audio.rs +++ b/src/nodes/audio.rs @@ -1,26 +1,93 @@ +use super::spatial::SpatialNode; use super::{Aspect, AspectIdentifier, Node}; use crate::core::client::Client; -use crate::core::destroy_queue; +use crate::core::entity_handle::EntityHandle; use crate::core::error::Result; use crate::core::registry::Registry; use crate::core::resource::get_resource_file; use crate::nodes::spatial::{SPATIAL_ASPECT_ALIAS_INFO, Spatial, Transform}; +use bevy::audio::{PlaybackMode, Volume}; +use bevy_mod_openxr::session::OxrSession; +use bevy_mod_xr::session::{XrPreDestroySession, XrSessionCreated}; +use bevy_mod_xr::spaces::XrSpace; use color_eyre::eyre::eyre; -use glam::{Vec4Swizzles, vec3}; use parking_lot::Mutex; use stardust_xr::values::ResourceID; -use std::ops::DerefMut; +use bevy::prelude::*; +use bevy::transform::components::Transform as BevyTransform; use std::sync::{Arc, OnceLock}; use std::{ffi::OsStr, path::PathBuf}; -use stereokit_rust::sound::{Sound as SkSound, SoundInst}; -use bevy::prelude::*; pub struct AudioNodePlugin; impl Plugin for AudioNodePlugin { - fn build(&self, app: &mut App) { - todo!() - } + fn build(&self, app: &mut App) { + app.add_systems(Update, update_sound_event); + app.add_systems(XrSessionCreated, spawn_hmd_audio_listener); + app.add_systems(XrPreDestroySession, despawn_hmd_audio_listener); + } +} + +fn despawn_hmd_audio_listener(mut cmds: Commands, session: Res, res: Res) { + cmds.remove_resource::(); + cmds.entity(res.0).despawn(); + _ = session.destroy_space(res.1); +} + +fn spawn_hmd_audio_listener(mut cmds: Commands, session: Res) { + let space = session + .create_reference_space(openxr::ReferenceSpaceType::VIEW, BevyTransform::IDENTITY) + .unwrap(); + let listener = cmds + .spawn(( + Name::new("HMD audio listener"), + space.0, + SpatialListener::new(0.2), + )) + .id(); + cmds.insert_resource(HmdListener(listener, space.0)); +} +#[derive(Resource)] +struct HmdListener(Entity, XrSpace); +fn update_sound_event( + mut cmds: Commands, + sinks: Query<&SpatialAudioSink>, + asset_server: Res, +) { + for sound in SOUND_REGISTRY.get_valid_contents() { + if sound.entity.get().is_none() { + let handle = asset_server.load(sound.pending_audio_path.as_path()); + sound + .entity + .set( + cmds.spawn(( + Name::new("Audio Node"), + SpatialNode(Arc::downgrade(&sound.spatial)), + AudioPlayer::new(handle), + PlaybackSettings { + mode: PlaybackMode::Once, + volume: Volume::Linear(sound.volume), + speed: 1.0, + paused: true, + muted: false, + spatial: true, + spatial_scale: None, + }, + )) + .id() + .into(), + ) + .unwrap(); + } + if let Some(sink) = sound.entity.get().and_then(|e| sinks.get(e.0).ok()) { + if sound.play.lock().take().is_some() { + sink.play(); + } + if sound.stop.lock().take().is_some() { + sink.stop(); + } + } + } } static SOUND_REGISTRY: Registry = Registry::new(); @@ -31,8 +98,7 @@ pub struct Sound { volume: f32, pending_audio_path: PathBuf, - sk_sound: OnceLock, - instance: Mutex>, + entity: OnceLock, stop: Mutex>, play: Mutex>, } @@ -48,8 +114,7 @@ impl Sound { spatial: node.get_aspect::().unwrap().clone(), volume: 1.0, pending_audio_path, - sk_sound: OnceLock::new(), - instance: Mutex::new(None), + entity: OnceLock::new(), stop: Mutex::new(None), play: Mutex::new(None), }; @@ -57,24 +122,6 @@ impl Sound { node.add_aspect_raw(sound_arc.clone()); Ok(sound_arc) } - - fn update(&self) { - let sound = self - .sk_sound - .get_or_init(|| SkSound::from_file(self.pending_audio_path.clone()).unwrap()); - if self.stop.lock().take().is_some() { - if let Some(instance) = self.instance.lock().take() { - instance.stop(); - } - } - if self.instance.lock().is_none() && self.play.lock().take().is_some() { - let instance = sound.play(vec3(0.0, 0.0, 0.0), Some(self.volume)); - self.instance.lock().replace(instance); - } - if let Some(instance) = self.instance.lock().deref_mut() { - instance.position(self.spatial.global_transform().w_axis.xyz()); - } - } } impl AspectIdentifier for Sound { impl_aspect_for_sound_aspect_id! {} @@ -96,22 +143,10 @@ impl SoundAspect for Sound { } impl Drop for Sound { fn drop(&mut self) { - if let Some(instance) = self.instance.lock().take() { - instance.stop(); - } - if let Some(sk_sound) = self.sk_sound.take() { - destroy_queue::add(sk_sound); - } SOUND_REGISTRY.remove(self); } } -pub fn update() { - for sound in SOUND_REGISTRY.get_valid_contents() { - sound.update() - } -} - impl InterfaceAspect for Interface { #[doc = "Create a sound node. WAV and MP3 are supported."] fn create_sound( diff --git a/src/nodes/drawable/lines.rs b/src/nodes/drawable/lines.rs index 33e63cd..5f3a415 100644 --- a/src/nodes/drawable/lines.rs +++ b/src/nodes/drawable/lines.rs @@ -155,7 +155,10 @@ fn build_line_mesh( match lines.entity.get() { Some(e) => cmds.entity(**e), None => { - let e = cmds.spawn(SpatialNode(Arc::downgrade(&lines.spatial))); + let e = cmds.spawn(( + Name::new("LinesNode"), + SpatialNode(Arc::downgrade(&lines.spatial)), + )); _ = lines.entity.set(e.id().into()); e } @@ -223,7 +226,6 @@ impl Lines { .unwrap_or_default() }); - info!("line::add_to"); let lines = LINES_REGISTRY.add(Lines { spatial: node.get_aspect::()?.clone(), data: Mutex::new(lines), @@ -238,7 +240,6 @@ impl Lines { } impl LinesAspect for Lines { fn set_lines(node: Arc, _calling_client: Arc, lines: Vec) -> Result<()> { - info!("set_lines"); let lines_aspect = node.get_aspect::()?; *lines_aspect.data.lock() = lines; lines_aspect.gen_mesh.store(true, Ordering::Relaxed); diff --git a/src/nodes/drawable/model.rs b/src/nodes/drawable/model.rs index 38fbce3..1b61e0d 100644 --- a/src/nodes/drawable/model.rs +++ b/src/nodes/drawable/model.rs @@ -68,6 +68,7 @@ fn load_models( let handle = asset_server.load(GltfAssetLabel::Scene(0).from_asset(path)); let entity = cmds .spawn(( + Name::new("ModelNode"), SceneRoot(handle), ModelNode(Arc::downgrade(&model)), SpatialNode(Arc::downgrade(&model.spatial)), @@ -394,7 +395,6 @@ impl MaterialParameter { else { return; }; - info!(texture_param = parameter_name, path = ?texture_path); let handle = asset_server.load(texture_path); match parameter_name { "diffuse" => mat.diffuse_texture = Some(handle), diff --git a/src/nodes/drawable/text.rs b/src/nodes/drawable/text.rs index a701625..fff3d59 100644 --- a/src/nodes/drawable/text.rs +++ b/src/nodes/drawable/text.rs @@ -1,9 +1,17 @@ use crate::{ core::{ - bevy_channel::{BevyChannel, BevyChannelReader}, client::Client, color::ColorConvert, entity_handle::EntityHandle, error::Result, registry::Registry, resource::get_resource_file + bevy_channel::{BevyChannel, BevyChannelReader}, + client::Client, + color::ColorConvert, + entity_handle::EntityHandle, + error::Result, + registry::Registry, + resource::get_resource_file, }, nodes::{ - drawable::XAlign, spatial::{Spatial, SpatialNode}, Node + Node, + drawable::XAlign, + spatial::{Spatial, SpatialNode}, }, }; use bevy::{platform::collections::HashMap, prelude::*}; @@ -95,9 +103,8 @@ fn spawn_text( ); let max_width = style.bounds.as_ref().map(|v| v.bounds.x); let max_height = style.bounds.as_ref().map(|v| v.bounds.x); - let (width, height) = + let (width, _height) = text_glyphs.measure(max_width, max_height, &mut font_settings.font_system); - info!(width, height, ?style.text_align_x); let meshes = generate_meshes( bevy_mesh_text_3d::InputText::Simple { text: text_string, @@ -134,9 +141,9 @@ fn spawn_text( else { continue; }; - let dist = meshes.iter().fold(f32::MAX, |dist, v| { - dist.min(v.transform.translation.x) - }); + let dist = meshes + .iter() + .fold(f32::MAX, |dist, v| dist.min(v.transform.translation.x)); // TODO: text align let letters = meshes .into_iter() @@ -162,7 +169,10 @@ fn spawn_text( }) .collect::>(); let entity = cmds - .spawn((SpatialNode(Arc::downgrade(&text.spatial)),)) + .spawn(( + Name::new("TextNode"), + SpatialNode(Arc::downgrade(&text.spatial)), + )) .add_children(&letters) .id(); text.entity.lock().replace(EntityHandle(entity)); -- 2.49.1 From 9347072249f18a9e2f9612626429245b5d1c4ed5 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sat, 28 Jun 2025 20:42:28 +0200 Subject: [PATCH 10/17] fix(lines): fix lines not clearing when having no points Signed-off-by: Schmarni --- src/nodes/drawable/lines.rs | 29 ++++++++++++++++++++--------- src/nodes/drawable/text.rs | 4 ++-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/nodes/drawable/lines.rs b/src/nodes/drawable/lines.rs index 5f3a415..61c16f8 100644 --- a/src/nodes/drawable/lines.rs +++ b/src/nodes/drawable/lines.rs @@ -68,6 +68,19 @@ fn build_line_mesh( let mut vertex_indecies = Vec::::new(); let lines_data = lines.data.lock(); if lines_data.is_empty() { + *lines.bounds.lock() = Aabb::default(); + match lines.entity.get() { + Some(e) => cmds.entity(**e), + None => { + let e = cmds.spawn(( + Name::new("LinesNode"), + SpatialNode(Arc::downgrade(&lines.spatial)), + )); + _ = lines.entity.set(e.id().into()); + e + } + } + .remove::(); continue; } @@ -158,20 +171,18 @@ fn build_line_mesh( let e = cmds.spawn(( Name::new("LinesNode"), SpatialNode(Arc::downgrade(&lines.spatial)), + MeshMaterial3d(materials.add(PbrMaterial { + color: Color::WHITE, + roughness: 1.0, + alpha_mode: AlphaMode::Opaque, + ..default() + })), )); _ = lines.entity.set(e.id().into()); e } } - .insert(( - Mesh3d(meshes.add(mesh)), - MeshMaterial3d(materials.add(PbrMaterial { - color: Color::WHITE, - roughness: 1.0, - alpha_mode: AlphaMode::Opaque, - ..default() - })), - )); + .insert(Mesh3d(meshes.add(mesh))); } } diff --git a/src/nodes/drawable/text.rs b/src/nodes/drawable/text.rs index fff3d59..ba87c8d 100644 --- a/src/nodes/drawable/text.rs +++ b/src/nodes/drawable/text.rs @@ -105,7 +105,7 @@ fn spawn_text( let max_height = style.bounds.as_ref().map(|v| v.bounds.x); let (width, _height) = text_glyphs.measure(max_width, max_height, &mut font_settings.font_system); - let meshes = generate_meshes( + let char_meshes = generate_meshes( bevy_mesh_text_3d::InputText::Simple { text: text_string, material: material_registry.get_handle( @@ -137,7 +137,7 @@ fn spawn_text( if let Some(db) = old_db { mem::swap(font_settings.font_system.db_mut(), db); } - let Ok(meshes) = meshes.inspect_err(|err| error!("unable to create text meshes: {err}")) + let Ok(meshes) = char_meshes.inspect_err(|err| error!("unable to create text meshes: {err}")) else { continue; }; -- 2.49.1 From d2afa0090c1ae318b5b0f59a027266ed0361951b Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sun, 29 Jun 2025 11:38:00 +0200 Subject: [PATCH 11/17] feat: reimpl flatscreen mode Signed-off-by: Schmarni --- src/main.rs | 19 +- src/nodes/drawable/model.rs | 7 +- src/objects/input/mouse_pointer.rs | 301 ++++++++++++++++++++--------- src/objects/input/sk_hand.rs | 26 ++- src/objects/mod.rs | 19 +- 5 files changed, 251 insertions(+), 121 deletions(-) diff --git a/src/main.rs b/src/main.rs index cf75b03..b439d0f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,11 +8,11 @@ mod wayland; use crate::core::destroy_queue; use crate::nodes::items::camera; -use crate::nodes::{audio, drawable, input}; +use crate::nodes::{drawable, input}; use bevy::MinimalPlugins; use bevy::a11y::AccessibilityPlugin; -use bevy::app::{App, TerminalCtrlCHandlerPlugin}; +use bevy::app::{App, ScheduleRunnerPlugin, TerminalCtrlCHandlerPlugin}; use bevy::asset::{AssetMetaCheck, UnapprovedPathMode}; use bevy::audio::AudioPlugin; use bevy::core_pipeline::CorePipelinePlugin; @@ -27,6 +27,7 @@ use bevy::remote::http::RemoteHttpPlugin; use bevy::render::{RenderDebugFlags, RenderPlugin}; use bevy::scene::ScenePlugin; use bevy::text::FontLoader; +use bevy::winit::{WakeUp, WinitPlugin}; use bevy_mod_openxr::action_set_attaching::OxrActionAttachingPlugin; use bevy_mod_openxr::action_set_syncing::OxrActionSyncingPlugin; use bevy_mod_openxr::add_xr_plugins; @@ -42,16 +43,17 @@ use bevy_mod_xr::camera::XrProjection; use bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin; use bevy_mod_xr::session::{XrFirst, XrHandleEvents}; use clap::Parser; -use nodes::audio::AudioNodePlugin; use core::client::{Client, tick_internal_client}; use core::entity_handle::EntityHandlePlugin; use core::task; use directories::ProjectDirs; +use nodes::audio::AudioNodePlugin; use nodes::drawable::lines::LinesNodePlugin; use nodes::drawable::model::ModelNodePlugin; use nodes::drawable::text::TextNodePlugin; use nodes::spatial::SpatialNodePlugin; use objects::ServerObjects; +use objects::input::mouse_pointer::FlatscreenInputPlugin; use objects::input::sk_controller::ControllerPlugin; use objects::input::sk_hand::HandPlugin; use objects::play_space::PlaySpacePlugin; @@ -323,6 +325,17 @@ fn bevy_loop( .async_compute .on_thread_spawn = Some(enter_runtime_context.clone()); plugins = plugins.set(task_pool_plugin); + if args.flatscreen + || std::env::var_os("DISPLAY").is_some() + || std::env::var_os("WAYLAND_DISPLAY").is_some() + { + let mut plugin = WinitPlugin::::default(); + plugin.run_on_any_thread = true; + plugins = plugins + .add(plugin) + .disable::() + .add(FlatscreenInputPlugin); + } app.add_plugins( add_xr_plugins(plugins.add(WindowPlugin::default())) .set(OxrInitPlugin { diff --git a/src/nodes/drawable/model.rs b/src/nodes/drawable/model.rs index 1b61e0d..833bc81 100644 --- a/src/nodes/drawable/model.rs +++ b/src/nodes/drawable/model.rs @@ -116,17 +116,16 @@ fn apply_materials( fn gen_model_parts( scenes: Res>, - query: Query<(Entity, &SceneRoot, &ModelNode, &Children)>, + query: Query<(&SceneRoot, &ModelNode, &Children)>, children_query: Query<&Children>, part_query: Query<(&Name, Option<&Children>, &Transform), Without>, part_mesh_query: Query<(&Transform, &Aabb), With>, has_mesh: Query>, mut cmds: Commands, ) { - for (entity, scene_root, model_node, model_children) in query.iter() { + for (scene_root, model_node, model_children) in query.iter() { let Some(model) = model_node.0.upgrade() else { - cmds.entity(entity).despawn(); - return; + continue; }; if model.parts.get().is_some() { continue; diff --git a/src/objects/input/mouse_pointer.rs b/src/objects/input/mouse_pointer.rs index a699c2e..d3f8362 100644 --- a/src/objects/input/mouse_pointer.rs +++ b/src/objects/input/mouse_pointer.rs @@ -1,5 +1,6 @@ use super::{CaptureManager, DistanceCalculator, get_sorted_handlers}; use crate::{ + DbusConnection, ObjectRegistryRes, core::client::INTERNAL_CLIENT, nodes::{ Node, OwnedNode, @@ -9,6 +10,15 @@ use crate::{ spatial::Spatial, }, }; +use bevy::{ + input::{ + ButtonState, + keyboard::{KeyboardInput, NativeKey, NativeKeyCode}, + mouse::{MouseMotion, MouseWheel}, + }, + prelude::*, + window::PrimaryWindow, +}; use color_eyre::eyre::Result; use glam::{Mat4, Vec3, vec3}; use mint::Vector2; @@ -25,6 +35,97 @@ use tokio::time::{Duration, timeout}; use xkbcommon_rs::{Context, Keymap, KeymapFormat, xkb_keymap::CompileFlags}; use zbus::{Connection, names::OwnedInterfaceName}; +pub struct FlatscreenInputPlugin; + +impl Plugin for FlatscreenInputPlugin { + fn build(&self, app: &mut App) { + app.add_systems(Startup, setup); + // yes the input method will be delayed by one frame, its only for debugging anyways + app.add_systems(Update, update_pointer); + } +} + +#[derive(Component)] +#[require(Camera3d)] +struct FlatscreenCam; + +fn setup(mut cmds: Commands) { + let Ok(pointer) = + MousePointer::new().inspect_err(|err| error!("unable to create mouse pointer: {err}")) + else { + return; + }; + cmds.spawn((FlatscreenCam, Name::new("Flatscreen Camera"))); + cmds.insert_resource(pointer); +} + +fn update_pointer( + window: Single<(&Window), With>, + mut cam: Single<(&Camera, &GlobalTransform, &mut Transform), With>, + mut pointer: ResMut, + connection: Res, + object_registry: Res, + mouse_buttons: Res>, + keyboard_buttons: Res>, + mut scroll: EventReader, + mut motion: EventReader, + mut keyboard_input_events: EventReader, + time: Res