diff --git a/Cargo.lock b/Cargo.lock index 8062b5b..5ee90f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,18 +162,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "anstyle" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" - [[package]] name = "approx" version = "0.5.1" @@ -183,12 +171,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "arbitrary-chunks" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad8689a486416c401ea15715a4694de30054248ec627edbf31f49cb64ee4086" - [[package]] name = "arboard" version = "3.6.1" @@ -357,44 +339,6 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" -[[package]] -name = "avian2d" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375fa2f2b6d042bda24d6b2ecea01ef1d7c8b7b3eed5c730d3409df4778588c9" -dependencies = [ - "approx", - "arrayvec", - "avian_derive", - "bevy", - "bevy_heavy", - "bevy_math", - "bevy_transform_interpolation", - "bitflags 2.13.2", - "derive_more", - "disqualified", - "glam_matrix_extras", - "itertools 0.15.0", - "obvhs", - "parry2d", - "parry2d-f64", - "smallvec", - "thiserror 2.0.21", - "thread_local", -] - -[[package]] -name = "avian_derive" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95522267606c85f77ba40b55735583618f7a48e873be71a934f71dd5519ce86" -dependencies = [ - "proc-macro-error3", - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "bevy" version = "0.19.1" @@ -889,17 +833,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "bevy_heavy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbd898e2c06dfba5854db187a3daece1eaf655c8fc385604bbe5b9304ed3f9b" -dependencies = [ - "bevy_math", - "bevy_reflect", - "glam_matrix_extras", -] - [[package]] name = "bevy_image" version = "0.19.1" @@ -1117,7 +1050,7 @@ dependencies = [ "bevy_reflect", "derive_more", "glam", - "itertools 0.14.0", + "itertools", "libm", "rand", "rand_distr", @@ -1360,7 +1293,7 @@ dependencies = [ "glam", "image", "indexmap", - "itertools 0.14.0", + "itertools", "js-sys", "naga", "nonmax", @@ -1607,15 +1540,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "bevy_transform_interpolation" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea40784f1c6a3f61333064ea1d1c7663ef677c1ce46b5ca148c46c4a62c27e62" -dependencies = [ - "bevy", -] - [[package]] name = "bevy_ui" version = "0.19.1" @@ -1842,16 +1766,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "block-pseudorand" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2097358495d244a0643746f4d13eedba4608137008cf9dec54e53a3b700115a6" -dependencies = [ - "chiapos-chacha8", - "nanorand", -] - [[package]] name = "block2" version = "0.5.1" @@ -1953,12 +1867,6 @@ dependencies = [ "wayland-client", ] -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - [[package]] name = "cc" version = "1.5.1" @@ -1983,67 +1891,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" -[[package]] -name = "chiapos-chacha8" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33f8be573a85f6c2bc1b8e43834c07e32f95e489b914bf856c0549c3c269cd0a" -dependencies = [ - "rayon", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d" -dependencies = [ - "anstyle", - "clap_lex", -] - -[[package]] -name = "clap_lex" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486" - [[package]] name = "clipboard-win" version = "5.4.1" @@ -2217,42 +2064,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools 0.10.5", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools 0.10.5", -] - [[package]] name = "critical-section" version = "1.2.0" @@ -2268,25 +2079,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-queue" version = "0.3.14" @@ -2431,15 +2223,6 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" -[[package]] -name = "ena" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabffdaee24bd1bf95c5ef7cec31260444317e72ea56c4c91750e8b7ee58d5f1" -dependencies = [ - "log", -] - [[package]] name = "encase" version = "0.12.1" @@ -2796,7 +2579,6 @@ version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f70749695b063ecbf6b62949ccccde2e733ec3ecbbd71d467dca4e5c6c97cca0" dependencies = [ - "approx", "bytemuck", "encase", "libm", @@ -2804,28 +2586,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "glam_matrix_extras" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db060a7f23a5666ccbe9c770cd0e0e419b2eb94c86a7c8bfd091bacf8b4926cd" -dependencies = [ - "bevy_reflect", - "glam", -] - -[[package]] -name = "glamx" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59157a5886a9c68eb694df59254f7c9419c5648fc6ca1b728601a8baecc0dfcd" -dependencies = [ - "approx", - "glam", - "num-traits", - "simba", -] - [[package]] name = "glow" version = "0.17.0" @@ -3179,26 +2939,6 @@ dependencies = [ "rustversion", ] -[[package]] -name = "is-terminal" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.14.0" @@ -3208,21 +2948,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - [[package]] name = "jni" version = "0.22.4" @@ -3512,12 +3237,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "nanorand" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" - [[package]] name = "ndk" version = "0.9.0" @@ -3593,26 +3312,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -3951,20 +3650,6 @@ dependencies = [ "objc2-foundation 0.2.2", ] -[[package]] -name = "obvhs" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf590a9310ba69b2340562d39f0c9bddd3677130bfd24a5df22941552e791bac" -dependencies = [ - "bytemuck", - "glam", - "half", - "log", - "rdst", - "static_assertions", -] - [[package]] name = "offset-allocator" version = "0.2.0" @@ -3981,12 +3666,6 @@ version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" -[[package]] -name = "oorandom" -version = "11.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" - [[package]] name = "orbclient" version = "0.3.55" @@ -4087,72 +3766,6 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "parry2d" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f0ec92e9560ebd24cbdd071e19e07a96df6a6d4970d8719cc898c7dfdc359a" -dependencies = [ - "approx", - "arrayvec", - "bitflags 2.13.2", - "downcast-rs 2.0.2", - "either", - "ena", - "foldhash 0.2.0", - "glamx", - "hashbrown 0.16.1", - "log", - "num-derive", - "num-traits", - "ordered-float", - "rayon", - "simba", - "slab", - "smallvec", - "spade", - "thiserror 2.0.21", -] - -[[package]] -name = "parry2d-f64" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9445ae064bfaad3ef13354d2f9a4a5b6e01bbbad770a18aafd38662501b289cb" -dependencies = [ - "approx", - "arrayvec", - "bitflags 2.13.2", - "downcast-rs 2.0.2", - "either", - "ena", - "foldhash 0.2.0", - "glamx", - "hashbrown 0.16.1", - "log", - "num-derive", - "num-traits", - "ordered-float", - "rayon", - "simba", - "slab", - "smallvec", - "spade", - "thiserror 2.0.21", -] - -[[package]] -name = "partition" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "947f833aaa585cf12b8ec7c0476c98784c49f33b861376ffc84ed92adebf2aba" - -[[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.2" @@ -4221,34 +3834,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" -[[package]] -name = "plotters" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" - -[[package]] -name = "plotters-svg" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" -dependencies = [ - "plotters-backend", -] - [[package]] name = "png" version = "0.18.1" @@ -4326,28 +3911,6 @@ dependencies = [ "toml_edit", ] -[[package]] -name = "proc-macro-error-attr3" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e564d14133360e1ae169ffde5da25881b5fa47261665b8e5713c212c27799da" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error3" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0d4471b3436c22106b21913b1dda531558918ae9b7ec55d58aa84b43552233" -dependencies = [ - "proc-macro-error-attr3", - "proc-macro2", - "quote", - "syn 3.0.6", -] - [[package]] name = "proc-macro2" version = "1.0.107" @@ -4455,40 +4018,6 @@ dependencies = [ "objc2-quartz-core 0.3.2", ] -[[package]] -name = "rayon" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "rdst" -version = "0.20.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7970b4e577b76a96d5e56b5f6662b66d1a4e1f5bb026ee118fc31b373c2752" -dependencies = [ - "arbitrary-chunks", - "block-pseudorand", - "criterion", - "partition", - "tikv-jemallocator", - "voracious_radix_sort", -] - [[package]] name = "read-fonts" version = "0.39.2" @@ -4578,12 +4107,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" -[[package]] -name = "robust" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e27ee8bb91ca0adcf0ecb116293afa12d393f9c2b9b9cd54d33e8078fe19839" - [[package]] name = "ron" version = "0.12.2" @@ -4645,15 +4168,6 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" -[[package]] -name = "safe_arch" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" -dependencies = [ - "bytemuck", -] - [[package]] name = "same-file" version = "1.0.6" @@ -4730,19 +4244,6 @@ dependencies = [ "syn 3.0.6", ] -[[package]] -name = "serde_json" -version = "1.0.151" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -4758,19 +4259,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" -[[package]] -name = "simba" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99284beb21666094ba2b75bbceda012e610f5479dfcc2d6e2426f53197ffd95" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", -] - [[package]] name = "simd-adler32" version = "0.3.10" @@ -4868,18 +4356,6 @@ dependencies = [ "serde", ] -[[package]] -name = "spade" -version = "2.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9699399fd9349b00b184f5635b074f9ec93afffef30c853f8c875b32c0f8c7fa" -dependencies = [ - "hashbrown 0.16.1", - "num-traits", - "robust", - "smallvec", -] - [[package]] name = "spin" version = "0.10.1" @@ -5068,26 +4544,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "tikv-jemalloc-sys" -version = "0.5.4+5.3.0-patched" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "tikv-jemallocator" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965fe0c26be5c56c94e38ba547249074803efd52adfb66de62107d95aab3eaca" -dependencies = [ - "libc", - "tikv-jemalloc-sys", -] - [[package]] name = "tiny-skia" version = "0.11.4" @@ -5124,16 +4580,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.13.3" @@ -5363,15 +4809,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "voracious_radix_sort" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e7ffcb6c27a71d05af7e51ef2ee5b71c48424b122a832f2439651e1914899" -dependencies = [ - "rayon", -] - [[package]] name = "walkdir" version = "2.5.0" @@ -5598,7 +5035,6 @@ dependencies = [ name = "website" version = "0.1.0" dependencies = [ - "avian2d", "bevy", ] @@ -5769,16 +5205,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wide" -version = "0.7.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" -dependencies = [ - "bytemuck", - "safe_arch", -] - [[package]] name = "winapi" version = "0.3.9" @@ -6154,9 +5580,9 @@ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "wl-clipboard-rs" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9651471a32e87d96ef3a127715382b2d11cc7c8bb9822ded8a7cc94072eb0a3" +checksum = "4d7888ccd4896447b2d14d3a9350a85df2aeb6f181e2e7a31349d104ac46cac1" dependencies = [ "libc", "log", @@ -6355,9 +5781,3 @@ name = "zlib-rs" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" - -[[package]] -name = "zmij" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml index 3870d9f..6994992 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" [dependencies] - avian2d = "0.7" bevy = { version = "0.19", default-features = false, features = ["2d"] } [profile.dev.package."*"] diff --git a/Dockerfile b/Dockerfile index e5eddc3..24d960f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,70 @@ -FROM rust:1 AS builder -WORKDIR /usr/src/website -COPY . . +# syntax=docker/dockerfile:1 + +ARG RUST_VERSION=1.98.1 + +# ---- Base: Rust toolchain + build tools ---- +FROM rust:${RUST_VERSION}-slim-bookworm AS chef +WORKDIR /app RUN apt-get update \ - && apt-get install -y --no-install-recommends binaryen brotli yq \ + && apt-get install -y --no-install-recommends curl ca-certificates \ && rm -rf /var/lib/apt/lists/* -RUN rustup target add wasm32-unknown-unknown -RUN VERSION="$(tomlq -r '.package[] | select(.name == "wasm-bindgen") | .version' Cargo.lock)" \ - && cargo install wasm-bindgen-cli --version "$VERSION" +# Install the toolchain declared in rust-toolchain.toml (incl. wasm32 target) in its own layer +COPY rust-toolchain.toml . +RUN rustup show active-toolchain || rustup toolchain install -RUN ./build-wasm.sh release -RUN cargo build --release -p server +# Prebuilt binaries via cargo-binstall; wasm-bindgen-cli must match the version in Cargo.lock +RUN curl -L --proto '=https' --tlsv1.2 -sSf \ + https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ + && cargo binstall -y --locked cargo-chef trunk -FROM debian:trixie-slim -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* -COPY --from=builder /usr/src/website/target/release/server /usr/local/bin/server -COPY --from=builder /usr/src/website/static /app/static +# ---- Planner: compute the dependency recipe ---- +FROM chef AS planner +COPY . . +RUN cargo chef prepare --recipe-path recipe.json -WORKDIR /app -EXPOSE 3000 -HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:3000/health || exit 1 +# ---- Builder: cook deps (cached), then build the site with trunk ---- +FROM chef AS builder +COPY --from=planner /app/recipe.json recipe.json +# Must match the flags trunk passes to cargo (see web/index.html) to reuse the cache +RUN cargo chef cook --release --target wasm32-unknown-unknown --no-default-features \ + --recipe-path recipe.json -CMD ["server"] +COPY . . +RUN mkdir -p assets +RUN --mount=type=cache,target=/root/.cache/trunk \ + trunk build --release --locked + +# ---- Runtime: static files served by nginx ---- +FROM nginx:1.29-alpine AS runtime + +COPY <<'EOF' /etc/nginx/conf.d/default.conf +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + gzip on; + gzip_types application/wasm application/javascript text/css; + + # Bevy expects real 404s for missing assets (Trunk.toml: no_spa = true) + location / { + try_files $uri $uri/ =404; + } + + location ~* \.(wasm|js|css)$ { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } + + location = /index.html { + add_header Cache-Control "no-cache"; + } +} +EOF + +COPY --from=builder /app/dist /usr/share/nginx/html + +EXPOSE 80 diff --git a/src/main.rs b/src/main.rs index 542feb4..9442a7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,36 @@ use bevy::{platform::collections::HashMap, prelude::*}; use std::f32::consts::PI; +#[derive(Reflect, Resource)] +#[reflect(Resource)] +struct ModelConfig { + num_boids: usize, + x_bound: f32, + y_bound: f32, + max_velocity: f32, + protected_range: f32, + visible_range: f32, + alignment_factor: f32, + cohesion_factor: f32, + separation_factor: f32, +} + +impl Default for ModelConfig { + fn default() -> Self { + Self { + num_boids: 50, + x_bound: 0.7, + y_bound: 0.7, + max_velocity: 200.0, + protected_range: 50.0, + visible_range: 150.0, + alignment_factor: 0.5, + cohesion_factor: 0.5, + separation_factor: 200.0, + } + } +} + fn main() { App::new() .insert_resource(ClearColor(Color::srgb_u8(26, 26, 46))) @@ -14,24 +44,29 @@ fn main() { }), ..default() })) + .init_resource::() + .register_type::() .add_systems(Startup, setup) .add_systems(FixedUpdate, update_boids) .run(); } -const BOID_MAX_VELOCITY: f32 = 200.0; - #[derive(Component)] struct Boid { velocity: Vec2, } fn setup( + model_config: Res, mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>, ) { - const NUM_BOIDS: usize = 50; + let ModelConfig { + num_boids, + max_velocity, + .. + } = *model_config; commands.spawn(Camera2d); @@ -42,11 +77,11 @@ fn setup( Vec2::new(-3.0, -3.0), ))); let triangle_material = MeshMaterial2d(materials.add(Color::WHITE)); - commands.spawn_batch((0..=NUM_BOIDS).map(move |n| { - let angle = 2.0 * PI / (NUM_BOIDS as f32) * n as f32; + commands.spawn_batch((0..num_boids).map(move |n| { + let angle = 2.0 * PI / (num_boids as f32) * n as f32; ( Boid { - velocity: Vec2::from_angle(angle) * BOID_MAX_VELOCITY, + velocity: Vec2::from_angle(angle) * max_velocity, }, triangle_mesh.clone(), triangle_material.clone(), @@ -62,16 +97,14 @@ struct Model { } fn update_boids( + model_config: Res, window: Single<&Window, With>, - mut query: Query<(Entity, &mut Boid, &mut Transform)>, time: Res>, + mut query: Query<(Entity, &mut Boid, &mut Transform)>, ) { let dt = time.delta_secs(); - let x_bound = window.width() * 0.7; - let y_bound = window.height() * 0.7; - - const PROTECTED_RANGE: f32 = 30.0; - const VISIBLE_RANGE: f32 = 100.0; + let x_bound = window.width() * model_config.x_bound; + let y_bound = window.height() * model_config.y_bound; let mut model_updates = HashMap::new(); for (entity, boid, transform) in query.iter() { @@ -83,15 +116,15 @@ fn update_boids( if entity == other_entity { continue; } - let distance = transform - .translation - .xy() - .distance(other_transform.translation.xy()); - - if distance > 1.0 && distance < PROTECTED_RANGE { - separation += - (transform.translation.xy() - other_transform.translation.xy()) / distance; - } else if distance < VISIBLE_RANGE { + let delta = transform.translation.xy() - other_transform.translation.xy(); + let distance = delta.length(); + if distance < model_config.protected_range { + if distance > f32::EPSILON { + let direction = delta / distance; + let strength = 1.0 - distance / model_config.protected_range; + separation += direction * strength; + } + } else if distance < model_config.visible_range { avg_speed += other_boid.velocity; avg_pos += other_transform.translation.xy(); nb_neighbors += 1; @@ -112,31 +145,30 @@ fn update_boids( } for (entity, mut boid, mut transform) in query.iter_mut() { - let mut acceleration = Vec2::new(0.0, 0.0); + let mut out_of_bounds_acceleration = Vec2::new(0.0, 0.0); if transform.translation.x < -x_bound / 2.0 { - acceleration.x = 1.0; + out_of_bounds_acceleration.x = 1.0; } else if transform.translation.x > x_bound / 2.0 { - acceleration.x = -1.0; + out_of_bounds_acceleration.x = -1.0; } if transform.translation.y < -y_bound / 2.0 { - acceleration.y = 1.0; + out_of_bounds_acceleration.y = 1.0; } else if transform.translation.y > y_bound / 2.0 { - acceleration.y = -1.0; + out_of_bounds_acceleration.y = -1.0; } - - let out_of_bounds_acceleration = acceleration.normalize_or_zero(); + let out_of_bounds_acceleration = out_of_bounds_acceleration.normalize_or_zero(); let model_update = model_updates.get(&entity).unwrap(); - // Update velocity and apply forces to position - boid.velocity += (out_of_bounds_acceleration - + model_update.separation.normalize_or_zero() * 5. - + model_update.alignment.normalize_or_zero() - + model_update.cohesion.normalize_or_zero()) - * BOID_MAX_VELOCITY - * dt; - boid.velocity = boid.velocity.clamp_length_max(BOID_MAX_VELOCITY); + let boundary_force = out_of_bounds_acceleration * model_config.max_velocity; + let separation_force = model_update.separation * model_config.separation_factor; + let alignment_force = model_update.alignment * model_config.alignment_factor; + let cohesion_force = model_update.cohesion * model_config.cohesion_factor; + + let acceleration = boundary_force + separation_force + alignment_force + cohesion_force; + boid.velocity += acceleration * dt; + boid.velocity = boid.velocity.clamp_length_max(model_config.max_velocity); transform.translation.x += boid.velocity.x * dt; transform.translation.y += boid.velocity.y * dt; diff --git a/web/index.html b/web/index.html index 9eedf5d..bd2566a 100644 --- a/web/index.html +++ b/web/index.html @@ -6,7 +6,8 @@ Personal website - +