├── .github └── workflows │ ├── ci.yaml │ └── release.yaml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── assets ├── bevy_icon.png ├── liquid_particle.png ├── steel_particle.png └── wood_particle.png ├── readme.md ├── renders └── water_steel_wood.png └── src ├── camera.rs ├── components.rs ├── defaults.rs ├── expire_old.rs ├── grid.rs ├── inputs.rs ├── main.rs ├── particle_sprites.rs ├── spawners.rs ├── step_g2p.rs ├── step_p2g.rs ├── step_update_cells.rs ├── step_update_deformations.rs ├── step_update_grid.rs ├── test.rs ├── world.rs └── zoom.rs /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | 14 | # Run cargo test 15 | test: 16 | name: Test Suite 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout sources 20 | uses: actions/checkout@v2 21 | - name: Cache 22 | uses: actions/cache@v2 23 | with: 24 | path: | 25 | ~/.cargo/bin/ 26 | ~/.cargo/registry/index/ 27 | ~/.cargo/registry/cache/ 28 | ~/.cargo/git/db/ 29 | target/ 30 | key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }} 31 | - name: Install stable toolchain 32 | uses: actions-rs/toolchain@v1 33 | with: 34 | profile: minimal 35 | toolchain: stable 36 | override: true 37 | - name: Install Dependencies 38 | run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev 39 | - name: Run cargo test 40 | uses: actions-rs/cargo@v1 41 | with: 42 | command: test 43 | 44 | # Run cargo clippy -- -D warnings 45 | clippy_check: 46 | name: Clippy 47 | runs-on: ubuntu-latest 48 | steps: 49 | - name: Checkout sources 50 | uses: actions/checkout@v2 51 | - name: Cache 52 | uses: actions/cache@v2 53 | with: 54 | path: | 55 | ~/.cargo/bin/ 56 | ~/.cargo/registry/index/ 57 | ~/.cargo/registry/cache/ 58 | ~/.cargo/git/db/ 59 | target/ 60 | key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }} 61 | - name: Install stable toolchain 62 | uses: actions-rs/toolchain@v1 63 | with: 64 | toolchain: stable 65 | profile: minimal 66 | components: clippy 67 | override: true 68 | - name: Install Dependencies 69 | run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev 70 | - name: Run clippy 71 | uses: actions-rs/clippy-check@v1 72 | with: 73 | token: ${{ secrets.GITHUB_TOKEN }} 74 | args: -- -D warnings 75 | 76 | # Run cargo fmt --all -- --check 77 | format: 78 | name: Format 79 | runs-on: ubuntu-latest 80 | steps: 81 | - name: Checkout sources 82 | uses: actions/checkout@v2 83 | - name: Install stable toolchain 84 | uses: actions-rs/toolchain@v1 85 | with: 86 | toolchain: stable 87 | profile: minimal 88 | components: rustfmt 89 | override: true 90 | - name: Run cargo fmt 91 | uses: actions-rs/cargo@v1 92 | with: 93 | command: fmt 94 | args: --all -- --check -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | env: 9 | binary: mlsmpm-particles-rs 10 | 11 | jobs: 12 | 13 | # Build for wasm 14 | release-wasm: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: little-core-labs/get-git-tag@v3.0.1 19 | id: get_version 20 | - uses: actions/checkout@v2 21 | - uses: actions-rs/toolchain@v1 22 | with: 23 | toolchain: stable 24 | target: wasm32-unknown-unknown 25 | override: true 26 | - name: install wasm-bindgen-cli 27 | run: | 28 | cargo install wasm-bindgen-cli 29 | 30 | - name: Build 31 | run: | 32 | cargo build --release --target wasm32-unknown-unknown 33 | 34 | - name: Prepare package 35 | run: | 36 | wasm-bindgen --no-typescript --out-name bevy_game --out-dir wasm --target web target/wasm32-unknown-unknown/release/${{ env.binary }}.wasm 37 | cp -r assets wasm/ 38 | - name: Package as a zip 39 | uses: vimtor/action-zip@v1 40 | with: 41 | files: wasm 42 | dest: ${{ env.binary }}.zip 43 | 44 | - name: Upload binaries to release 45 | uses: svenstaro/upload-release-action@v2 46 | with: 47 | repo_token: ${{ secrets.GITHUB_TOKEN }} 48 | file: ${{ env.binary }}.zip 49 | asset_name: ${{ env.binary }}-wasm-${{ steps.get_version.outputs.tag }}.zip 50 | tag: ${{ github.ref }} 51 | overwrite: true 52 | 53 | # Build for Linux 54 | release-linux: 55 | runs-on: ubuntu-latest 56 | 57 | steps: 58 | - uses: little-core-labs/get-git-tag@v3.0.1 59 | id: get_version 60 | - uses: actions/checkout@v2 61 | - uses: actions-rs/toolchain@v1 62 | with: 63 | toolchain: stable 64 | target: x86_64-unknown-linux-gnu 65 | override: true 66 | - name: install dependencies 67 | run: | 68 | sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev 69 | 70 | - name: Build 71 | run: | 72 | cargo build --release --target x86_64-unknown-linux-gnu 73 | 74 | - name: Prepare package 75 | run: | 76 | mkdir linux 77 | cp target/x86_64-unknown-linux-gnu/release/${{ env.binary }} linux/ 78 | cp -r assets linux/ 79 | - name: Package as a zip 80 | uses: vimtor/action-zip@v1 81 | with: 82 | files: linux 83 | dest: ${{ env.binary }}.zip 84 | 85 | - name: Upload binaries to release 86 | uses: svenstaro/upload-release-action@v2 87 | with: 88 | repo_token: ${{ secrets.GITHUB_TOKEN }} 89 | file: ${{ env.binary }}.zip 90 | asset_name: ${{ env.binary }}-linux-${{ steps.get_version.outputs.tag }}.zip 91 | tag: ${{ github.ref }} 92 | overwrite: true 93 | 94 | # Build for Windows 95 | release-windows: 96 | runs-on: windows-latest 97 | 98 | steps: 99 | - uses: little-core-labs/get-git-tag@v3.0.1 100 | id: get_version 101 | - uses: actions/checkout@v2 102 | - uses: actions-rs/toolchain@v1 103 | with: 104 | toolchain: stable 105 | target: x86_64-pc-windows-msvc 106 | override: true 107 | 108 | - name: Build 109 | run: | 110 | cargo build --release --target x86_64-pc-windows-msvc 111 | 112 | - name: Prepare package 113 | run: | 114 | mkdir windows 115 | cp target/x86_64-pc-windows-msvc/release/${{ env.binary }}.exe windows/ 116 | cp -r assets windows/ 117 | - name: Package as a zip 118 | uses: vimtor/action-zip@v1 119 | with: 120 | files: windows 121 | dest: ${{ env.binary }}.zip 122 | 123 | - name: Upload binaries to release 124 | uses: svenstaro/upload-release-action@v2 125 | with: 126 | repo_token: ${{ secrets.GITHUB_TOKEN }} 127 | file: ${{ env.binary }}.zip 128 | asset_name: ${{ env.binary }}-windows-${{ steps.get_version.outputs.tag }}.zip 129 | tag: ${{ github.ref }} 130 | overwrite: true 131 | 132 | # Build for macOS 133 | release-macos: 134 | runs-on: macOS-latest 135 | 136 | steps: 137 | - uses: little-core-labs/get-git-tag@v3.0.1 138 | id: get_version 139 | - uses: actions/checkout@v2 140 | - uses: actions-rs/toolchain@v1 141 | with: 142 | toolchain: stable 143 | target: x86_64-apple-darwin 144 | override: true 145 | - name: Environment Setup 146 | run: | 147 | export CFLAGS="-fno-stack-check" 148 | export MACOSX_DEPLOYMENT_TARGET="10.9" 149 | 150 | - name: Build 151 | run: | 152 | cargo build --release --target x86_64-apple-darwin 153 | 154 | - name: Prepare Package 155 | run: | 156 | mkdir -p ${{ env.binary }}.app/Contents/MacOS 157 | cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/ 158 | cp -r assets ${{ env.binary }}.app/Contents/MacOS/ 159 | hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}.dmg 160 | 161 | - name: Upload binaries to release 162 | uses: svenstaro/upload-release-action@v2 163 | with: 164 | repo_token: ${{ secrets.GITHUB_TOKEN }} 165 | file: ${{ env.binary }}.dmg 166 | asset_name: ${{ env.binary }}-macos-${{ steps.get_version.outputs.tag }}.dmg 167 | tag: ${{ github.ref }} 168 | overwrite: true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "ab_glyph" 7 | version = "0.2.15" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "24606928a235e73cdef55a0c909719cadd72fce573e5713d58cb2952d8f5794c" 10 | dependencies = [ 11 | "ab_glyph_rasterizer", 12 | "owned_ttf_parser", 13 | ] 14 | 15 | [[package]] 16 | name = "ab_glyph_rasterizer" 17 | version = "0.1.5" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" 20 | 21 | [[package]] 22 | name = "adler" 23 | version = "1.0.2" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 26 | 27 | [[package]] 28 | name = "adler32" 29 | version = "1.2.0" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" 32 | 33 | [[package]] 34 | name = "ahash" 35 | version = "0.7.6" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 38 | dependencies = [ 39 | "getrandom", 40 | "once_cell", 41 | "version_check", 42 | ] 43 | 44 | [[package]] 45 | name = "ahash" 46 | version = "0.8.0" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "57e6e951cfbb2db8de1828d49073a113a29fd7117b1596caa781a258c7e38d72" 49 | dependencies = [ 50 | "cfg-if 1.0.0", 51 | "getrandom", 52 | "once_cell", 53 | "version_check", 54 | ] 55 | 56 | [[package]] 57 | name = "aho-corasick" 58 | version = "0.7.18" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 61 | dependencies = [ 62 | "memchr", 63 | ] 64 | 65 | [[package]] 66 | name = "alsa" 67 | version = "0.6.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "5915f52fe2cf65e83924d037b6c5290b7cee097c6b5c8700746e6168a343fd6b" 70 | dependencies = [ 71 | "alsa-sys", 72 | "bitflags", 73 | "libc", 74 | "nix 0.23.1", 75 | ] 76 | 77 | [[package]] 78 | name = "alsa-sys" 79 | version = "0.3.1" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" 82 | dependencies = [ 83 | "libc", 84 | "pkg-config", 85 | ] 86 | 87 | [[package]] 88 | name = "android_log-sys" 89 | version = "0.2.0" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" 92 | 93 | [[package]] 94 | name = "android_logger" 95 | version = "0.10.1" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "d9ed09b18365ed295d722d0b5ed59c01b79a826ff2d2a8f73d5ecca8e6fb2f66" 98 | dependencies = [ 99 | "android_log-sys", 100 | "env_logger", 101 | "lazy_static", 102 | "log", 103 | ] 104 | 105 | [[package]] 106 | name = "android_system_properties" 107 | version = "0.1.5" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 110 | dependencies = [ 111 | "libc", 112 | ] 113 | 114 | [[package]] 115 | name = "ansi_term" 116 | version = "0.12.1" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 119 | dependencies = [ 120 | "winapi", 121 | ] 122 | 123 | [[package]] 124 | name = "anyhow" 125 | version = "1.0.56" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" 128 | 129 | [[package]] 130 | name = "approx" 131 | version = "0.5.1" 132 | source = "registry+https://github.com/rust-lang/crates.io-index" 133 | checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" 134 | dependencies = [ 135 | "num-traits", 136 | ] 137 | 138 | [[package]] 139 | name = "arboard" 140 | version = "2.1.1" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "dc120354d1b5ec6d7aaf4876b602def75595937b5e15d356eb554ab5177e08bb" 143 | dependencies = [ 144 | "clipboard-win", 145 | "core-graphics 0.22.3", 146 | "image 0.23.14", 147 | "log", 148 | "objc", 149 | "objc-foundation", 150 | "objc_id", 151 | "parking_lot 0.12.1", 152 | "thiserror", 153 | "winapi", 154 | "x11rb", 155 | ] 156 | 157 | [[package]] 158 | name = "arrayvec" 159 | version = "0.7.2" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 162 | 163 | [[package]] 164 | name = "ash" 165 | version = "0.37.0+1.3.209" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "006ca68e0f2b03f22d6fa9f2860f85aed430d257fec20f8879b2145e7c7ae1a6" 168 | dependencies = [ 169 | "libloading", 170 | ] 171 | 172 | [[package]] 173 | name = "async-channel" 174 | version = "1.6.1" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" 177 | dependencies = [ 178 | "concurrent-queue", 179 | "event-listener", 180 | "futures-core", 181 | ] 182 | 183 | [[package]] 184 | name = "async-executor" 185 | version = "1.4.1" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" 188 | dependencies = [ 189 | "async-task", 190 | "concurrent-queue", 191 | "fastrand", 192 | "futures-lite", 193 | "once_cell", 194 | "slab", 195 | ] 196 | 197 | [[package]] 198 | name = "async-task" 199 | version = "4.2.0" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" 202 | 203 | [[package]] 204 | name = "atomic_refcell" 205 | version = "0.1.8" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "73b5e5f48b927f04e952dedc932f31995a65a0bf65ec971c74436e51bf6e970d" 208 | 209 | [[package]] 210 | name = "autocfg" 211 | version = "1.1.0" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 214 | 215 | [[package]] 216 | name = "base64" 217 | version = "0.13.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 220 | 221 | [[package]] 222 | name = "bevy" 223 | version = "0.8.1" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | checksum = "fea147ef1ebb92d41294cfad804c40de151b174c711ce6e0a4a40eba23eae1a4" 226 | dependencies = [ 227 | "bevy_internal", 228 | ] 229 | 230 | [[package]] 231 | name = "bevy_animation" 232 | version = "0.8.1" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "a4365465fca7bd78295eb81d0a04afc049399852793d562eb017849bb5d6c55e" 235 | dependencies = [ 236 | "bevy_app", 237 | "bevy_asset", 238 | "bevy_core", 239 | "bevy_ecs", 240 | "bevy_hierarchy", 241 | "bevy_math", 242 | "bevy_reflect", 243 | "bevy_time", 244 | "bevy_transform", 245 | "bevy_utils", 246 | ] 247 | 248 | [[package]] 249 | name = "bevy_app" 250 | version = "0.8.1" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "9e4ae0a6ed2adf3b153511b4645241660a93f747c05ecd1e5a909dafc803cad4" 253 | dependencies = [ 254 | "bevy_derive", 255 | "bevy_ecs", 256 | "bevy_reflect", 257 | "bevy_tasks", 258 | "bevy_utils", 259 | "wasm-bindgen", 260 | "web-sys", 261 | ] 262 | 263 | [[package]] 264 | name = "bevy_asset" 265 | version = "0.8.1" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "2ec773c861a7e9d9978771f59f385500ec6da3a1ab5487705cddb054393d3d19" 268 | dependencies = [ 269 | "anyhow", 270 | "bevy_app", 271 | "bevy_diagnostic", 272 | "bevy_ecs", 273 | "bevy_log", 274 | "bevy_reflect", 275 | "bevy_tasks", 276 | "bevy_utils", 277 | "crossbeam-channel", 278 | "downcast-rs", 279 | "fastrand", 280 | "js-sys", 281 | "ndk-glue 0.5.1", 282 | "notify", 283 | "parking_lot 0.12.1", 284 | "serde", 285 | "thiserror", 286 | "wasm-bindgen", 287 | "wasm-bindgen-futures", 288 | "web-sys", 289 | ] 290 | 291 | [[package]] 292 | name = "bevy_audio" 293 | version = "0.8.1" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "1e5cf4713a24f318841f73a9e030854cfd5bad46bc81fa1acc9590cdab053c6f" 296 | dependencies = [ 297 | "anyhow", 298 | "bevy_app", 299 | "bevy_asset", 300 | "bevy_ecs", 301 | "bevy_reflect", 302 | "bevy_utils", 303 | "parking_lot 0.12.1", 304 | "rodio", 305 | ] 306 | 307 | [[package]] 308 | name = "bevy_core" 309 | version = "0.8.1" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "c53172003d5cde7780870b5403c66c8ede3581faf3e510e916d8b4baa5b538d2" 312 | dependencies = [ 313 | "bevy_app", 314 | "bevy_ecs", 315 | "bevy_math", 316 | "bevy_reflect", 317 | "bevy_tasks", 318 | "bevy_utils", 319 | "bytemuck", 320 | ] 321 | 322 | [[package]] 323 | name = "bevy_core_pipeline" 324 | version = "0.8.1" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "5e60efd10d593f6d122f2687f74c09ad55835a8f999c35bed6380ddd8e6ff7f2" 327 | dependencies = [ 328 | "bevy_app", 329 | "bevy_asset", 330 | "bevy_derive", 331 | "bevy_ecs", 332 | "bevy_reflect", 333 | "bevy_render", 334 | "bevy_transform", 335 | "bevy_utils", 336 | "radsort", 337 | "serde", 338 | ] 339 | 340 | [[package]] 341 | name = "bevy_derive" 342 | version = "0.8.1" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "0e6345431bbe6d7b6c165cd860ecd0b35da929779571259c5df970ac256d45f9" 345 | dependencies = [ 346 | "bevy_macro_utils", 347 | "quote", 348 | "syn", 349 | ] 350 | 351 | [[package]] 352 | name = "bevy_diagnostic" 353 | version = "0.8.1" 354 | source = "registry+https://github.com/rust-lang/crates.io-index" 355 | checksum = "58ac9f4c2815f412be4b6e21e4b299cdafa710f651d064f6d40b2a8377a0d17c" 356 | dependencies = [ 357 | "bevy_app", 358 | "bevy_ecs", 359 | "bevy_log", 360 | "bevy_time", 361 | "bevy_utils", 362 | ] 363 | 364 | [[package]] 365 | name = "bevy_ecs" 366 | version = "0.8.1" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "c174066a24ed8a14d15ea58b0aea1c1f5c763f4bb36ebdc2b1dc78026007d0f5" 369 | dependencies = [ 370 | "async-channel", 371 | "bevy_ecs_macros", 372 | "bevy_ptr", 373 | "bevy_reflect", 374 | "bevy_tasks", 375 | "bevy_utils", 376 | "downcast-rs", 377 | "fixedbitset", 378 | "fxhash", 379 | "serde", 380 | "thread_local", 381 | ] 382 | 383 | [[package]] 384 | name = "bevy_ecs_macros" 385 | version = "0.8.1" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "cc50c39e49e8febccc74e8e731680adb0cb4aef1f53275740cbaa95c6da71f4f" 388 | dependencies = [ 389 | "bevy_macro_utils", 390 | "proc-macro2", 391 | "quote", 392 | "syn", 393 | ] 394 | 395 | [[package]] 396 | name = "bevy_egui" 397 | version = "0.16.1" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "d365761fd6a5c227b1f88f38b560287334accb69cfe938443e27615464edc897" 400 | dependencies = [ 401 | "arboard", 402 | "bevy", 403 | "egui", 404 | "thread_local", 405 | "webbrowser", 406 | ] 407 | 408 | [[package]] 409 | name = "bevy_encase_derive" 410 | version = "0.8.1" 411 | source = "registry+https://github.com/rust-lang/crates.io-index" 412 | checksum = "68bc194009c5e9b97da64a08142dd183c264885d99c985cf849868103018adf1" 413 | dependencies = [ 414 | "bevy_macro_utils", 415 | "encase_derive_impl", 416 | ] 417 | 418 | [[package]] 419 | name = "bevy_gilrs" 420 | version = "0.8.1" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "cb15a3427d9707be92b457e5d66900b02d853b475c21dd8662bdda387ba9f24e" 423 | dependencies = [ 424 | "bevy_app", 425 | "bevy_ecs", 426 | "bevy_input", 427 | "bevy_utils", 428 | "gilrs", 429 | ] 430 | 431 | [[package]] 432 | name = "bevy_gltf" 433 | version = "0.8.1" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "79db7d7e71b47a69953fbe8407ded5c6308eaeecf9a05efd5dfb42992f400a16" 436 | dependencies = [ 437 | "anyhow", 438 | "base64", 439 | "bevy_animation", 440 | "bevy_app", 441 | "bevy_asset", 442 | "bevy_core", 443 | "bevy_core_pipeline", 444 | "bevy_ecs", 445 | "bevy_hierarchy", 446 | "bevy_log", 447 | "bevy_math", 448 | "bevy_pbr", 449 | "bevy_reflect", 450 | "bevy_render", 451 | "bevy_scene", 452 | "bevy_tasks", 453 | "bevy_transform", 454 | "bevy_utils", 455 | "gltf", 456 | "percent-encoding", 457 | "thiserror", 458 | ] 459 | 460 | [[package]] 461 | name = "bevy_hierarchy" 462 | version = "0.8.1" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "5eb1ec76099ea5a716de08ea42ff41f036ebe2502df1d569168b58f16458a85e" 465 | dependencies = [ 466 | "bevy_app", 467 | "bevy_ecs", 468 | "bevy_reflect", 469 | "bevy_utils", 470 | "smallvec", 471 | ] 472 | 473 | [[package]] 474 | name = "bevy_input" 475 | version = "0.8.1" 476 | source = "registry+https://github.com/rust-lang/crates.io-index" 477 | checksum = "1821c4b760ba6ddb4fe61806e9cc33f40b09a884557aca4553a29b8c7d73c6b4" 478 | dependencies = [ 479 | "bevy_app", 480 | "bevy_ecs", 481 | "bevy_math", 482 | "bevy_utils", 483 | ] 484 | 485 | [[package]] 486 | name = "bevy_internal" 487 | version = "0.8.1" 488 | source = "registry+https://github.com/rust-lang/crates.io-index" 489 | checksum = "ee63ad1e3f95a26ff2c227fadb1534a7bfe3a098e0e45c347f2f2575a573d9bc" 490 | dependencies = [ 491 | "bevy_animation", 492 | "bevy_app", 493 | "bevy_asset", 494 | "bevy_audio", 495 | "bevy_core", 496 | "bevy_core_pipeline", 497 | "bevy_derive", 498 | "bevy_diagnostic", 499 | "bevy_ecs", 500 | "bevy_gilrs", 501 | "bevy_gltf", 502 | "bevy_hierarchy", 503 | "bevy_input", 504 | "bevy_log", 505 | "bevy_math", 506 | "bevy_pbr", 507 | "bevy_ptr", 508 | "bevy_reflect", 509 | "bevy_render", 510 | "bevy_scene", 511 | "bevy_sprite", 512 | "bevy_tasks", 513 | "bevy_text", 514 | "bevy_time", 515 | "bevy_transform", 516 | "bevy_ui", 517 | "bevy_utils", 518 | "bevy_window", 519 | "bevy_winit", 520 | "ndk-glue 0.5.1", 521 | ] 522 | 523 | [[package]] 524 | name = "bevy_log" 525 | version = "0.8.1" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "092daf498887814a064331dfcd1cf487a5ddab01fd38629b84a35b8b664462a1" 528 | dependencies = [ 529 | "android_log-sys", 530 | "bevy_app", 531 | "bevy_utils", 532 | "console_error_panic_hook", 533 | "tracing-log", 534 | "tracing-subscriber", 535 | "tracing-wasm", 536 | ] 537 | 538 | [[package]] 539 | name = "bevy_macro_utils" 540 | version = "0.8.1" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "43fb5137e5198302d7c6c33d1e454cf48a586e7c6fd12f4860f12863951e16b9" 543 | dependencies = [ 544 | "quote", 545 | "syn", 546 | "toml", 547 | ] 548 | 549 | [[package]] 550 | name = "bevy_math" 551 | version = "0.8.1" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "531f2b90c7e861a96f418b3d560131b3354c5e67a67eba3953a45a56ea0114d2" 554 | dependencies = [ 555 | "glam", 556 | ] 557 | 558 | [[package]] 559 | name = "bevy_mikktspace" 560 | version = "0.8.1" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "941e7d3d4e1dbb735f040e4cdc1558be1d3c38d43f1d9fdbb039c39a7849a00b" 563 | dependencies = [ 564 | "glam", 565 | ] 566 | 567 | [[package]] 568 | name = "bevy_pbr" 569 | version = "0.8.1" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "176073021a4caeb8b448f24ce790fb57fde74b114f345064a8b102d2f7bed905" 572 | dependencies = [ 573 | "bevy_app", 574 | "bevy_asset", 575 | "bevy_core_pipeline", 576 | "bevy_ecs", 577 | "bevy_math", 578 | "bevy_reflect", 579 | "bevy_render", 580 | "bevy_transform", 581 | "bevy_utils", 582 | "bevy_window", 583 | "bitflags", 584 | "bytemuck", 585 | "radsort", 586 | ] 587 | 588 | [[package]] 589 | name = "bevy_ptr" 590 | version = "0.8.1" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "9960c19e582b43cebe1894b6679520a4f50802d1cc5b6fa432f8d685ed232f09" 593 | 594 | [[package]] 595 | name = "bevy_reflect" 596 | version = "0.8.1" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "3fc689dd7a7df3b3768884a4754711d406aa302ea48da483c03b52715fa95045" 599 | dependencies = [ 600 | "bevy_ptr", 601 | "bevy_reflect_derive", 602 | "bevy_utils", 603 | "downcast-rs", 604 | "erased-serde", 605 | "glam", 606 | "once_cell", 607 | "parking_lot 0.12.1", 608 | "serde", 609 | "smallvec", 610 | "thiserror", 611 | ] 612 | 613 | [[package]] 614 | name = "bevy_reflect_derive" 615 | version = "0.8.1" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "8c36fa5100832c787c10558d31632ddc454c221e8dfacbbef836938f59614754" 618 | dependencies = [ 619 | "bevy_macro_utils", 620 | "proc-macro2", 621 | "quote", 622 | "syn", 623 | "uuid", 624 | ] 625 | 626 | [[package]] 627 | name = "bevy_render" 628 | version = "0.8.1" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "600bcef85c7efac6e38ed725707f0e5b7c59b510430034ba2f743f472493f845" 631 | dependencies = [ 632 | "anyhow", 633 | "bevy_app", 634 | "bevy_asset", 635 | "bevy_core", 636 | "bevy_derive", 637 | "bevy_ecs", 638 | "bevy_encase_derive", 639 | "bevy_hierarchy", 640 | "bevy_log", 641 | "bevy_math", 642 | "bevy_mikktspace", 643 | "bevy_reflect", 644 | "bevy_render_macros", 645 | "bevy_time", 646 | "bevy_transform", 647 | "bevy_utils", 648 | "bevy_window", 649 | "bitflags", 650 | "codespan-reporting", 651 | "copyless", 652 | "downcast-rs", 653 | "encase", 654 | "futures-lite", 655 | "hex", 656 | "hexasphere", 657 | "image 0.24.4", 658 | "naga", 659 | "once_cell", 660 | "parking_lot 0.12.1", 661 | "regex", 662 | "serde", 663 | "smallvec", 664 | "thiserror", 665 | "thread_local", 666 | "wgpu", 667 | ] 668 | 669 | [[package]] 670 | name = "bevy_render_macros" 671 | version = "0.8.1" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "1be90adc9e5d5808833e363670818da5fe68ccafd7ca983a457f90957d2a430b" 674 | dependencies = [ 675 | "bevy_macro_utils", 676 | "proc-macro2", 677 | "quote", 678 | "syn", 679 | ] 680 | 681 | [[package]] 682 | name = "bevy_scene" 683 | version = "0.8.1" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "a045d575d2c8f776d8ea965363c81660243fefbfc3712ead938b00dfd6797216" 686 | dependencies = [ 687 | "anyhow", 688 | "bevy_app", 689 | "bevy_asset", 690 | "bevy_derive", 691 | "bevy_ecs", 692 | "bevy_hierarchy", 693 | "bevy_reflect", 694 | "bevy_render", 695 | "bevy_transform", 696 | "bevy_utils", 697 | "ron", 698 | "serde", 699 | "thiserror", 700 | "uuid", 701 | ] 702 | 703 | [[package]] 704 | name = "bevy_sprite" 705 | version = "0.8.1" 706 | source = "registry+https://github.com/rust-lang/crates.io-index" 707 | checksum = "69c419f3db09d7ac1f4d45e0874d349d5d6f47f48bc10d55cd0da36413e2331e" 708 | dependencies = [ 709 | "bevy_app", 710 | "bevy_asset", 711 | "bevy_core_pipeline", 712 | "bevy_ecs", 713 | "bevy_log", 714 | "bevy_math", 715 | "bevy_reflect", 716 | "bevy_render", 717 | "bevy_transform", 718 | "bevy_utils", 719 | "bitflags", 720 | "bytemuck", 721 | "copyless", 722 | "fixedbitset", 723 | "guillotiere", 724 | "rectangle-pack", 725 | "serde", 726 | "thiserror", 727 | ] 728 | 729 | [[package]] 730 | name = "bevy_tasks" 731 | version = "0.8.1" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "719b753acb3d5b9dbfd77038560fe1893c17d4ee0a4242c2ee70da9d59430537" 734 | dependencies = [ 735 | "async-channel", 736 | "async-executor", 737 | "event-listener", 738 | "futures-lite", 739 | "num_cpus", 740 | "once_cell", 741 | "wasm-bindgen-futures", 742 | ] 743 | 744 | [[package]] 745 | name = "bevy_text" 746 | version = "0.8.1" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "c265b7515faf55a3b92fd6ce0ab65dd246f247e11d737d6f5cdaf49c2be42c63" 749 | dependencies = [ 750 | "ab_glyph", 751 | "anyhow", 752 | "bevy_app", 753 | "bevy_asset", 754 | "bevy_ecs", 755 | "bevy_math", 756 | "bevy_reflect", 757 | "bevy_render", 758 | "bevy_sprite", 759 | "bevy_transform", 760 | "bevy_utils", 761 | "bevy_window", 762 | "glyph_brush_layout", 763 | "serde", 764 | "thiserror", 765 | ] 766 | 767 | [[package]] 768 | name = "bevy_time" 769 | version = "0.8.1" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "22830665b8476292b861216383fd79922aef2b540f9fd09d49144e3e5e94550e" 772 | dependencies = [ 773 | "bevy_app", 774 | "bevy_ecs", 775 | "bevy_reflect", 776 | "bevy_utils", 777 | "crossbeam-channel", 778 | ] 779 | 780 | [[package]] 781 | name = "bevy_transform" 782 | version = "0.8.1" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | checksum = "a4bb8760f03e9667e7499a5ceec1f7630fc3e45702781ac0df56cb969e8ae668" 785 | dependencies = [ 786 | "bevy_app", 787 | "bevy_ecs", 788 | "bevy_hierarchy", 789 | "bevy_math", 790 | "bevy_reflect", 791 | ] 792 | 793 | [[package]] 794 | name = "bevy_ui" 795 | version = "0.8.1" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "062ce086de1a4a470e5df48cb5c16a1dc97ab610e635cafabdef26c4a1ef5756" 798 | dependencies = [ 799 | "bevy_app", 800 | "bevy_asset", 801 | "bevy_core_pipeline", 802 | "bevy_derive", 803 | "bevy_ecs", 804 | "bevy_hierarchy", 805 | "bevy_input", 806 | "bevy_log", 807 | "bevy_math", 808 | "bevy_reflect", 809 | "bevy_render", 810 | "bevy_sprite", 811 | "bevy_text", 812 | "bevy_transform", 813 | "bevy_utils", 814 | "bevy_window", 815 | "bytemuck", 816 | "serde", 817 | "smallvec", 818 | "taffy", 819 | ] 820 | 821 | [[package]] 822 | name = "bevy_utils" 823 | version = "0.8.1" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "f6e9aa1866c1cf7ee000f281ce9e90d02d701f5c7380a107252017e58e2f5246" 826 | dependencies = [ 827 | "ahash 0.7.6", 828 | "getrandom", 829 | "hashbrown 0.12.3", 830 | "instant", 831 | "tracing", 832 | "uuid", 833 | ] 834 | 835 | [[package]] 836 | name = "bevy_window" 837 | version = "0.8.1" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "707dbbebfac72b1e63e874e7a11a345feab8c440355c0bd71e6dff26709fba9a" 840 | dependencies = [ 841 | "bevy_app", 842 | "bevy_ecs", 843 | "bevy_input", 844 | "bevy_math", 845 | "bevy_utils", 846 | "raw-window-handle", 847 | "web-sys", 848 | ] 849 | 850 | [[package]] 851 | name = "bevy_winit" 852 | version = "0.8.1" 853 | source = "registry+https://github.com/rust-lang/crates.io-index" 854 | checksum = "98b15fee4b75472e3441b0c7221467303e4ce59b342a94a328e447e7cdb5a43c" 855 | dependencies = [ 856 | "approx", 857 | "bevy_app", 858 | "bevy_ecs", 859 | "bevy_input", 860 | "bevy_math", 861 | "bevy_utils", 862 | "bevy_window", 863 | "crossbeam-channel", 864 | "raw-window-handle", 865 | "wasm-bindgen", 866 | "web-sys", 867 | "winit", 868 | ] 869 | 870 | [[package]] 871 | name = "bindgen" 872 | version = "0.56.0" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" 875 | dependencies = [ 876 | "bitflags", 877 | "cexpr", 878 | "clang-sys", 879 | "lazy_static", 880 | "lazycell", 881 | "peeking_take_while", 882 | "proc-macro2", 883 | "quote", 884 | "regex", 885 | "rustc-hash", 886 | "shlex", 887 | ] 888 | 889 | [[package]] 890 | name = "bit-set" 891 | version = "0.5.2" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" 894 | dependencies = [ 895 | "bit-vec", 896 | ] 897 | 898 | [[package]] 899 | name = "bit-vec" 900 | version = "0.6.3" 901 | source = "registry+https://github.com/rust-lang/crates.io-index" 902 | checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 903 | 904 | [[package]] 905 | name = "bitflags" 906 | version = "1.3.2" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 909 | 910 | [[package]] 911 | name = "block" 912 | version = "0.1.6" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" 915 | 916 | [[package]] 917 | name = "bumpalo" 918 | version = "3.9.1" 919 | source = "registry+https://github.com/rust-lang/crates.io-index" 920 | checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" 921 | 922 | [[package]] 923 | name = "bytemuck" 924 | version = "1.8.0" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "0e851ca7c24871e7336801608a4797d7376545b6928a10d32d75685687141ead" 927 | dependencies = [ 928 | "bytemuck_derive", 929 | ] 930 | 931 | [[package]] 932 | name = "bytemuck_derive" 933 | version = "1.0.1" 934 | source = "registry+https://github.com/rust-lang/crates.io-index" 935 | checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" 936 | dependencies = [ 937 | "proc-macro2", 938 | "quote", 939 | "syn", 940 | ] 941 | 942 | [[package]] 943 | name = "byteorder" 944 | version = "1.4.3" 945 | source = "registry+https://github.com/rust-lang/crates.io-index" 946 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 947 | 948 | [[package]] 949 | name = "bytes" 950 | version = "1.1.0" 951 | source = "registry+https://github.com/rust-lang/crates.io-index" 952 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 953 | 954 | [[package]] 955 | name = "cache-padded" 956 | version = "1.2.0" 957 | source = "registry+https://github.com/rust-lang/crates.io-index" 958 | checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" 959 | 960 | [[package]] 961 | name = "cc" 962 | version = "1.0.73" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 965 | dependencies = [ 966 | "jobserver", 967 | ] 968 | 969 | [[package]] 970 | name = "cesu8" 971 | version = "1.1.0" 972 | source = "registry+https://github.com/rust-lang/crates.io-index" 973 | checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" 974 | 975 | [[package]] 976 | name = "cexpr" 977 | version = "0.4.0" 978 | source = "registry+https://github.com/rust-lang/crates.io-index" 979 | checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" 980 | dependencies = [ 981 | "nom", 982 | ] 983 | 984 | [[package]] 985 | name = "cfg-if" 986 | version = "0.1.10" 987 | source = "registry+https://github.com/rust-lang/crates.io-index" 988 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 989 | 990 | [[package]] 991 | name = "cfg-if" 992 | version = "1.0.0" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 995 | 996 | [[package]] 997 | name = "cfg_aliases" 998 | version = "0.1.1" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" 1001 | 1002 | [[package]] 1003 | name = "clang-sys" 1004 | version = "1.3.1" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "4cc00842eed744b858222c4c9faf7243aafc6d33f92f96935263ef4d8a41ce21" 1007 | dependencies = [ 1008 | "glob", 1009 | "libc", 1010 | "libloading", 1011 | ] 1012 | 1013 | [[package]] 1014 | name = "clipboard-win" 1015 | version = "4.4.2" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "c4ab1b92798304eedc095b53942963240037c0516452cb11aeba709d420b2219" 1018 | dependencies = [ 1019 | "error-code", 1020 | "str-buf", 1021 | "winapi", 1022 | ] 1023 | 1024 | [[package]] 1025 | name = "cocoa" 1026 | version = "0.24.0" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" 1029 | dependencies = [ 1030 | "bitflags", 1031 | "block", 1032 | "cocoa-foundation", 1033 | "core-foundation 0.9.3", 1034 | "core-graphics 0.22.3", 1035 | "foreign-types", 1036 | "libc", 1037 | "objc", 1038 | ] 1039 | 1040 | [[package]] 1041 | name = "cocoa-foundation" 1042 | version = "0.1.0" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" 1045 | dependencies = [ 1046 | "bitflags", 1047 | "block", 1048 | "core-foundation 0.9.3", 1049 | "core-graphics-types", 1050 | "foreign-types", 1051 | "libc", 1052 | "objc", 1053 | ] 1054 | 1055 | [[package]] 1056 | name = "codespan-reporting" 1057 | version = "0.11.1" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 1060 | dependencies = [ 1061 | "termcolor", 1062 | "unicode-width", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "color_quant" 1067 | version = "1.1.0" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" 1070 | 1071 | [[package]] 1072 | name = "combine" 1073 | version = "4.6.3" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062" 1076 | dependencies = [ 1077 | "bytes", 1078 | "memchr", 1079 | ] 1080 | 1081 | [[package]] 1082 | name = "concurrent-queue" 1083 | version = "1.2.2" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" 1086 | dependencies = [ 1087 | "cache-padded", 1088 | ] 1089 | 1090 | [[package]] 1091 | name = "console_error_panic_hook" 1092 | version = "0.1.7" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" 1095 | dependencies = [ 1096 | "cfg-if 1.0.0", 1097 | "wasm-bindgen", 1098 | ] 1099 | 1100 | [[package]] 1101 | name = "const_panic" 1102 | version = "0.2.4" 1103 | source = "registry+https://github.com/rust-lang/crates.io-index" 1104 | checksum = "9c0358e41e90e443c69b2b2811f6ec9892c228b93620634cf4344fe89967fa9f" 1105 | 1106 | [[package]] 1107 | name = "copyless" 1108 | version = "0.1.5" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" 1111 | 1112 | [[package]] 1113 | name = "core-foundation" 1114 | version = "0.7.0" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 1117 | dependencies = [ 1118 | "core-foundation-sys 0.7.0", 1119 | "libc", 1120 | ] 1121 | 1122 | [[package]] 1123 | name = "core-foundation" 1124 | version = "0.9.3" 1125 | source = "registry+https://github.com/rust-lang/crates.io-index" 1126 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 1127 | dependencies = [ 1128 | "core-foundation-sys 0.8.3", 1129 | "libc", 1130 | ] 1131 | 1132 | [[package]] 1133 | name = "core-foundation-sys" 1134 | version = "0.7.0" 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" 1136 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 1137 | 1138 | [[package]] 1139 | name = "core-foundation-sys" 1140 | version = "0.8.3" 1141 | source = "registry+https://github.com/rust-lang/crates.io-index" 1142 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 1143 | 1144 | [[package]] 1145 | name = "core-graphics" 1146 | version = "0.19.2" 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" 1148 | checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" 1149 | dependencies = [ 1150 | "bitflags", 1151 | "core-foundation 0.7.0", 1152 | "foreign-types", 1153 | "libc", 1154 | ] 1155 | 1156 | [[package]] 1157 | name = "core-graphics" 1158 | version = "0.22.3" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" 1161 | dependencies = [ 1162 | "bitflags", 1163 | "core-foundation 0.9.3", 1164 | "core-graphics-types", 1165 | "foreign-types", 1166 | "libc", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "core-graphics-types" 1171 | version = "0.1.1" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" 1174 | dependencies = [ 1175 | "bitflags", 1176 | "core-foundation 0.9.3", 1177 | "foreign-types", 1178 | "libc", 1179 | ] 1180 | 1181 | [[package]] 1182 | name = "core-video-sys" 1183 | version = "0.1.4" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" 1186 | dependencies = [ 1187 | "cfg-if 0.1.10", 1188 | "core-foundation-sys 0.7.0", 1189 | "core-graphics 0.19.2", 1190 | "libc", 1191 | "objc", 1192 | ] 1193 | 1194 | [[package]] 1195 | name = "coreaudio-rs" 1196 | version = "0.10.0" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "11894b20ebfe1ff903cbdc52259693389eea03b94918a2def2c30c3bf227ad88" 1199 | dependencies = [ 1200 | "bitflags", 1201 | "coreaudio-sys", 1202 | ] 1203 | 1204 | [[package]] 1205 | name = "coreaudio-sys" 1206 | version = "0.2.9" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "ca4679a59dbd8c15f064c012dfe8c1163b9453224238b59bb9328c142b8b248b" 1209 | dependencies = [ 1210 | "bindgen", 1211 | ] 1212 | 1213 | [[package]] 1214 | name = "cpal" 1215 | version = "0.13.5" 1216 | source = "registry+https://github.com/rust-lang/crates.io-index" 1217 | checksum = "74117836a5124f3629e4b474eed03e479abaf98988b4bb317e29f08cfe0e4116" 1218 | dependencies = [ 1219 | "alsa", 1220 | "core-foundation-sys 0.8.3", 1221 | "coreaudio-rs", 1222 | "jni", 1223 | "js-sys", 1224 | "lazy_static", 1225 | "libc", 1226 | "mach", 1227 | "ndk 0.6.0", 1228 | "ndk-glue 0.6.1", 1229 | "nix 0.23.1", 1230 | "oboe", 1231 | "parking_lot 0.11.2", 1232 | "stdweb", 1233 | "thiserror", 1234 | "wasm-bindgen", 1235 | "web-sys", 1236 | "winapi", 1237 | ] 1238 | 1239 | [[package]] 1240 | name = "crc32fast" 1241 | version = "1.3.2" 1242 | source = "registry+https://github.com/rust-lang/crates.io-index" 1243 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 1244 | dependencies = [ 1245 | "cfg-if 1.0.0", 1246 | ] 1247 | 1248 | [[package]] 1249 | name = "crossbeam-channel" 1250 | version = "0.5.2" 1251 | source = "registry+https://github.com/rust-lang/crates.io-index" 1252 | checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" 1253 | dependencies = [ 1254 | "cfg-if 1.0.0", 1255 | "crossbeam-utils", 1256 | ] 1257 | 1258 | [[package]] 1259 | name = "crossbeam-utils" 1260 | version = "0.8.7" 1261 | source = "registry+https://github.com/rust-lang/crates.io-index" 1262 | checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" 1263 | dependencies = [ 1264 | "cfg-if 1.0.0", 1265 | "lazy_static", 1266 | ] 1267 | 1268 | [[package]] 1269 | name = "cty" 1270 | version = "0.2.2" 1271 | source = "registry+https://github.com/rust-lang/crates.io-index" 1272 | checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" 1273 | 1274 | [[package]] 1275 | name = "d3d12" 1276 | version = "0.5.0" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759" 1279 | dependencies = [ 1280 | "bitflags", 1281 | "libloading", 1282 | "winapi", 1283 | ] 1284 | 1285 | [[package]] 1286 | name = "darling" 1287 | version = "0.13.1" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" 1290 | dependencies = [ 1291 | "darling_core", 1292 | "darling_macro", 1293 | ] 1294 | 1295 | [[package]] 1296 | name = "darling_core" 1297 | version = "0.13.1" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" 1300 | dependencies = [ 1301 | "fnv", 1302 | "ident_case", 1303 | "proc-macro2", 1304 | "quote", 1305 | "strsim", 1306 | "syn", 1307 | ] 1308 | 1309 | [[package]] 1310 | name = "darling_macro" 1311 | version = "0.13.1" 1312 | source = "registry+https://github.com/rust-lang/crates.io-index" 1313 | checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" 1314 | dependencies = [ 1315 | "darling_core", 1316 | "quote", 1317 | "syn", 1318 | ] 1319 | 1320 | [[package]] 1321 | name = "deflate" 1322 | version = "0.8.6" 1323 | source = "registry+https://github.com/rust-lang/crates.io-index" 1324 | checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" 1325 | dependencies = [ 1326 | "adler32", 1327 | "byteorder", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "dispatch" 1332 | version = "0.2.0" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" 1335 | 1336 | [[package]] 1337 | name = "downcast-rs" 1338 | version = "1.2.0" 1339 | source = "registry+https://github.com/rust-lang/crates.io-index" 1340 | checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" 1341 | 1342 | [[package]] 1343 | name = "egui" 1344 | version = "0.19.0" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "fc9fcd393c3daaaf5909008a1d948319d538b79c51871e4df0993260260a94e4" 1347 | dependencies = [ 1348 | "ahash 0.8.0", 1349 | "epaint", 1350 | "nohash-hasher", 1351 | ] 1352 | 1353 | [[package]] 1354 | name = "emath" 1355 | version = "0.19.0" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "9542a40106fdba943a055f418d1746a050e1a903a049b030c2b097d4686a33cf" 1358 | dependencies = [ 1359 | "bytemuck", 1360 | ] 1361 | 1362 | [[package]] 1363 | name = "encase" 1364 | version = "0.3.0" 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" 1366 | checksum = "0a516181e9a36e8982cb37933c5e7dba638c42938cacde46ee4e5b4156f881b9" 1367 | dependencies = [ 1368 | "const_panic", 1369 | "encase_derive", 1370 | "glam", 1371 | "thiserror", 1372 | ] 1373 | 1374 | [[package]] 1375 | name = "encase_derive" 1376 | version = "0.3.0" 1377 | source = "registry+https://github.com/rust-lang/crates.io-index" 1378 | checksum = "f5b802412eea315f29f2bb2da3a5963cd6121f56eaa06aebcdc0c54eea578f22" 1379 | dependencies = [ 1380 | "encase_derive_impl", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "encase_derive_impl" 1385 | version = "0.3.0" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "0f2f4de457d974f548d2c2a16f709ebd81013579e543bd1a9b19ced88132c2cf" 1388 | dependencies = [ 1389 | "proc-macro2", 1390 | "quote", 1391 | "syn", 1392 | ] 1393 | 1394 | [[package]] 1395 | name = "env_logger" 1396 | version = "0.8.4" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" 1399 | dependencies = [ 1400 | "log", 1401 | "regex", 1402 | ] 1403 | 1404 | [[package]] 1405 | name = "epaint" 1406 | version = "0.19.0" 1407 | source = "registry+https://github.com/rust-lang/crates.io-index" 1408 | checksum = "5ba04741be7f6602b1a1b28f1082cce45948a7032961c52814f8946b28493300" 1409 | dependencies = [ 1410 | "ab_glyph", 1411 | "ahash 0.8.0", 1412 | "atomic_refcell", 1413 | "bytemuck", 1414 | "emath", 1415 | "nohash-hasher", 1416 | "parking_lot 0.12.1", 1417 | ] 1418 | 1419 | [[package]] 1420 | name = "erased-serde" 1421 | version = "0.3.18" 1422 | source = "registry+https://github.com/rust-lang/crates.io-index" 1423 | checksum = "56047058e1ab118075ca22f9ecd737bcc961aa3566a3019cb71388afa280bd8a" 1424 | dependencies = [ 1425 | "serde", 1426 | ] 1427 | 1428 | [[package]] 1429 | name = "error-code" 1430 | version = "2.3.1" 1431 | source = "registry+https://github.com/rust-lang/crates.io-index" 1432 | checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" 1433 | dependencies = [ 1434 | "libc", 1435 | "str-buf", 1436 | ] 1437 | 1438 | [[package]] 1439 | name = "euclid" 1440 | version = "0.22.6" 1441 | source = "registry+https://github.com/rust-lang/crates.io-index" 1442 | checksum = "da96828553a086d7b18dcebfc579bd9628b016f86590d7453c115e490fa74b80" 1443 | dependencies = [ 1444 | "num-traits", 1445 | ] 1446 | 1447 | [[package]] 1448 | name = "event-listener" 1449 | version = "2.5.2" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" 1452 | 1453 | [[package]] 1454 | name = "fastrand" 1455 | version = "1.7.0" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 1458 | dependencies = [ 1459 | "instant", 1460 | ] 1461 | 1462 | [[package]] 1463 | name = "filetime" 1464 | version = "0.2.15" 1465 | source = "registry+https://github.com/rust-lang/crates.io-index" 1466 | checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" 1467 | dependencies = [ 1468 | "cfg-if 1.0.0", 1469 | "libc", 1470 | "redox_syscall", 1471 | "winapi", 1472 | ] 1473 | 1474 | [[package]] 1475 | name = "fixedbitset" 1476 | version = "0.4.1" 1477 | source = "registry+https://github.com/rust-lang/crates.io-index" 1478 | checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" 1479 | 1480 | [[package]] 1481 | name = "flate2" 1482 | version = "1.0.24" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" 1485 | dependencies = [ 1486 | "crc32fast", 1487 | "miniz_oxide 0.5.4", 1488 | ] 1489 | 1490 | [[package]] 1491 | name = "fnv" 1492 | version = "1.0.7" 1493 | source = "registry+https://github.com/rust-lang/crates.io-index" 1494 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 1495 | 1496 | [[package]] 1497 | name = "foreign-types" 1498 | version = "0.3.2" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 1501 | dependencies = [ 1502 | "foreign-types-shared", 1503 | ] 1504 | 1505 | [[package]] 1506 | name = "foreign-types-shared" 1507 | version = "0.1.1" 1508 | source = "registry+https://github.com/rust-lang/crates.io-index" 1509 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 1510 | 1511 | [[package]] 1512 | name = "form_urlencoded" 1513 | version = "1.0.1" 1514 | source = "registry+https://github.com/rust-lang/crates.io-index" 1515 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 1516 | dependencies = [ 1517 | "matches", 1518 | "percent-encoding", 1519 | ] 1520 | 1521 | [[package]] 1522 | name = "fsevent-sys" 1523 | version = "4.1.0" 1524 | source = "registry+https://github.com/rust-lang/crates.io-index" 1525 | checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" 1526 | dependencies = [ 1527 | "libc", 1528 | ] 1529 | 1530 | [[package]] 1531 | name = "futures-core" 1532 | version = "0.3.21" 1533 | source = "registry+https://github.com/rust-lang/crates.io-index" 1534 | checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 1535 | 1536 | [[package]] 1537 | name = "futures-io" 1538 | version = "0.3.21" 1539 | source = "registry+https://github.com/rust-lang/crates.io-index" 1540 | checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" 1541 | 1542 | [[package]] 1543 | name = "futures-lite" 1544 | version = "1.12.0" 1545 | source = "registry+https://github.com/rust-lang/crates.io-index" 1546 | checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" 1547 | dependencies = [ 1548 | "fastrand", 1549 | "futures-core", 1550 | "futures-io", 1551 | "memchr", 1552 | "parking", 1553 | "pin-project-lite", 1554 | "waker-fn", 1555 | ] 1556 | 1557 | [[package]] 1558 | name = "fxhash" 1559 | version = "0.2.1" 1560 | source = "registry+https://github.com/rust-lang/crates.io-index" 1561 | checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" 1562 | dependencies = [ 1563 | "byteorder", 1564 | ] 1565 | 1566 | [[package]] 1567 | name = "gethostname" 1568 | version = "0.2.3" 1569 | source = "registry+https://github.com/rust-lang/crates.io-index" 1570 | checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" 1571 | dependencies = [ 1572 | "libc", 1573 | "winapi", 1574 | ] 1575 | 1576 | [[package]] 1577 | name = "getrandom" 1578 | version = "0.2.5" 1579 | source = "registry+https://github.com/rust-lang/crates.io-index" 1580 | checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" 1581 | dependencies = [ 1582 | "cfg-if 1.0.0", 1583 | "js-sys", 1584 | "libc", 1585 | "wasi", 1586 | "wasm-bindgen", 1587 | ] 1588 | 1589 | [[package]] 1590 | name = "gilrs" 1591 | version = "0.9.0" 1592 | source = "registry+https://github.com/rust-lang/crates.io-index" 1593 | checksum = "1d6ba7c37bf8ea7ba0c3e3795dfa1a7771b1e47c4bb417c4d27c7b338d79685f" 1594 | dependencies = [ 1595 | "fnv", 1596 | "gilrs-core", 1597 | "log", 1598 | "uuid", 1599 | "vec_map", 1600 | ] 1601 | 1602 | [[package]] 1603 | name = "gilrs-core" 1604 | version = "0.4.1" 1605 | source = "registry+https://github.com/rust-lang/crates.io-index" 1606 | checksum = "96a8d94a7fc5afd27e894e08a4cfe5a49237f85bcc7140e90721bad3399c7d02" 1607 | dependencies = [ 1608 | "core-foundation 0.9.3", 1609 | "io-kit-sys", 1610 | "js-sys", 1611 | "libc", 1612 | "libudev-sys", 1613 | "log", 1614 | "nix 0.24.2", 1615 | "rusty-xinput", 1616 | "uuid", 1617 | "vec_map", 1618 | "wasm-bindgen", 1619 | "web-sys", 1620 | "winapi", 1621 | ] 1622 | 1623 | [[package]] 1624 | name = "glam" 1625 | version = "0.21.3" 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" 1627 | checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815" 1628 | dependencies = [ 1629 | "bytemuck", 1630 | "serde", 1631 | ] 1632 | 1633 | [[package]] 1634 | name = "glob" 1635 | version = "0.3.0" 1636 | source = "registry+https://github.com/rust-lang/crates.io-index" 1637 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 1638 | 1639 | [[package]] 1640 | name = "glow" 1641 | version = "0.11.2" 1642 | source = "registry+https://github.com/rust-lang/crates.io-index" 1643 | checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" 1644 | dependencies = [ 1645 | "js-sys", 1646 | "slotmap", 1647 | "wasm-bindgen", 1648 | "web-sys", 1649 | ] 1650 | 1651 | [[package]] 1652 | name = "gltf" 1653 | version = "1.0.0" 1654 | source = "registry+https://github.com/rust-lang/crates.io-index" 1655 | checksum = "00e0a0eace786193fc83644907097285396360e9e82e30f81a21e9b1ba836a3e" 1656 | dependencies = [ 1657 | "byteorder", 1658 | "gltf-json", 1659 | "lazy_static", 1660 | ] 1661 | 1662 | [[package]] 1663 | name = "gltf-derive" 1664 | version = "1.0.0" 1665 | source = "registry+https://github.com/rust-lang/crates.io-index" 1666 | checksum = "bdd53d6e284bb2bf02a6926e4cc4984978c1990914d6cd9deae4e31cf37cd113" 1667 | dependencies = [ 1668 | "inflections", 1669 | "proc-macro2", 1670 | "quote", 1671 | "syn", 1672 | ] 1673 | 1674 | [[package]] 1675 | name = "gltf-json" 1676 | version = "1.0.0" 1677 | source = "registry+https://github.com/rust-lang/crates.io-index" 1678 | checksum = "9949836a9ec5e7f83f76fb9bbcbc77f254a577ebbdb0820867bc11979ef97cad" 1679 | dependencies = [ 1680 | "gltf-derive", 1681 | "serde", 1682 | "serde_derive", 1683 | "serde_json", 1684 | ] 1685 | 1686 | [[package]] 1687 | name = "glyph_brush_layout" 1688 | version = "0.2.3" 1689 | source = "registry+https://github.com/rust-lang/crates.io-index" 1690 | checksum = "cc32c2334f00ca5ac3695c5009ae35da21da8c62d255b5b96d56e2597a637a38" 1691 | dependencies = [ 1692 | "ab_glyph", 1693 | "approx", 1694 | "xi-unicode", 1695 | ] 1696 | 1697 | [[package]] 1698 | name = "gpu-alloc" 1699 | version = "0.5.3" 1700 | source = "registry+https://github.com/rust-lang/crates.io-index" 1701 | checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d" 1702 | dependencies = [ 1703 | "bitflags", 1704 | "gpu-alloc-types", 1705 | ] 1706 | 1707 | [[package]] 1708 | name = "gpu-alloc-types" 1709 | version = "0.2.0" 1710 | source = "registry+https://github.com/rust-lang/crates.io-index" 1711 | checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" 1712 | dependencies = [ 1713 | "bitflags", 1714 | ] 1715 | 1716 | [[package]] 1717 | name = "gpu-descriptor" 1718 | version = "0.2.2" 1719 | source = "registry+https://github.com/rust-lang/crates.io-index" 1720 | checksum = "a538f217be4d405ff4719a283ca68323cc2384003eca5baaa87501e821c81dda" 1721 | dependencies = [ 1722 | "bitflags", 1723 | "gpu-descriptor-types", 1724 | "hashbrown 0.11.2", 1725 | ] 1726 | 1727 | [[package]] 1728 | name = "gpu-descriptor-types" 1729 | version = "0.1.1" 1730 | source = "registry+https://github.com/rust-lang/crates.io-index" 1731 | checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" 1732 | dependencies = [ 1733 | "bitflags", 1734 | ] 1735 | 1736 | [[package]] 1737 | name = "guillotiere" 1738 | version = "0.6.2" 1739 | source = "registry+https://github.com/rust-lang/crates.io-index" 1740 | checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782" 1741 | dependencies = [ 1742 | "euclid", 1743 | "svg_fmt", 1744 | ] 1745 | 1746 | [[package]] 1747 | name = "hash32" 1748 | version = "0.2.1" 1749 | source = "registry+https://github.com/rust-lang/crates.io-index" 1750 | checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" 1751 | dependencies = [ 1752 | "byteorder", 1753 | ] 1754 | 1755 | [[package]] 1756 | name = "hash32-derive" 1757 | version = "0.1.1" 1758 | source = "registry+https://github.com/rust-lang/crates.io-index" 1759 | checksum = "59d2aba832b60be25c1b169146b27c64115470981b128ed84c8db18c1b03c6ff" 1760 | dependencies = [ 1761 | "proc-macro2", 1762 | "quote", 1763 | "syn", 1764 | ] 1765 | 1766 | [[package]] 1767 | name = "hashbrown" 1768 | version = "0.11.2" 1769 | source = "registry+https://github.com/rust-lang/crates.io-index" 1770 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 1771 | dependencies = [ 1772 | "ahash 0.7.6", 1773 | ] 1774 | 1775 | [[package]] 1776 | name = "hashbrown" 1777 | version = "0.12.3" 1778 | source = "registry+https://github.com/rust-lang/crates.io-index" 1779 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 1780 | dependencies = [ 1781 | "ahash 0.7.6", 1782 | "serde", 1783 | ] 1784 | 1785 | [[package]] 1786 | name = "hermit-abi" 1787 | version = "0.1.19" 1788 | source = "registry+https://github.com/rust-lang/crates.io-index" 1789 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 1790 | dependencies = [ 1791 | "libc", 1792 | ] 1793 | 1794 | [[package]] 1795 | name = "hex" 1796 | version = "0.4.3" 1797 | source = "registry+https://github.com/rust-lang/crates.io-index" 1798 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 1799 | 1800 | [[package]] 1801 | name = "hexasphere" 1802 | version = "7.2.1" 1803 | source = "registry+https://github.com/rust-lang/crates.io-index" 1804 | checksum = "aaadafd1beb6ad34cff5521987017ece5848f9ad5401fdb039bff896a643add4" 1805 | dependencies = [ 1806 | "glam", 1807 | "once_cell", 1808 | ] 1809 | 1810 | [[package]] 1811 | name = "hexf-parse" 1812 | version = "0.2.1" 1813 | source = "registry+https://github.com/rust-lang/crates.io-index" 1814 | checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" 1815 | 1816 | [[package]] 1817 | name = "ident_case" 1818 | version = "1.0.1" 1819 | source = "registry+https://github.com/rust-lang/crates.io-index" 1820 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 1821 | 1822 | [[package]] 1823 | name = "idna" 1824 | version = "0.2.3" 1825 | source = "registry+https://github.com/rust-lang/crates.io-index" 1826 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 1827 | dependencies = [ 1828 | "matches", 1829 | "unicode-bidi", 1830 | "unicode-normalization", 1831 | ] 1832 | 1833 | [[package]] 1834 | name = "image" 1835 | version = "0.23.14" 1836 | source = "registry+https://github.com/rust-lang/crates.io-index" 1837 | checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" 1838 | dependencies = [ 1839 | "bytemuck", 1840 | "byteorder", 1841 | "color_quant", 1842 | "num-iter", 1843 | "num-rational 0.3.2", 1844 | "num-traits", 1845 | "png 0.16.8", 1846 | "tiff", 1847 | ] 1848 | 1849 | [[package]] 1850 | name = "image" 1851 | version = "0.24.4" 1852 | source = "registry+https://github.com/rust-lang/crates.io-index" 1853 | checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" 1854 | dependencies = [ 1855 | "bytemuck", 1856 | "byteorder", 1857 | "color_quant", 1858 | "num-rational 0.4.1", 1859 | "num-traits", 1860 | "png 0.17.6", 1861 | "scoped_threadpool", 1862 | ] 1863 | 1864 | [[package]] 1865 | name = "indexmap" 1866 | version = "1.8.0" 1867 | source = "registry+https://github.com/rust-lang/crates.io-index" 1868 | checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" 1869 | dependencies = [ 1870 | "autocfg", 1871 | "hashbrown 0.11.2", 1872 | ] 1873 | 1874 | [[package]] 1875 | name = "inflections" 1876 | version = "1.1.1" 1877 | source = "registry+https://github.com/rust-lang/crates.io-index" 1878 | checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" 1879 | 1880 | [[package]] 1881 | name = "inotify" 1882 | version = "0.9.6" 1883 | source = "registry+https://github.com/rust-lang/crates.io-index" 1884 | checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" 1885 | dependencies = [ 1886 | "bitflags", 1887 | "inotify-sys", 1888 | "libc", 1889 | ] 1890 | 1891 | [[package]] 1892 | name = "inotify-sys" 1893 | version = "0.1.5" 1894 | source = "registry+https://github.com/rust-lang/crates.io-index" 1895 | checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" 1896 | dependencies = [ 1897 | "libc", 1898 | ] 1899 | 1900 | [[package]] 1901 | name = "inplace_it" 1902 | version = "0.3.3" 1903 | source = "registry+https://github.com/rust-lang/crates.io-index" 1904 | checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" 1905 | 1906 | [[package]] 1907 | name = "instant" 1908 | version = "0.1.12" 1909 | source = "registry+https://github.com/rust-lang/crates.io-index" 1910 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 1911 | dependencies = [ 1912 | "cfg-if 1.0.0", 1913 | "js-sys", 1914 | "wasm-bindgen", 1915 | "web-sys", 1916 | ] 1917 | 1918 | [[package]] 1919 | name = "io-kit-sys" 1920 | version = "0.2.0" 1921 | source = "registry+https://github.com/rust-lang/crates.io-index" 1922 | checksum = "7789f7f3c9686f96164f5109d69152de759e76e284f736bd57661c6df5091919" 1923 | dependencies = [ 1924 | "core-foundation-sys 0.8.3", 1925 | "mach", 1926 | ] 1927 | 1928 | [[package]] 1929 | name = "itoa" 1930 | version = "1.0.1" 1931 | source = "registry+https://github.com/rust-lang/crates.io-index" 1932 | checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" 1933 | 1934 | [[package]] 1935 | name = "jni" 1936 | version = "0.19.0" 1937 | source = "registry+https://github.com/rust-lang/crates.io-index" 1938 | checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" 1939 | dependencies = [ 1940 | "cesu8", 1941 | "combine", 1942 | "jni-sys", 1943 | "log", 1944 | "thiserror", 1945 | "walkdir", 1946 | ] 1947 | 1948 | [[package]] 1949 | name = "jni-sys" 1950 | version = "0.3.0" 1951 | source = "registry+https://github.com/rust-lang/crates.io-index" 1952 | checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" 1953 | 1954 | [[package]] 1955 | name = "jobserver" 1956 | version = "0.1.24" 1957 | source = "registry+https://github.com/rust-lang/crates.io-index" 1958 | checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" 1959 | dependencies = [ 1960 | "libc", 1961 | ] 1962 | 1963 | [[package]] 1964 | name = "jpeg-decoder" 1965 | version = "0.1.22" 1966 | source = "registry+https://github.com/rust-lang/crates.io-index" 1967 | checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" 1968 | 1969 | [[package]] 1970 | name = "js-sys" 1971 | version = "0.3.60" 1972 | source = "registry+https://github.com/rust-lang/crates.io-index" 1973 | checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" 1974 | dependencies = [ 1975 | "wasm-bindgen", 1976 | ] 1977 | 1978 | [[package]] 1979 | name = "khronos-egl" 1980 | version = "4.1.0" 1981 | source = "registry+https://github.com/rust-lang/crates.io-index" 1982 | checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" 1983 | dependencies = [ 1984 | "libc", 1985 | "libloading", 1986 | "pkg-config", 1987 | ] 1988 | 1989 | [[package]] 1990 | name = "kqueue" 1991 | version = "1.0.4" 1992 | source = "registry+https://github.com/rust-lang/crates.io-index" 1993 | checksum = "058a107a784f8be94c7d35c1300f4facced2e93d2fbe5b1452b44e905ddca4a9" 1994 | dependencies = [ 1995 | "kqueue-sys", 1996 | "libc", 1997 | ] 1998 | 1999 | [[package]] 2000 | name = "kqueue-sys" 2001 | version = "1.0.3" 2002 | source = "registry+https://github.com/rust-lang/crates.io-index" 2003 | checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" 2004 | dependencies = [ 2005 | "bitflags", 2006 | "libc", 2007 | ] 2008 | 2009 | [[package]] 2010 | name = "lazy_static" 2011 | version = "1.4.0" 2012 | source = "registry+https://github.com/rust-lang/crates.io-index" 2013 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 2014 | 2015 | [[package]] 2016 | name = "lazycell" 2017 | version = "1.3.0" 2018 | source = "registry+https://github.com/rust-lang/crates.io-index" 2019 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 2020 | 2021 | [[package]] 2022 | name = "lewton" 2023 | version = "0.10.2" 2024 | source = "registry+https://github.com/rust-lang/crates.io-index" 2025 | checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" 2026 | dependencies = [ 2027 | "byteorder", 2028 | "ogg", 2029 | "tinyvec", 2030 | ] 2031 | 2032 | [[package]] 2033 | name = "libc" 2034 | version = "0.2.134" 2035 | source = "registry+https://github.com/rust-lang/crates.io-index" 2036 | checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" 2037 | 2038 | [[package]] 2039 | name = "libloading" 2040 | version = "0.7.3" 2041 | source = "registry+https://github.com/rust-lang/crates.io-index" 2042 | checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" 2043 | dependencies = [ 2044 | "cfg-if 1.0.0", 2045 | "winapi", 2046 | ] 2047 | 2048 | [[package]] 2049 | name = "libudev-sys" 2050 | version = "0.1.4" 2051 | source = "registry+https://github.com/rust-lang/crates.io-index" 2052 | checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" 2053 | dependencies = [ 2054 | "libc", 2055 | "pkg-config", 2056 | ] 2057 | 2058 | [[package]] 2059 | name = "lock_api" 2060 | version = "0.4.6" 2061 | source = "registry+https://github.com/rust-lang/crates.io-index" 2062 | checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" 2063 | dependencies = [ 2064 | "scopeguard", 2065 | ] 2066 | 2067 | [[package]] 2068 | name = "log" 2069 | version = "0.4.14" 2070 | source = "registry+https://github.com/rust-lang/crates.io-index" 2071 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 2072 | dependencies = [ 2073 | "cfg-if 1.0.0", 2074 | ] 2075 | 2076 | [[package]] 2077 | name = "mach" 2078 | version = "0.3.2" 2079 | source = "registry+https://github.com/rust-lang/crates.io-index" 2080 | checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" 2081 | dependencies = [ 2082 | "libc", 2083 | ] 2084 | 2085 | [[package]] 2086 | name = "malloc_buf" 2087 | version = "0.0.6" 2088 | source = "registry+https://github.com/rust-lang/crates.io-index" 2089 | checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" 2090 | dependencies = [ 2091 | "libc", 2092 | ] 2093 | 2094 | [[package]] 2095 | name = "matchers" 2096 | version = "0.1.0" 2097 | source = "registry+https://github.com/rust-lang/crates.io-index" 2098 | checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" 2099 | dependencies = [ 2100 | "regex-automata", 2101 | ] 2102 | 2103 | [[package]] 2104 | name = "matches" 2105 | version = "0.1.9" 2106 | source = "registry+https://github.com/rust-lang/crates.io-index" 2107 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 2108 | 2109 | [[package]] 2110 | name = "memchr" 2111 | version = "2.4.1" 2112 | source = "registry+https://github.com/rust-lang/crates.io-index" 2113 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 2114 | 2115 | [[package]] 2116 | name = "memoffset" 2117 | version = "0.6.5" 2118 | source = "registry+https://github.com/rust-lang/crates.io-index" 2119 | checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" 2120 | dependencies = [ 2121 | "autocfg", 2122 | ] 2123 | 2124 | [[package]] 2125 | name = "metal" 2126 | version = "0.24.0" 2127 | source = "registry+https://github.com/rust-lang/crates.io-index" 2128 | checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" 2129 | dependencies = [ 2130 | "bitflags", 2131 | "block", 2132 | "core-graphics-types", 2133 | "foreign-types", 2134 | "log", 2135 | "objc", 2136 | ] 2137 | 2138 | [[package]] 2139 | name = "miniz_oxide" 2140 | version = "0.3.7" 2141 | source = "registry+https://github.com/rust-lang/crates.io-index" 2142 | checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" 2143 | dependencies = [ 2144 | "adler32", 2145 | ] 2146 | 2147 | [[package]] 2148 | name = "miniz_oxide" 2149 | version = "0.4.4" 2150 | source = "registry+https://github.com/rust-lang/crates.io-index" 2151 | checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" 2152 | dependencies = [ 2153 | "adler", 2154 | "autocfg", 2155 | ] 2156 | 2157 | [[package]] 2158 | name = "miniz_oxide" 2159 | version = "0.5.4" 2160 | source = "registry+https://github.com/rust-lang/crates.io-index" 2161 | checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" 2162 | dependencies = [ 2163 | "adler", 2164 | ] 2165 | 2166 | [[package]] 2167 | name = "mio" 2168 | version = "0.8.0" 2169 | source = "registry+https://github.com/rust-lang/crates.io-index" 2170 | checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" 2171 | dependencies = [ 2172 | "libc", 2173 | "log", 2174 | "miow", 2175 | "ntapi", 2176 | "winapi", 2177 | ] 2178 | 2179 | [[package]] 2180 | name = "miow" 2181 | version = "0.3.7" 2182 | source = "registry+https://github.com/rust-lang/crates.io-index" 2183 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 2184 | dependencies = [ 2185 | "winapi", 2186 | ] 2187 | 2188 | [[package]] 2189 | name = "mlsmpm-particles-rs" 2190 | version = "0.1.1" 2191 | dependencies = [ 2192 | "bevy", 2193 | "bevy_egui", 2194 | "rand", 2195 | ] 2196 | 2197 | [[package]] 2198 | name = "naga" 2199 | version = "0.9.0" 2200 | source = "registry+https://github.com/rust-lang/crates.io-index" 2201 | checksum = "5f50357e1167a3ab92d6b3c7f4bf5f7fd13fde3f4b28bf0d5ea07b5100fdb6c0" 2202 | dependencies = [ 2203 | "bit-set", 2204 | "bitflags", 2205 | "codespan-reporting", 2206 | "hexf-parse", 2207 | "indexmap", 2208 | "log", 2209 | "num-traits", 2210 | "petgraph", 2211 | "pp-rs", 2212 | "rustc-hash", 2213 | "spirv", 2214 | "termcolor", 2215 | "thiserror", 2216 | "unicode-xid", 2217 | ] 2218 | 2219 | [[package]] 2220 | name = "ndk" 2221 | version = "0.5.0" 2222 | source = "registry+https://github.com/rust-lang/crates.io-index" 2223 | checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" 2224 | dependencies = [ 2225 | "bitflags", 2226 | "jni-sys", 2227 | "ndk-sys 0.2.2", 2228 | "num_enum", 2229 | "thiserror", 2230 | ] 2231 | 2232 | [[package]] 2233 | name = "ndk" 2234 | version = "0.6.0" 2235 | source = "registry+https://github.com/rust-lang/crates.io-index" 2236 | checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" 2237 | dependencies = [ 2238 | "bitflags", 2239 | "jni-sys", 2240 | "ndk-sys 0.3.0", 2241 | "num_enum", 2242 | "thiserror", 2243 | ] 2244 | 2245 | [[package]] 2246 | name = "ndk-context" 2247 | version = "0.1.0" 2248 | source = "registry+https://github.com/rust-lang/crates.io-index" 2249 | checksum = "4e3c5cc68637e21fe8f077f6a1c9e0b9ca495bb74895226b476310f613325884" 2250 | 2251 | [[package]] 2252 | name = "ndk-glue" 2253 | version = "0.5.1" 2254 | source = "registry+https://github.com/rust-lang/crates.io-index" 2255 | checksum = "a1c68f70683c5fc9a747a383744206cd371741b2f0b31781ab6770487ec572e2" 2256 | dependencies = [ 2257 | "android_logger", 2258 | "lazy_static", 2259 | "libc", 2260 | "log", 2261 | "ndk 0.5.0", 2262 | "ndk-context", 2263 | "ndk-macro", 2264 | "ndk-sys 0.2.2", 2265 | ] 2266 | 2267 | [[package]] 2268 | name = "ndk-glue" 2269 | version = "0.6.1" 2270 | source = "registry+https://github.com/rust-lang/crates.io-index" 2271 | checksum = "d9ffb7443daba48349d545028777ca98853b018b4c16624aa01223bc29e078da" 2272 | dependencies = [ 2273 | "lazy_static", 2274 | "libc", 2275 | "log", 2276 | "ndk 0.6.0", 2277 | "ndk-context", 2278 | "ndk-macro", 2279 | "ndk-sys 0.3.0", 2280 | ] 2281 | 2282 | [[package]] 2283 | name = "ndk-macro" 2284 | version = "0.3.0" 2285 | source = "registry+https://github.com/rust-lang/crates.io-index" 2286 | checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" 2287 | dependencies = [ 2288 | "darling", 2289 | "proc-macro-crate", 2290 | "proc-macro2", 2291 | "quote", 2292 | "syn", 2293 | ] 2294 | 2295 | [[package]] 2296 | name = "ndk-sys" 2297 | version = "0.2.2" 2298 | source = "registry+https://github.com/rust-lang/crates.io-index" 2299 | checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" 2300 | 2301 | [[package]] 2302 | name = "ndk-sys" 2303 | version = "0.3.0" 2304 | source = "registry+https://github.com/rust-lang/crates.io-index" 2305 | checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" 2306 | dependencies = [ 2307 | "jni-sys", 2308 | ] 2309 | 2310 | [[package]] 2311 | name = "nix" 2312 | version = "0.22.3" 2313 | source = "registry+https://github.com/rust-lang/crates.io-index" 2314 | checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" 2315 | dependencies = [ 2316 | "bitflags", 2317 | "cc", 2318 | "cfg-if 1.0.0", 2319 | "libc", 2320 | "memoffset", 2321 | ] 2322 | 2323 | [[package]] 2324 | name = "nix" 2325 | version = "0.23.1" 2326 | source = "registry+https://github.com/rust-lang/crates.io-index" 2327 | checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" 2328 | dependencies = [ 2329 | "bitflags", 2330 | "cc", 2331 | "cfg-if 1.0.0", 2332 | "libc", 2333 | "memoffset", 2334 | ] 2335 | 2336 | [[package]] 2337 | name = "nix" 2338 | version = "0.24.2" 2339 | source = "registry+https://github.com/rust-lang/crates.io-index" 2340 | checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" 2341 | dependencies = [ 2342 | "bitflags", 2343 | "cfg-if 1.0.0", 2344 | "libc", 2345 | ] 2346 | 2347 | [[package]] 2348 | name = "nohash-hasher" 2349 | version = "0.2.0" 2350 | source = "registry+https://github.com/rust-lang/crates.io-index" 2351 | checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" 2352 | 2353 | [[package]] 2354 | name = "nom" 2355 | version = "5.1.2" 2356 | source = "registry+https://github.com/rust-lang/crates.io-index" 2357 | checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" 2358 | dependencies = [ 2359 | "memchr", 2360 | "version_check", 2361 | ] 2362 | 2363 | [[package]] 2364 | name = "notify" 2365 | version = "5.0.0-pre.15" 2366 | source = "registry+https://github.com/rust-lang/crates.io-index" 2367 | checksum = "553f9844ad0b0824605c20fb55a661679782680410abfb1a8144c2e7e437e7a7" 2368 | dependencies = [ 2369 | "bitflags", 2370 | "crossbeam-channel", 2371 | "filetime", 2372 | "fsevent-sys", 2373 | "inotify", 2374 | "kqueue", 2375 | "libc", 2376 | "mio", 2377 | "walkdir", 2378 | "winapi", 2379 | ] 2380 | 2381 | [[package]] 2382 | name = "ntapi" 2383 | version = "0.3.7" 2384 | source = "registry+https://github.com/rust-lang/crates.io-index" 2385 | checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" 2386 | dependencies = [ 2387 | "winapi", 2388 | ] 2389 | 2390 | [[package]] 2391 | name = "num-derive" 2392 | version = "0.3.3" 2393 | source = "registry+https://github.com/rust-lang/crates.io-index" 2394 | checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" 2395 | dependencies = [ 2396 | "proc-macro2", 2397 | "quote", 2398 | "syn", 2399 | ] 2400 | 2401 | [[package]] 2402 | name = "num-integer" 2403 | version = "0.1.44" 2404 | source = "registry+https://github.com/rust-lang/crates.io-index" 2405 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" 2406 | dependencies = [ 2407 | "autocfg", 2408 | "num-traits", 2409 | ] 2410 | 2411 | [[package]] 2412 | name = "num-iter" 2413 | version = "0.1.42" 2414 | source = "registry+https://github.com/rust-lang/crates.io-index" 2415 | checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" 2416 | dependencies = [ 2417 | "autocfg", 2418 | "num-integer", 2419 | "num-traits", 2420 | ] 2421 | 2422 | [[package]] 2423 | name = "num-rational" 2424 | version = "0.3.2" 2425 | source = "registry+https://github.com/rust-lang/crates.io-index" 2426 | checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" 2427 | dependencies = [ 2428 | "autocfg", 2429 | "num-integer", 2430 | "num-traits", 2431 | ] 2432 | 2433 | [[package]] 2434 | name = "num-rational" 2435 | version = "0.4.1" 2436 | source = "registry+https://github.com/rust-lang/crates.io-index" 2437 | checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" 2438 | dependencies = [ 2439 | "autocfg", 2440 | "num-integer", 2441 | "num-traits", 2442 | ] 2443 | 2444 | [[package]] 2445 | name = "num-traits" 2446 | version = "0.2.14" 2447 | source = "registry+https://github.com/rust-lang/crates.io-index" 2448 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 2449 | dependencies = [ 2450 | "autocfg", 2451 | ] 2452 | 2453 | [[package]] 2454 | name = "num_cpus" 2455 | version = "1.13.1" 2456 | source = "registry+https://github.com/rust-lang/crates.io-index" 2457 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 2458 | dependencies = [ 2459 | "hermit-abi", 2460 | "libc", 2461 | ] 2462 | 2463 | [[package]] 2464 | name = "num_enum" 2465 | version = "0.5.7" 2466 | source = "registry+https://github.com/rust-lang/crates.io-index" 2467 | checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" 2468 | dependencies = [ 2469 | "num_enum_derive", 2470 | ] 2471 | 2472 | [[package]] 2473 | name = "num_enum_derive" 2474 | version = "0.5.7" 2475 | source = "registry+https://github.com/rust-lang/crates.io-index" 2476 | checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" 2477 | dependencies = [ 2478 | "proc-macro-crate", 2479 | "proc-macro2", 2480 | "quote", 2481 | "syn", 2482 | ] 2483 | 2484 | [[package]] 2485 | name = "objc" 2486 | version = "0.2.7" 2487 | source = "registry+https://github.com/rust-lang/crates.io-index" 2488 | checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" 2489 | dependencies = [ 2490 | "malloc_buf", 2491 | "objc_exception", 2492 | ] 2493 | 2494 | [[package]] 2495 | name = "objc-foundation" 2496 | version = "0.1.1" 2497 | source = "registry+https://github.com/rust-lang/crates.io-index" 2498 | checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" 2499 | dependencies = [ 2500 | "block", 2501 | "objc", 2502 | "objc_id", 2503 | ] 2504 | 2505 | [[package]] 2506 | name = "objc_exception" 2507 | version = "0.1.2" 2508 | source = "registry+https://github.com/rust-lang/crates.io-index" 2509 | checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" 2510 | dependencies = [ 2511 | "cc", 2512 | ] 2513 | 2514 | [[package]] 2515 | name = "objc_id" 2516 | version = "0.1.1" 2517 | source = "registry+https://github.com/rust-lang/crates.io-index" 2518 | checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" 2519 | dependencies = [ 2520 | "objc", 2521 | ] 2522 | 2523 | [[package]] 2524 | name = "oboe" 2525 | version = "0.4.5" 2526 | source = "registry+https://github.com/rust-lang/crates.io-index" 2527 | checksum = "2463c8f2e19b4e0d0710a21f8e4011501ff28db1c95d7a5482a553b2100502d2" 2528 | dependencies = [ 2529 | "jni", 2530 | "ndk 0.6.0", 2531 | "ndk-glue 0.6.1", 2532 | "num-derive", 2533 | "num-traits", 2534 | "oboe-sys", 2535 | ] 2536 | 2537 | [[package]] 2538 | name = "oboe-sys" 2539 | version = "0.4.5" 2540 | source = "registry+https://github.com/rust-lang/crates.io-index" 2541 | checksum = "3370abb7372ed744232c12954d920d1a40f1c4686de9e79e800021ef492294bd" 2542 | dependencies = [ 2543 | "cc", 2544 | ] 2545 | 2546 | [[package]] 2547 | name = "ogg" 2548 | version = "0.8.0" 2549 | source = "registry+https://github.com/rust-lang/crates.io-index" 2550 | checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e" 2551 | dependencies = [ 2552 | "byteorder", 2553 | ] 2554 | 2555 | [[package]] 2556 | name = "once_cell" 2557 | version = "1.15.0" 2558 | source = "registry+https://github.com/rust-lang/crates.io-index" 2559 | checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" 2560 | 2561 | [[package]] 2562 | name = "owned_ttf_parser" 2563 | version = "0.15.0" 2564 | source = "registry+https://github.com/rust-lang/crates.io-index" 2565 | checksum = "4fb1e509cfe7a12db2a90bfa057dfcdbc55a347f5da677c506b53dd099cfec9d" 2566 | dependencies = [ 2567 | "ttf-parser", 2568 | ] 2569 | 2570 | [[package]] 2571 | name = "parking" 2572 | version = "2.0.0" 2573 | source = "registry+https://github.com/rust-lang/crates.io-index" 2574 | checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" 2575 | 2576 | [[package]] 2577 | name = "parking_lot" 2578 | version = "0.11.2" 2579 | source = "registry+https://github.com/rust-lang/crates.io-index" 2580 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 2581 | dependencies = [ 2582 | "instant", 2583 | "lock_api", 2584 | "parking_lot_core 0.8.5", 2585 | ] 2586 | 2587 | [[package]] 2588 | name = "parking_lot" 2589 | version = "0.12.1" 2590 | source = "registry+https://github.com/rust-lang/crates.io-index" 2591 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 2592 | dependencies = [ 2593 | "lock_api", 2594 | "parking_lot_core 0.9.3", 2595 | ] 2596 | 2597 | [[package]] 2598 | name = "parking_lot_core" 2599 | version = "0.8.5" 2600 | source = "registry+https://github.com/rust-lang/crates.io-index" 2601 | checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" 2602 | dependencies = [ 2603 | "cfg-if 1.0.0", 2604 | "instant", 2605 | "libc", 2606 | "redox_syscall", 2607 | "smallvec", 2608 | "winapi", 2609 | ] 2610 | 2611 | [[package]] 2612 | name = "parking_lot_core" 2613 | version = "0.9.3" 2614 | source = "registry+https://github.com/rust-lang/crates.io-index" 2615 | checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" 2616 | dependencies = [ 2617 | "cfg-if 1.0.0", 2618 | "libc", 2619 | "redox_syscall", 2620 | "smallvec", 2621 | "windows-sys", 2622 | ] 2623 | 2624 | [[package]] 2625 | name = "peeking_take_while" 2626 | version = "0.1.2" 2627 | source = "registry+https://github.com/rust-lang/crates.io-index" 2628 | checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" 2629 | 2630 | [[package]] 2631 | name = "percent-encoding" 2632 | version = "2.1.0" 2633 | source = "registry+https://github.com/rust-lang/crates.io-index" 2634 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 2635 | 2636 | [[package]] 2637 | name = "petgraph" 2638 | version = "0.6.0" 2639 | source = "registry+https://github.com/rust-lang/crates.io-index" 2640 | checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" 2641 | dependencies = [ 2642 | "fixedbitset", 2643 | "indexmap", 2644 | ] 2645 | 2646 | [[package]] 2647 | name = "pin-project-lite" 2648 | version = "0.2.8" 2649 | source = "registry+https://github.com/rust-lang/crates.io-index" 2650 | checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" 2651 | 2652 | [[package]] 2653 | name = "pkg-config" 2654 | version = "0.3.24" 2655 | source = "registry+https://github.com/rust-lang/crates.io-index" 2656 | checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" 2657 | 2658 | [[package]] 2659 | name = "png" 2660 | version = "0.16.8" 2661 | source = "registry+https://github.com/rust-lang/crates.io-index" 2662 | checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" 2663 | dependencies = [ 2664 | "bitflags", 2665 | "crc32fast", 2666 | "deflate", 2667 | "miniz_oxide 0.3.7", 2668 | ] 2669 | 2670 | [[package]] 2671 | name = "png" 2672 | version = "0.17.6" 2673 | source = "registry+https://github.com/rust-lang/crates.io-index" 2674 | checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c" 2675 | dependencies = [ 2676 | "bitflags", 2677 | "crc32fast", 2678 | "flate2", 2679 | "miniz_oxide 0.5.4", 2680 | ] 2681 | 2682 | [[package]] 2683 | name = "pp-rs" 2684 | version = "0.2.1" 2685 | source = "registry+https://github.com/rust-lang/crates.io-index" 2686 | checksum = "bb458bb7f6e250e6eb79d5026badc10a3ebb8f9a15d1fff0f13d17c71f4d6dee" 2687 | dependencies = [ 2688 | "unicode-xid", 2689 | ] 2690 | 2691 | [[package]] 2692 | name = "ppv-lite86" 2693 | version = "0.2.16" 2694 | source = "registry+https://github.com/rust-lang/crates.io-index" 2695 | checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 2696 | 2697 | [[package]] 2698 | name = "proc-macro-crate" 2699 | version = "1.1.3" 2700 | source = "registry+https://github.com/rust-lang/crates.io-index" 2701 | checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" 2702 | dependencies = [ 2703 | "thiserror", 2704 | "toml", 2705 | ] 2706 | 2707 | [[package]] 2708 | name = "proc-macro2" 2709 | version = "1.0.36" 2710 | source = "registry+https://github.com/rust-lang/crates.io-index" 2711 | checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 2712 | dependencies = [ 2713 | "unicode-xid", 2714 | ] 2715 | 2716 | [[package]] 2717 | name = "profiling" 2718 | version = "1.0.5" 2719 | source = "registry+https://github.com/rust-lang/crates.io-index" 2720 | checksum = "9145ac0af1d93c638c98c40cf7d25665f427b2a44ad0a99b1dccf3e2f25bb987" 2721 | 2722 | [[package]] 2723 | name = "quote" 2724 | version = "1.0.15" 2725 | source = "registry+https://github.com/rust-lang/crates.io-index" 2726 | checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" 2727 | dependencies = [ 2728 | "proc-macro2", 2729 | ] 2730 | 2731 | [[package]] 2732 | name = "radsort" 2733 | version = "0.1.0" 2734 | source = "registry+https://github.com/rust-lang/crates.io-index" 2735 | checksum = "17fd96390ed3feda12e1dfe2645ed587e0bea749e319333f104a33ff62f77a0b" 2736 | 2737 | [[package]] 2738 | name = "rand" 2739 | version = "0.8.5" 2740 | source = "registry+https://github.com/rust-lang/crates.io-index" 2741 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 2742 | dependencies = [ 2743 | "libc", 2744 | "rand_chacha", 2745 | "rand_core", 2746 | ] 2747 | 2748 | [[package]] 2749 | name = "rand_chacha" 2750 | version = "0.3.1" 2751 | source = "registry+https://github.com/rust-lang/crates.io-index" 2752 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 2753 | dependencies = [ 2754 | "ppv-lite86", 2755 | "rand_core", 2756 | ] 2757 | 2758 | [[package]] 2759 | name = "rand_core" 2760 | version = "0.6.3" 2761 | source = "registry+https://github.com/rust-lang/crates.io-index" 2762 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 2763 | dependencies = [ 2764 | "getrandom", 2765 | ] 2766 | 2767 | [[package]] 2768 | name = "range-alloc" 2769 | version = "0.1.2" 2770 | source = "registry+https://github.com/rust-lang/crates.io-index" 2771 | checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" 2772 | 2773 | [[package]] 2774 | name = "raw-window-handle" 2775 | version = "0.4.2" 2776 | source = "registry+https://github.com/rust-lang/crates.io-index" 2777 | checksum = "fba75eee94a9d5273a68c9e1e105d9cffe1ef700532325788389e5a83e2522b7" 2778 | dependencies = [ 2779 | "cty", 2780 | ] 2781 | 2782 | [[package]] 2783 | name = "rectangle-pack" 2784 | version = "0.4.2" 2785 | source = "registry+https://github.com/rust-lang/crates.io-index" 2786 | checksum = "a0d463f2884048e7153449a55166f91028d5b0ea53c79377099ce4e8cf0cf9bb" 2787 | 2788 | [[package]] 2789 | name = "redox_syscall" 2790 | version = "0.2.11" 2791 | source = "registry+https://github.com/rust-lang/crates.io-index" 2792 | checksum = "8380fe0152551244f0747b1bf41737e0f8a74f97a14ccefd1148187271634f3c" 2793 | dependencies = [ 2794 | "bitflags", 2795 | ] 2796 | 2797 | [[package]] 2798 | name = "regex" 2799 | version = "1.5.4" 2800 | source = "registry+https://github.com/rust-lang/crates.io-index" 2801 | checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" 2802 | dependencies = [ 2803 | "aho-corasick", 2804 | "memchr", 2805 | "regex-syntax", 2806 | ] 2807 | 2808 | [[package]] 2809 | name = "regex-automata" 2810 | version = "0.1.10" 2811 | source = "registry+https://github.com/rust-lang/crates.io-index" 2812 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 2813 | dependencies = [ 2814 | "regex-syntax", 2815 | ] 2816 | 2817 | [[package]] 2818 | name = "regex-syntax" 2819 | version = "0.6.25" 2820 | source = "registry+https://github.com/rust-lang/crates.io-index" 2821 | checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" 2822 | 2823 | [[package]] 2824 | name = "renderdoc-sys" 2825 | version = "0.7.1" 2826 | source = "registry+https://github.com/rust-lang/crates.io-index" 2827 | checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" 2828 | 2829 | [[package]] 2830 | name = "rodio" 2831 | version = "0.15.0" 2832 | source = "registry+https://github.com/rust-lang/crates.io-index" 2833 | checksum = "ec0939e9f626e6c6f1989adb6226a039c855ca483053f0ee7c98b90e41cf731e" 2834 | dependencies = [ 2835 | "cpal", 2836 | "lewton", 2837 | ] 2838 | 2839 | [[package]] 2840 | name = "ron" 2841 | version = "0.7.0" 2842 | source = "registry+https://github.com/rust-lang/crates.io-index" 2843 | checksum = "1b861ecaade43ac97886a512b360d01d66be9f41f3c61088b42cedf92e03d678" 2844 | dependencies = [ 2845 | "base64", 2846 | "bitflags", 2847 | "serde", 2848 | ] 2849 | 2850 | [[package]] 2851 | name = "rustc-hash" 2852 | version = "1.1.0" 2853 | source = "registry+https://github.com/rust-lang/crates.io-index" 2854 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 2855 | 2856 | [[package]] 2857 | name = "rusty-xinput" 2858 | version = "1.2.0" 2859 | source = "registry+https://github.com/rust-lang/crates.io-index" 2860 | checksum = "d2aa654bc32eb9ca14cce1a084abc9dfe43949a4547c35269a094c39272db3bb" 2861 | dependencies = [ 2862 | "lazy_static", 2863 | "log", 2864 | "winapi", 2865 | ] 2866 | 2867 | [[package]] 2868 | name = "ryu" 2869 | version = "1.0.9" 2870 | source = "registry+https://github.com/rust-lang/crates.io-index" 2871 | checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" 2872 | 2873 | [[package]] 2874 | name = "same-file" 2875 | version = "1.0.6" 2876 | source = "registry+https://github.com/rust-lang/crates.io-index" 2877 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 2878 | dependencies = [ 2879 | "winapi-util", 2880 | ] 2881 | 2882 | [[package]] 2883 | name = "scoped_threadpool" 2884 | version = "0.1.9" 2885 | source = "registry+https://github.com/rust-lang/crates.io-index" 2886 | checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" 2887 | 2888 | [[package]] 2889 | name = "scopeguard" 2890 | version = "1.1.0" 2891 | source = "registry+https://github.com/rust-lang/crates.io-index" 2892 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 2893 | 2894 | [[package]] 2895 | name = "serde" 2896 | version = "1.0.136" 2897 | source = "registry+https://github.com/rust-lang/crates.io-index" 2898 | checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" 2899 | dependencies = [ 2900 | "serde_derive", 2901 | ] 2902 | 2903 | [[package]] 2904 | name = "serde_derive" 2905 | version = "1.0.136" 2906 | source = "registry+https://github.com/rust-lang/crates.io-index" 2907 | checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" 2908 | dependencies = [ 2909 | "proc-macro2", 2910 | "quote", 2911 | "syn", 2912 | ] 2913 | 2914 | [[package]] 2915 | name = "serde_json" 2916 | version = "1.0.79" 2917 | source = "registry+https://github.com/rust-lang/crates.io-index" 2918 | checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" 2919 | dependencies = [ 2920 | "itoa", 2921 | "ryu", 2922 | "serde", 2923 | ] 2924 | 2925 | [[package]] 2926 | name = "sharded-slab" 2927 | version = "0.1.4" 2928 | source = "registry+https://github.com/rust-lang/crates.io-index" 2929 | checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 2930 | dependencies = [ 2931 | "lazy_static", 2932 | ] 2933 | 2934 | [[package]] 2935 | name = "shlex" 2936 | version = "0.1.1" 2937 | source = "registry+https://github.com/rust-lang/crates.io-index" 2938 | checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" 2939 | 2940 | [[package]] 2941 | name = "slab" 2942 | version = "0.4.5" 2943 | source = "registry+https://github.com/rust-lang/crates.io-index" 2944 | checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" 2945 | 2946 | [[package]] 2947 | name = "slotmap" 2948 | version = "1.0.6" 2949 | source = "registry+https://github.com/rust-lang/crates.io-index" 2950 | checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" 2951 | dependencies = [ 2952 | "version_check", 2953 | ] 2954 | 2955 | [[package]] 2956 | name = "smallvec" 2957 | version = "1.8.0" 2958 | source = "registry+https://github.com/rust-lang/crates.io-index" 2959 | checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" 2960 | dependencies = [ 2961 | "serde", 2962 | ] 2963 | 2964 | [[package]] 2965 | name = "spirv" 2966 | version = "0.2.0+1.5.4" 2967 | source = "registry+https://github.com/rust-lang/crates.io-index" 2968 | checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" 2969 | dependencies = [ 2970 | "bitflags", 2971 | "num-traits", 2972 | ] 2973 | 2974 | [[package]] 2975 | name = "stdweb" 2976 | version = "0.1.3" 2977 | source = "registry+https://github.com/rust-lang/crates.io-index" 2978 | checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" 2979 | 2980 | [[package]] 2981 | name = "str-buf" 2982 | version = "1.0.6" 2983 | source = "registry+https://github.com/rust-lang/crates.io-index" 2984 | checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" 2985 | 2986 | [[package]] 2987 | name = "strsim" 2988 | version = "0.10.0" 2989 | source = "registry+https://github.com/rust-lang/crates.io-index" 2990 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 2991 | 2992 | [[package]] 2993 | name = "svg_fmt" 2994 | version = "0.4.1" 2995 | source = "registry+https://github.com/rust-lang/crates.io-index" 2996 | checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" 2997 | 2998 | [[package]] 2999 | name = "syn" 3000 | version = "1.0.86" 3001 | source = "registry+https://github.com/rust-lang/crates.io-index" 3002 | checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" 3003 | dependencies = [ 3004 | "proc-macro2", 3005 | "quote", 3006 | "unicode-xid", 3007 | ] 3008 | 3009 | [[package]] 3010 | name = "taffy" 3011 | version = "0.1.0" 3012 | source = "registry+https://github.com/rust-lang/crates.io-index" 3013 | checksum = "ec27dea659b100d489dffa57cf0efc6d7bfefb119af817b92cc14006c0b214e3" 3014 | dependencies = [ 3015 | "arrayvec", 3016 | "hash32", 3017 | "hash32-derive", 3018 | "num-traits", 3019 | "typenum", 3020 | ] 3021 | 3022 | [[package]] 3023 | name = "termcolor" 3024 | version = "1.1.3" 3025 | source = "registry+https://github.com/rust-lang/crates.io-index" 3026 | checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" 3027 | dependencies = [ 3028 | "winapi-util", 3029 | ] 3030 | 3031 | [[package]] 3032 | name = "thiserror" 3033 | version = "1.0.30" 3034 | source = "registry+https://github.com/rust-lang/crates.io-index" 3035 | checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" 3036 | dependencies = [ 3037 | "thiserror-impl", 3038 | ] 3039 | 3040 | [[package]] 3041 | name = "thiserror-impl" 3042 | version = "1.0.30" 3043 | source = "registry+https://github.com/rust-lang/crates.io-index" 3044 | checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" 3045 | dependencies = [ 3046 | "proc-macro2", 3047 | "quote", 3048 | "syn", 3049 | ] 3050 | 3051 | [[package]] 3052 | name = "thread_local" 3053 | version = "1.1.4" 3054 | source = "registry+https://github.com/rust-lang/crates.io-index" 3055 | checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" 3056 | dependencies = [ 3057 | "once_cell", 3058 | ] 3059 | 3060 | [[package]] 3061 | name = "tiff" 3062 | version = "0.6.1" 3063 | source = "registry+https://github.com/rust-lang/crates.io-index" 3064 | checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" 3065 | dependencies = [ 3066 | "jpeg-decoder", 3067 | "miniz_oxide 0.4.4", 3068 | "weezl", 3069 | ] 3070 | 3071 | [[package]] 3072 | name = "tinyvec" 3073 | version = "1.5.1" 3074 | source = "registry+https://github.com/rust-lang/crates.io-index" 3075 | checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" 3076 | dependencies = [ 3077 | "tinyvec_macros", 3078 | ] 3079 | 3080 | [[package]] 3081 | name = "tinyvec_macros" 3082 | version = "0.1.0" 3083 | source = "registry+https://github.com/rust-lang/crates.io-index" 3084 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 3085 | 3086 | [[package]] 3087 | name = "toml" 3088 | version = "0.5.8" 3089 | source = "registry+https://github.com/rust-lang/crates.io-index" 3090 | checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" 3091 | dependencies = [ 3092 | "serde", 3093 | ] 3094 | 3095 | [[package]] 3096 | name = "tracing" 3097 | version = "0.1.31" 3098 | source = "registry+https://github.com/rust-lang/crates.io-index" 3099 | checksum = "f6c650a8ef0cd2dd93736f033d21cbd1224c5a967aa0c258d00fcf7dafef9b9f" 3100 | dependencies = [ 3101 | "cfg-if 1.0.0", 3102 | "pin-project-lite", 3103 | "tracing-attributes", 3104 | "tracing-core", 3105 | ] 3106 | 3107 | [[package]] 3108 | name = "tracing-attributes" 3109 | version = "0.1.19" 3110 | source = "registry+https://github.com/rust-lang/crates.io-index" 3111 | checksum = "8276d9a4a3a558d7b7ad5303ad50b53d58264641b82914b7ada36bd762e7a716" 3112 | dependencies = [ 3113 | "proc-macro2", 3114 | "quote", 3115 | "syn", 3116 | ] 3117 | 3118 | [[package]] 3119 | name = "tracing-core" 3120 | version = "0.1.22" 3121 | source = "registry+https://github.com/rust-lang/crates.io-index" 3122 | checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" 3123 | dependencies = [ 3124 | "lazy_static", 3125 | "valuable", 3126 | ] 3127 | 3128 | [[package]] 3129 | name = "tracing-log" 3130 | version = "0.1.2" 3131 | source = "registry+https://github.com/rust-lang/crates.io-index" 3132 | checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" 3133 | dependencies = [ 3134 | "lazy_static", 3135 | "log", 3136 | "tracing-core", 3137 | ] 3138 | 3139 | [[package]] 3140 | name = "tracing-subscriber" 3141 | version = "0.3.9" 3142 | source = "registry+https://github.com/rust-lang/crates.io-index" 3143 | checksum = "9e0ab7bdc962035a87fba73f3acca9b8a8d0034c2e6f60b84aeaaddddc155dce" 3144 | dependencies = [ 3145 | "ansi_term", 3146 | "lazy_static", 3147 | "matchers", 3148 | "regex", 3149 | "sharded-slab", 3150 | "smallvec", 3151 | "thread_local", 3152 | "tracing", 3153 | "tracing-core", 3154 | "tracing-log", 3155 | ] 3156 | 3157 | [[package]] 3158 | name = "tracing-wasm" 3159 | version = "0.2.1" 3160 | source = "registry+https://github.com/rust-lang/crates.io-index" 3161 | checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" 3162 | dependencies = [ 3163 | "tracing", 3164 | "tracing-subscriber", 3165 | "wasm-bindgen", 3166 | ] 3167 | 3168 | [[package]] 3169 | name = "ttf-parser" 3170 | version = "0.15.0" 3171 | source = "registry+https://github.com/rust-lang/crates.io-index" 3172 | checksum = "c74c96594835e10fa545e2a51e8709f30b173a092bfd6036ef2cec53376244f3" 3173 | 3174 | [[package]] 3175 | name = "typenum" 3176 | version = "1.15.0" 3177 | source = "registry+https://github.com/rust-lang/crates.io-index" 3178 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 3179 | 3180 | [[package]] 3181 | name = "unicode-bidi" 3182 | version = "0.3.8" 3183 | source = "registry+https://github.com/rust-lang/crates.io-index" 3184 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" 3185 | 3186 | [[package]] 3187 | name = "unicode-normalization" 3188 | version = "0.1.22" 3189 | source = "registry+https://github.com/rust-lang/crates.io-index" 3190 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 3191 | dependencies = [ 3192 | "tinyvec", 3193 | ] 3194 | 3195 | [[package]] 3196 | name = "unicode-width" 3197 | version = "0.1.9" 3198 | source = "registry+https://github.com/rust-lang/crates.io-index" 3199 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 3200 | 3201 | [[package]] 3202 | name = "unicode-xid" 3203 | version = "0.2.4" 3204 | source = "registry+https://github.com/rust-lang/crates.io-index" 3205 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 3206 | 3207 | [[package]] 3208 | name = "url" 3209 | version = "2.3.0" 3210 | source = "registry+https://github.com/rust-lang/crates.io-index" 3211 | checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" 3212 | dependencies = [ 3213 | "form_urlencoded", 3214 | "idna", 3215 | "percent-encoding", 3216 | ] 3217 | 3218 | [[package]] 3219 | name = "uuid" 3220 | version = "1.2.1" 3221 | source = "registry+https://github.com/rust-lang/crates.io-index" 3222 | checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" 3223 | dependencies = [ 3224 | "getrandom", 3225 | "serde", 3226 | ] 3227 | 3228 | [[package]] 3229 | name = "valuable" 3230 | version = "0.1.0" 3231 | source = "registry+https://github.com/rust-lang/crates.io-index" 3232 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 3233 | 3234 | [[package]] 3235 | name = "vec_map" 3236 | version = "0.8.2" 3237 | source = "registry+https://github.com/rust-lang/crates.io-index" 3238 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 3239 | 3240 | [[package]] 3241 | name = "version_check" 3242 | version = "0.9.4" 3243 | source = "registry+https://github.com/rust-lang/crates.io-index" 3244 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 3245 | 3246 | [[package]] 3247 | name = "waker-fn" 3248 | version = "1.1.0" 3249 | source = "registry+https://github.com/rust-lang/crates.io-index" 3250 | checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" 3251 | 3252 | [[package]] 3253 | name = "walkdir" 3254 | version = "2.3.2" 3255 | source = "registry+https://github.com/rust-lang/crates.io-index" 3256 | checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" 3257 | dependencies = [ 3258 | "same-file", 3259 | "winapi", 3260 | "winapi-util", 3261 | ] 3262 | 3263 | [[package]] 3264 | name = "wasi" 3265 | version = "0.10.2+wasi-snapshot-preview1" 3266 | source = "registry+https://github.com/rust-lang/crates.io-index" 3267 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 3268 | 3269 | [[package]] 3270 | name = "wasm-bindgen" 3271 | version = "0.2.83" 3272 | source = "registry+https://github.com/rust-lang/crates.io-index" 3273 | checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" 3274 | dependencies = [ 3275 | "cfg-if 1.0.0", 3276 | "wasm-bindgen-macro", 3277 | ] 3278 | 3279 | [[package]] 3280 | name = "wasm-bindgen-backend" 3281 | version = "0.2.83" 3282 | source = "registry+https://github.com/rust-lang/crates.io-index" 3283 | checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" 3284 | dependencies = [ 3285 | "bumpalo", 3286 | "log", 3287 | "once_cell", 3288 | "proc-macro2", 3289 | "quote", 3290 | "syn", 3291 | "wasm-bindgen-shared", 3292 | ] 3293 | 3294 | [[package]] 3295 | name = "wasm-bindgen-futures" 3296 | version = "0.4.33" 3297 | source = "registry+https://github.com/rust-lang/crates.io-index" 3298 | checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" 3299 | dependencies = [ 3300 | "cfg-if 1.0.0", 3301 | "js-sys", 3302 | "wasm-bindgen", 3303 | "web-sys", 3304 | ] 3305 | 3306 | [[package]] 3307 | name = "wasm-bindgen-macro" 3308 | version = "0.2.83" 3309 | source = "registry+https://github.com/rust-lang/crates.io-index" 3310 | checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" 3311 | dependencies = [ 3312 | "quote", 3313 | "wasm-bindgen-macro-support", 3314 | ] 3315 | 3316 | [[package]] 3317 | name = "wasm-bindgen-macro-support" 3318 | version = "0.2.83" 3319 | source = "registry+https://github.com/rust-lang/crates.io-index" 3320 | checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" 3321 | dependencies = [ 3322 | "proc-macro2", 3323 | "quote", 3324 | "syn", 3325 | "wasm-bindgen-backend", 3326 | "wasm-bindgen-shared", 3327 | ] 3328 | 3329 | [[package]] 3330 | name = "wasm-bindgen-shared" 3331 | version = "0.2.83" 3332 | source = "registry+https://github.com/rust-lang/crates.io-index" 3333 | checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" 3334 | 3335 | [[package]] 3336 | name = "web-sys" 3337 | version = "0.3.60" 3338 | source = "registry+https://github.com/rust-lang/crates.io-index" 3339 | checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" 3340 | dependencies = [ 3341 | "js-sys", 3342 | "wasm-bindgen", 3343 | ] 3344 | 3345 | [[package]] 3346 | name = "webbrowser" 3347 | version = "0.7.1" 3348 | source = "registry+https://github.com/rust-lang/crates.io-index" 3349 | checksum = "fc6a3cffdb686fbb24d9fb8f03a213803277ed2300f11026a3afe1f108dc021b" 3350 | dependencies = [ 3351 | "jni", 3352 | "ndk-glue 0.6.1", 3353 | "url", 3354 | "web-sys", 3355 | "widestring", 3356 | "winapi", 3357 | ] 3358 | 3359 | [[package]] 3360 | name = "weezl" 3361 | version = "0.1.7" 3362 | source = "registry+https://github.com/rust-lang/crates.io-index" 3363 | checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" 3364 | 3365 | [[package]] 3366 | name = "wgpu" 3367 | version = "0.13.1" 3368 | source = "registry+https://github.com/rust-lang/crates.io-index" 3369 | checksum = "277e967bf8b7820a76852645a6bce8bbd31c32fda2042e82d8e3ea75fda8892d" 3370 | dependencies = [ 3371 | "arrayvec", 3372 | "js-sys", 3373 | "log", 3374 | "naga", 3375 | "parking_lot 0.11.2", 3376 | "raw-window-handle", 3377 | "smallvec", 3378 | "wasm-bindgen", 3379 | "wasm-bindgen-futures", 3380 | "web-sys", 3381 | "wgpu-core", 3382 | "wgpu-hal", 3383 | "wgpu-types", 3384 | ] 3385 | 3386 | [[package]] 3387 | name = "wgpu-core" 3388 | version = "0.13.2" 3389 | source = "registry+https://github.com/rust-lang/crates.io-index" 3390 | checksum = "89b92788dec9d0c1bed849a1b83f01b2ee12819bf04a79c90f68e4173f7b5ba2" 3391 | dependencies = [ 3392 | "arrayvec", 3393 | "bit-vec", 3394 | "bitflags", 3395 | "cfg_aliases", 3396 | "codespan-reporting", 3397 | "copyless", 3398 | "fxhash", 3399 | "log", 3400 | "naga", 3401 | "parking_lot 0.11.2", 3402 | "profiling", 3403 | "raw-window-handle", 3404 | "smallvec", 3405 | "thiserror", 3406 | "web-sys", 3407 | "wgpu-hal", 3408 | "wgpu-types", 3409 | ] 3410 | 3411 | [[package]] 3412 | name = "wgpu-hal" 3413 | version = "0.13.2" 3414 | source = "registry+https://github.com/rust-lang/crates.io-index" 3415 | checksum = "20cbdfc3d0637dba3d5536b93adef3d26023a0b96f0e1ee5ee9560a401d9f646" 3416 | dependencies = [ 3417 | "android_system_properties", 3418 | "arrayvec", 3419 | "ash", 3420 | "bit-set", 3421 | "bitflags", 3422 | "block", 3423 | "core-graphics-types", 3424 | "d3d12", 3425 | "foreign-types", 3426 | "fxhash", 3427 | "glow", 3428 | "gpu-alloc", 3429 | "gpu-descriptor", 3430 | "inplace_it", 3431 | "js-sys", 3432 | "khronos-egl", 3433 | "libloading", 3434 | "log", 3435 | "metal", 3436 | "naga", 3437 | "objc", 3438 | "parking_lot 0.11.2", 3439 | "profiling", 3440 | "range-alloc", 3441 | "raw-window-handle", 3442 | "renderdoc-sys", 3443 | "thiserror", 3444 | "wasm-bindgen", 3445 | "web-sys", 3446 | "wgpu-types", 3447 | "winapi", 3448 | ] 3449 | 3450 | [[package]] 3451 | name = "wgpu-types" 3452 | version = "0.13.2" 3453 | source = "registry+https://github.com/rust-lang/crates.io-index" 3454 | checksum = "1f762cbc08e1a51389859cf9c199c7aef544789cf3510889aab12c607f701604" 3455 | dependencies = [ 3456 | "bitflags", 3457 | ] 3458 | 3459 | [[package]] 3460 | name = "widestring" 3461 | version = "0.5.1" 3462 | source = "registry+https://github.com/rust-lang/crates.io-index" 3463 | checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" 3464 | 3465 | [[package]] 3466 | name = "winapi" 3467 | version = "0.3.9" 3468 | source = "registry+https://github.com/rust-lang/crates.io-index" 3469 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 3470 | dependencies = [ 3471 | "winapi-i686-pc-windows-gnu", 3472 | "winapi-x86_64-pc-windows-gnu", 3473 | ] 3474 | 3475 | [[package]] 3476 | name = "winapi-i686-pc-windows-gnu" 3477 | version = "0.4.0" 3478 | source = "registry+https://github.com/rust-lang/crates.io-index" 3479 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 3480 | 3481 | [[package]] 3482 | name = "winapi-util" 3483 | version = "0.1.5" 3484 | source = "registry+https://github.com/rust-lang/crates.io-index" 3485 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 3486 | dependencies = [ 3487 | "winapi", 3488 | ] 3489 | 3490 | [[package]] 3491 | name = "winapi-wsapoll" 3492 | version = "0.1.1" 3493 | source = "registry+https://github.com/rust-lang/crates.io-index" 3494 | checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" 3495 | dependencies = [ 3496 | "winapi", 3497 | ] 3498 | 3499 | [[package]] 3500 | name = "winapi-x86_64-pc-windows-gnu" 3501 | version = "0.4.0" 3502 | source = "registry+https://github.com/rust-lang/crates.io-index" 3503 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 3504 | 3505 | [[package]] 3506 | name = "windows-sys" 3507 | version = "0.36.1" 3508 | source = "registry+https://github.com/rust-lang/crates.io-index" 3509 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" 3510 | dependencies = [ 3511 | "windows_aarch64_msvc", 3512 | "windows_i686_gnu", 3513 | "windows_i686_msvc", 3514 | "windows_x86_64_gnu", 3515 | "windows_x86_64_msvc", 3516 | ] 3517 | 3518 | [[package]] 3519 | name = "windows_aarch64_msvc" 3520 | version = "0.36.1" 3521 | source = "registry+https://github.com/rust-lang/crates.io-index" 3522 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" 3523 | 3524 | [[package]] 3525 | name = "windows_i686_gnu" 3526 | version = "0.36.1" 3527 | source = "registry+https://github.com/rust-lang/crates.io-index" 3528 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" 3529 | 3530 | [[package]] 3531 | name = "windows_i686_msvc" 3532 | version = "0.36.1" 3533 | source = "registry+https://github.com/rust-lang/crates.io-index" 3534 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" 3535 | 3536 | [[package]] 3537 | name = "windows_x86_64_gnu" 3538 | version = "0.36.1" 3539 | source = "registry+https://github.com/rust-lang/crates.io-index" 3540 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" 3541 | 3542 | [[package]] 3543 | name = "windows_x86_64_msvc" 3544 | version = "0.36.1" 3545 | source = "registry+https://github.com/rust-lang/crates.io-index" 3546 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" 3547 | 3548 | [[package]] 3549 | name = "winit" 3550 | version = "0.26.1" 3551 | source = "registry+https://github.com/rust-lang/crates.io-index" 3552 | checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" 3553 | dependencies = [ 3554 | "bitflags", 3555 | "cocoa", 3556 | "core-foundation 0.9.3", 3557 | "core-graphics 0.22.3", 3558 | "core-video-sys", 3559 | "dispatch", 3560 | "instant", 3561 | "lazy_static", 3562 | "libc", 3563 | "log", 3564 | "mio", 3565 | "ndk 0.5.0", 3566 | "ndk-glue 0.5.1", 3567 | "ndk-sys 0.2.2", 3568 | "objc", 3569 | "parking_lot 0.11.2", 3570 | "percent-encoding", 3571 | "raw-window-handle", 3572 | "wasm-bindgen", 3573 | "web-sys", 3574 | "winapi", 3575 | "x11-dl", 3576 | ] 3577 | 3578 | [[package]] 3579 | name = "x11-dl" 3580 | version = "2.19.1" 3581 | source = "registry+https://github.com/rust-lang/crates.io-index" 3582 | checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" 3583 | dependencies = [ 3584 | "lazy_static", 3585 | "libc", 3586 | "pkg-config", 3587 | ] 3588 | 3589 | [[package]] 3590 | name = "x11rb" 3591 | version = "0.9.0" 3592 | source = "registry+https://github.com/rust-lang/crates.io-index" 3593 | checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" 3594 | dependencies = [ 3595 | "gethostname", 3596 | "nix 0.22.3", 3597 | "winapi", 3598 | "winapi-wsapoll", 3599 | ] 3600 | 3601 | [[package]] 3602 | name = "xi-unicode" 3603 | version = "0.3.0" 3604 | source = "registry+https://github.com/rust-lang/crates.io-index" 3605 | checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" 3606 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mlsmpm-particles-rs" 3 | version = "0.1.1" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | bevy = {version = "0.8"} 8 | bevy_egui = "0.16" 9 | rand = "0.8" 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 github.com/robkau 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /assets/bevy_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robkau/mlsmpm-particles-rs/2cac04f6d022ea1c0e805da683f0383d1028f573/assets/bevy_icon.png -------------------------------------------------------------------------------- /assets/liquid_particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robkau/mlsmpm-particles-rs/2cac04f6d022ea1c0e805da683f0383d1028f573/assets/liquid_particle.png -------------------------------------------------------------------------------- /assets/steel_particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robkau/mlsmpm-particles-rs/2cac04f6d022ea1c0e805da683f0383d1028f573/assets/steel_particle.png -------------------------------------------------------------------------------- /assets/wood_particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robkau/mlsmpm-particles-rs/2cac04f6d022ea1c0e805da683f0383d1028f573/assets/wood_particle.png -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # mlsmpm-particles-rs 2 | 3 | This is a 2D multi-phase Material Point Method simulation using Rust. 4 | Currently two types of particles are supported: 5 | - Neo-Hookean Hyperelastic solid 6 | - Newtonian fluid 7 | 8 | The simulation uses MLS-MPM algorithm (Moving Least Squares Material Point Method). 9 | My matching implementation in Go is [mlsmpm-particles-go](https://github.com/robkau/mlsmpm-particles-go). 10 | Both repositories were implemented by following [nialltl's article on MLS-MPM](https://nialltl.neocities.org/articles/mpm_guide.html) and [matching example code](https://github.com/nialltl/incremental_mpm). 11 | 12 | Library [bevy](https://github.com/bevyengine/bevy) is used to render the output to a window and provide an Entity Component System with parallel processing. 13 | Liby99's [mpm-rs](https://github.com/Liby99/mpm-rs) project inspired me to model MPM simulation inside an ECS. 14 | Unlike mlsmpm-particles-go, this implementation in rust is parallelized and can fully utilize all CPU cores when enough particles are spawned. 15 | The Bevy ECS is really ergonomic, all it took to implement parallel processing was calling the par_for_each methods and the rest happened automatically... after I made the Rust compiler happy. 16 | 17 | --- 18 | 19 | ## Examples 20 | 21 | ![Water, steel, and wood particles](renders/water_steel_wood.png?raw=true "water, steel, and wood particles") 22 | 23 | 24 | 25 | https://user-images.githubusercontent.com/1654124/151740533-e908bdd6-f43f-4830-99d6-70cb36411876.mov 26 | 27 | 28 | 29 | https://user-images.githubusercontent.com/1654124/151740548-16d7f071-e29f-4599-b88a-b2bb985dd70e.mov 30 | 31 | 32 | 33 | https://user-images.githubusercontent.com/1654124/151740555-748fbb31-cb76-4819-94e2-58a2325c6276.mov 34 | -------------------------------------------------------------------------------- /renders/water_steel_wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robkau/mlsmpm-particles-rs/2cac04f6d022ea1c0e805da683f0383d1028f573/renders/water_steel_wood.png -------------------------------------------------------------------------------- /src/camera.rs: -------------------------------------------------------------------------------- 1 | use bevy::math::{Vec2, Vec3}; 2 | use bevy::prelude::{Camera2dBundle, Commands, Res, Transform, Windows}; 3 | 4 | use crate::grid::Grid; 5 | 6 | pub(super) fn setup_camera(mut commands: Commands, grid: Res, wnds: Res) { 7 | let mut cb = Camera2dBundle::default(); 8 | 9 | let wnd = wnds.get_primary().unwrap(); 10 | let size = Vec2::new(wnd.width() as f32, wnd.height() as f32); 11 | 12 | let scale = f32::min(size.x, size.y) / grid.width as f32; // todo in response to events. 13 | 14 | cb.transform = Transform::from_translation(Vec3::new( 15 | size.x / (scale * 2.0), 16 | size.y / (scale * 2.0), 17 | 0.0, 18 | )); 19 | cb.projection.scale = 1.0 / scale; 20 | commands.spawn_bundle(cb); 21 | } 22 | -------------------------------------------------------------------------------- /src/components.rs: -------------------------------------------------------------------------------- 1 | use bevy::math::{Mat2, Vec2}; 2 | use bevy::prelude::*; 3 | 4 | // Tags particle entities 5 | #[derive(Component)] 6 | pub(super) struct ParticleTag; 7 | 8 | // todo move rendering to GPU shader. over 70% of traced CPU time is inside sprite stuff. 9 | 10 | // XY position 11 | #[derive(Component, Debug)] 12 | pub(super) struct Position(pub(super) Vec2); 13 | 14 | // XY velocity 15 | #[derive(Component, Debug)] 16 | pub(super) struct Velocity(pub(super) Vec2); 17 | 18 | // mass 19 | #[derive(Component)] 20 | pub(super) struct Mass(pub(super) f32); 21 | 22 | // 2x2 affine momentum matrix 23 | #[derive(Component)] 24 | pub(super) struct AffineMomentum(pub(super) Mat2); 25 | 26 | // fluid constitutive model properties 27 | #[derive(Clone, Copy, Component)] 28 | pub(super) struct NewtonianFluidModel { 29 | pub(super) rest_density: f32, 30 | pub(super) dynamic_viscosity: f32, 31 | pub(super) eos_stiffness: f32, 32 | pub(super) eos_power: f32, 33 | } 34 | 35 | impl ConstitutiveModel for NewtonianFluidModel { 36 | fn new_particle( 37 | self, 38 | commands: &mut Commands, 39 | texture: Handle, 40 | at: Vec2, 41 | mass: f32, 42 | created_at: usize, 43 | vel: Option, 44 | max_age: Option, 45 | ) { 46 | commands 47 | .spawn_bundle(SpriteBundle { 48 | texture, 49 | transform: Transform::from_scale(Vec3::splat(0.002)), 50 | ..Default::default() 51 | }) 52 | .insert_bundle(( 53 | Position(at), 54 | self, 55 | Mass(mass), 56 | Velocity(vel.unwrap_or(Vec2::ZERO)), 57 | MaxAge(max_age.unwrap_or(5000)), 58 | AffineMomentum(Mat2::ZERO), 59 | CreatedAt(created_at), 60 | CellMassMomentumContributions([GridMassAndMomentumChange(0, 0., Vec2::ZERO); 9]), 61 | ParticleTag, 62 | )); 63 | } 64 | } 65 | 66 | // solid constitutive model properties 67 | #[derive(Clone, Copy, Component)] 68 | pub(super) struct NeoHookeanHyperElasticModel { 69 | pub(super) deformation_gradient: Mat2, 70 | pub(super) elastic_lambda: f32, 71 | // youngs modulus 72 | pub(super) elastic_mu: f32, // shear modulus 73 | } 74 | 75 | impl ConstitutiveModel for NeoHookeanHyperElasticModel { 76 | fn new_particle( 77 | self, 78 | commands: &mut Commands, 79 | texture: Handle, 80 | at: Vec2, 81 | mass: f32, 82 | created_at: usize, 83 | vel: Option, 84 | max_age: Option, 85 | ) { 86 | commands 87 | .spawn_bundle(SpriteBundle { 88 | texture, 89 | transform: Transform::from_scale(Vec3::splat(0.005)), 90 | ..Default::default() 91 | }) 92 | .insert_bundle(( 93 | Position(at), 94 | self, 95 | Mass(mass), 96 | Velocity(vel.unwrap_or(Vec2::ZERO)), 97 | MaxAge(max_age.unwrap_or(5000)), 98 | AffineMomentum(Mat2::ZERO), 99 | CreatedAt(created_at), 100 | CellMassMomentumContributions([GridMassAndMomentumChange(0, 0., Vec2::ZERO); 9]), 101 | ParticleTag, 102 | )); 103 | } 104 | } 105 | 106 | pub(super) fn steel_properties() -> NeoHookeanHyperElasticModel { 107 | NeoHookeanHyperElasticModel { 108 | deformation_gradient: Default::default(), 109 | elastic_lambda: 180. * 1000., 110 | elastic_mu: 78. * 1000., 111 | } 112 | } 113 | 114 | pub(super) fn water_properties() -> NewtonianFluidModel { 115 | NewtonianFluidModel { 116 | rest_density: 4., 117 | dynamic_viscosity: 0.1, 118 | eos_stiffness: 100., 119 | eos_power: 4., 120 | } 121 | } 122 | 123 | // computed changes to-be-applied to grid on next steps 124 | #[derive(Component)] 125 | pub(super) struct CellMassMomentumContributions(pub(super) [GridMassAndMomentumChange; 9]); 126 | 127 | #[derive(Clone, Copy)] 128 | pub(super) struct GridMassAndMomentumChange(pub(super) usize, pub(super) f32, pub(super) Vec2); 129 | 130 | // tick the entity was created on 131 | #[derive(Component)] 132 | pub(super) struct CreatedAt(pub(super) usize); 133 | 134 | // entity deleted after this many ticks 135 | #[derive(Component)] 136 | pub(super) struct MaxAge(pub(super) usize); 137 | 138 | pub trait ConstitutiveModel { 139 | fn new_particle( 140 | self, 141 | commands: &mut Commands, 142 | texture: Handle, 143 | at: Vec2, 144 | mass: f32, 145 | created_at: usize, 146 | vel: Option, 147 | max_age: Option, 148 | ); 149 | } 150 | -------------------------------------------------------------------------------- /src/defaults.rs: -------------------------------------------------------------------------------- 1 | //pub(super) const DEFAULT_WINDOW_WIDTH: f32 = 1000.; 2 | //pub(super) const DEFAULT_WINDOW_HEIGHT: f32 = 1000.; 3 | // todo proper scaling. 4 | 5 | pub(super) const DEFAULT_GRID_WIDTH: usize = usize::pow(2, 8); 6 | 7 | // todo use me when spawning...? maybe variable for density. 8 | // pub(super) const PARTICLES_ACROSS_GRID: usize = 1024; 9 | // pub(super) const PARTICLES_ACROSS_CELL: usize = PARTICLES_ACROSS_GRID / DEFAULT_GRID_WIDTH; 10 | 11 | pub(super) const DEFAULT_DT: f32 = 0.002; 12 | pub(super) const DEFAULT_GRAVITY: f32 = -9.8; 13 | 14 | pub(super) const PAR_BATCH_SIZE: usize = usize::pow(2, 12); 15 | -------------------------------------------------------------------------------- /src/expire_old.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | 3 | use crate::components::*; 4 | use crate::world::*; 5 | 6 | pub(super) fn delete_old_entities( 7 | mut commands: Commands, 8 | world: Res, 9 | aged_entities: Query<(Entity, &CreatedAt, &MaxAge)>, 10 | ) { 11 | aged_entities.for_each(|(id, created_at, max_age)| { 12 | if world.current_tick > created_at.0 + max_age.0 { 13 | commands.entity(id).despawn(); 14 | } 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /src/grid.rs: -------------------------------------------------------------------------------- 1 | use bevy::math::{Mat2, Vec2}; 2 | use bevy::prelude::ResMut; 3 | 4 | #[derive(Debug, Clone, Copy)] 5 | pub(super) struct Cell { 6 | pub(super) velocity: Vec2, 7 | pub(super) mass: f32, 8 | } 9 | 10 | // MPM grid resource 11 | #[derive(Clone)] 12 | pub(super) struct Grid { 13 | pub(super) cells: Vec, 14 | pub(super) width: usize, 15 | } 16 | 17 | impl Grid { 18 | pub(super) fn new(width: usize) -> Grid { 19 | Grid { 20 | cells: vec![ 21 | Cell { 22 | velocity: Vec2::ZERO, 23 | mass: 0.0, 24 | }; 25 | width * width 26 | ], 27 | width, 28 | } 29 | } 30 | 31 | pub(super) fn index_at(&self, x: usize, y: usize) -> usize { 32 | x * self.width + y 33 | } 34 | 35 | pub(super) fn reset(&mut self) { 36 | for mut cell in self.cells.iter_mut() { 37 | cell.velocity = Vec2::ZERO; 38 | cell.mass = 0.0; 39 | } 40 | } 41 | 42 | pub(super) fn update(&mut self, dt: f32, gravity: f32) { 43 | for (i, cell) in self.cells.iter_mut().enumerate() { 44 | if cell.mass > 0.0 { 45 | // convert momentum to velocity, apply gravity 46 | cell.velocity *= 1.0 / cell.mass; 47 | cell.velocity.y += dt * gravity; 48 | 49 | // boundary conditions 50 | let x = i / self.width; 51 | let y = i % self.width; 52 | if x < 2 { 53 | // can only stay in place or go right 54 | if cell.velocity.x < 0.0 { 55 | cell.velocity.x = 0.0; 56 | } 57 | } 58 | if x > self.width - 3 { 59 | // can only stay in place or go left 60 | if cell.velocity.x > 0.0 { 61 | cell.velocity.x = 0.0; 62 | } 63 | } 64 | if y < 2 { 65 | // can only stay in place or go up 66 | if cell.velocity.y < 0.0 { 67 | cell.velocity.y = 0.0; 68 | } 69 | } 70 | if y > self.width - 3 { 71 | // can only stay in place or go down 72 | if cell.velocity.y > 0.0 { 73 | cell.velocity.y = 0.0; 74 | } 75 | } 76 | } 77 | } 78 | } 79 | } 80 | 81 | pub(super) fn reset_grid(mut grid: ResMut) { 82 | grid.reset(); 83 | } 84 | 85 | pub(super) fn quadratic_interpolation_weights(cell_diff: Vec2) -> [Vec2; 3] { 86 | [ 87 | Vec2::new( 88 | 0.5 * f32::powi(0.5 - cell_diff.x, 2), 89 | 0.5 * f32::powi(0.5 - cell_diff.y, 2), 90 | ), 91 | Vec2::new( 92 | 0.75 - f32::powi(cell_diff.x, 2), 93 | 0.75 - f32::powi(cell_diff.y, 2), 94 | ), 95 | Vec2::new( 96 | 0.5 * f32::powi(0.5 + cell_diff.x, 2), 97 | 0.5 * f32::powi(0.5 + cell_diff.y, 2), 98 | ), 99 | ] 100 | } 101 | 102 | pub(super) fn weighted_velocity_and_cell_dist_to_term( 103 | weighted_velocity: Vec2, 104 | cell_dist: Vec2, 105 | ) -> Mat2 { 106 | Mat2::from_cols( 107 | Vec2::new( 108 | weighted_velocity[0] * cell_dist[0], 109 | weighted_velocity[1] * cell_dist[0], 110 | ), 111 | Vec2::new( 112 | weighted_velocity[0] * cell_dist[1], 113 | weighted_velocity[1] * cell_dist[1], 114 | ), 115 | ) 116 | } 117 | -------------------------------------------------------------------------------- /src/inputs.rs: -------------------------------------------------------------------------------- 1 | use bevy::math::Vec2; 2 | use bevy::prelude::{ 3 | AssetServer, Commands, Entity, Input, KeyCode, Local, MouseButton, Query, Res, ResMut, Windows, 4 | With, 5 | }; 6 | use bevy_egui::{egui, EguiContext, EguiSettings}; 7 | 8 | use crate::{grid, spawn_particles, ParticleSpawnerInfo, SpawnerPattern}; 9 | 10 | use super::components::*; 11 | use super::defaults::*; 12 | use super::world::*; 13 | 14 | #[derive(Default)] 15 | pub(super) struct ClickAndDragState { 16 | dragging: bool, 17 | source_pos: Vec2, 18 | } 19 | 20 | pub(super) fn handle_inputs( 21 | mut commands: Commands, 22 | windows: Res, 23 | asset_server: Res, 24 | btn: Res>, 25 | keys: Res>, 26 | mut egui_context: ResMut, 27 | mut egui_settings: ResMut, 28 | mut toggle_scale_factor: Local>, 29 | mut world: ResMut, 30 | mut spawner_drag: Local, 31 | mut particles: Query<(Entity, &Position, &mut Velocity, &Mass), With>, 32 | // todo also reset all known spawners to the current set spawn patern. 33 | grid: Res, 34 | ) { 35 | let window = windows.get_primary().unwrap(); 36 | if let Some(win_pos) = window.cursor_position() { 37 | // cursor is inside the window. 38 | // translate window position to grid position 39 | let size = Vec2::new(window.width() as f32, window.height() as f32); 40 | let scale = f32::min(size.x, size.y) / grid.width as f32; 41 | let grid_pos = win_pos / scale; 42 | 43 | // if particle is near cursor, push it away. 44 | particles.par_for_each_mut(PAR_BATCH_SIZE, |(_, position, mut velocity, _)| { 45 | let dist = Vec2::new(position.0.x - grid_pos.x, position.0.y - grid_pos.y); 46 | 47 | let mouse_radius = 6.; 48 | 49 | if dist.dot(dist) < mouse_radius * mouse_radius { 50 | let norm_factor = dist.length() / mouse_radius; 51 | let force = dist.normalize() * (norm_factor / 2.); 52 | velocity.0 += force; 53 | } 54 | }); 55 | 56 | // can left click and drag to spawn new solid steel arrowhead with velocity. 57 | if btn.just_pressed(MouseButton::Left) && !spawner_drag.dragging { 58 | // start dragging 59 | spawner_drag.dragging = true; 60 | spawner_drag.source_pos = grid_pos; 61 | } else if btn.just_released(MouseButton::Left) && spawner_drag.dragging { 62 | // end dragging 63 | spawner_drag.dragging = false; 64 | 65 | // and spawn some particles with velocity based on drag distance 66 | let si = &ParticleSpawnerInfo { 67 | created_at: world.current_tick, 68 | pattern: SpawnerPattern::Triangle, 69 | spawn_frequency: 999999999, // todo special value to spawn once only. 70 | max_particles: 500000, 71 | particle_duration: 20000, 72 | particle_origin: spawner_drag.source_pos, 73 | particle_velocity: grid_pos - spawner_drag.source_pos, 74 | particle_velocity_random_vec_a: Default::default(), 75 | particle_velocity_random_vec_b: Default::default(), 76 | particle_mass: 1.0, 77 | }; 78 | 79 | spawn_particles( 80 | si, 81 | steel_properties(), 82 | &mut commands, 83 | asset_server.load("steel_particle.png"), 84 | &world, 85 | &grid, 86 | ); 87 | } 88 | 89 | // can right click to dump a bucket of water. 90 | if btn.just_pressed(MouseButton::Right) { 91 | let si = &ParticleSpawnerInfo { 92 | created_at: world.current_tick, 93 | pattern: SpawnerPattern::Cube, 94 | spawn_frequency: 999999999, // todo special value to spawn once only. 95 | max_particles: 500000, 96 | particle_duration: 20000, 97 | particle_origin: grid_pos, 98 | particle_velocity: Vec2::new(0., -40.), 99 | particle_velocity_random_vec_a: Default::default(), 100 | particle_velocity_random_vec_b: Default::default(), 101 | particle_mass: 0.75, 102 | }; 103 | 104 | // todo value to set size/width of spawned objects 105 | spawn_particles( 106 | si, 107 | water_properties(), 108 | &mut commands, 109 | asset_server.load("liquid_particle.png"), 110 | &world, 111 | &grid, 112 | ); 113 | } 114 | 115 | egui::Window::new("Controls").show(egui_context.ctx_mut(), |ui| { 116 | if ui.button("(R)eset").clicked() || keys.just_pressed(KeyCode::R) { 117 | particles.for_each(|(id, _, _, _)| { 118 | commands.entity(id).despawn(); 119 | }); 120 | world.dt = DEFAULT_DT; 121 | world.gravity = DEFAULT_GRAVITY; 122 | return; 123 | }; 124 | if ui.button("(G)ravity toggle").clicked() || keys.just_pressed(KeyCode::G) { 125 | world.toggle_gravity(); 126 | return; 127 | }; 128 | 129 | // slider for gravity 130 | ui.add(egui::Slider::new(&mut world.gravity, -10.0..=10.).text("gravity")); 131 | 132 | // slider for DT. 133 | ui.add(egui::Slider::new(&mut world.dt, 0.0001..=0.01).text("dt")); 134 | 135 | // toggle hiDPI with '/' 136 | if keys.just_pressed(KeyCode::Slash) || toggle_scale_factor.is_none() { 137 | *toggle_scale_factor = Some(!toggle_scale_factor.unwrap_or(true)); 138 | 139 | if let Some(window) = windows.get_primary() { 140 | let scale_factor = if toggle_scale_factor.unwrap() { 141 | 1.0 / window.scale_factor() 142 | } else { 143 | 1.0 144 | }; 145 | egui_settings.scale_factor = scale_factor; 146 | } 147 | } 148 | 149 | // todo: 150 | // one spawner can be selected (or new spawner to-create can be selected) 151 | // click and drag when placing to set particle velocity 152 | // the selected spawner shows its elements on left 153 | }); 154 | }; 155 | } 156 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | 3 | use bevy::diagnostic::{ 4 | EntityCountDiagnosticsPlugin, FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin, 5 | }; 6 | use bevy::prelude::*; 7 | use bevy::window::WindowMode::BorderlessFullscreen; 8 | use bevy_egui::EguiPlugin; 9 | 10 | use camera::*; 11 | use spawners::*; 12 | 13 | use crate::defaults::*; 14 | 15 | mod camera; 16 | mod components; 17 | mod defaults; 18 | mod expire_old; 19 | mod grid; 20 | mod inputs; 21 | mod particle_sprites; 22 | mod spawners; 23 | mod step_g2p; 24 | mod step_p2g; 25 | mod step_update_cells; 26 | mod step_update_deformations; 27 | mod step_update_grid; 28 | mod world; 29 | 30 | fn main() { 31 | App::new() 32 | .insert_resource(Msaa { samples: 4 }) 33 | .insert_resource(WindowDescriptor { 34 | title: "mlsmpm-particles-rs".to_string(), 35 | //width: DEFAULT_WINDOW_WIDTH, 36 | //height: DEFAULT_WINDOW_HEIGHT, // todo mouse cursor still wrong in fullscreen! 37 | mode: BorderlessFullscreen, 38 | ..Default::default() 39 | }) 40 | .insert_resource(grid::Grid::new(DEFAULT_GRID_WIDTH)) 41 | .insert_resource(world::WorldState::default()) 42 | .add_plugins(DefaultPlugins) 43 | .add_plugin(LogDiagnosticsPlugin::default()) 44 | .add_plugin(EguiPlugin) 45 | .add_plugin(EntityCountDiagnosticsPlugin::default()) 46 | .add_plugin(FrameTimeDiagnosticsPlugin::default()) 47 | .add_startup_system(setup_camera) 48 | .add_startup_system(create_initial_spawners) 49 | //.add_system( 50 | // set_zoom_from_window_size 51 | // .label("set_zoom_from_window_size") 52 | // .before("handle_inputs"), 53 | //) 54 | .add_system(bevy::window::close_on_esc) 55 | .add_system( 56 | inputs::handle_inputs 57 | .label("handle_inputs") 58 | .before("tick_spawners"), 59 | ) 60 | .add_system( 61 | spawners::tick_spawners 62 | .label("tick_spawners") 63 | .before("reset_grid"), 64 | ) 65 | .add_system(grid::reset_grid.label("reset_grid").before("update_cells")) 66 | .add_system( 67 | step_update_cells::update_cells 68 | .label("update_cells") 69 | .before("apply_update_cell_computations"), 70 | ) 71 | .add_system( 72 | step_update_cells::apply_update_cell_computations 73 | .label("apply_update_cell_computations") 74 | .before("p2g_f") 75 | .before("p2g_s"), 76 | ) 77 | .add_system( 78 | step_p2g::particles_to_grid_fluids 79 | .label("p2g_f") 80 | .before("update_grid"), 81 | ) 82 | .add_system( 83 | step_p2g::particles_to_grid_solids 84 | .label("p2g_s") 85 | .before("update_grid"), 86 | ) 87 | .add_system( 88 | step_update_grid::update_grid 89 | .label("update_grid") 90 | .before("g2p"), 91 | ) 92 | .add_system( 93 | step_g2p::grid_to_particles 94 | .label("g2p") 95 | .before("update_deformation_gradients"), 96 | ) 97 | .add_system( 98 | step_update_deformations::update_deformation_gradients 99 | .label("update_deformation_gradients") 100 | .before("delete_old_entities"), 101 | ) 102 | .add_system( 103 | expire_old::delete_old_entities 104 | .label("delete_old_entities") 105 | .before("update_sprites"), 106 | ) 107 | .add_system(particle_sprites::update_sprites.label("update_sprites")) 108 | .run(); 109 | } 110 | 111 | // todo render to (animated) image output 112 | // https://github.com/bevyengine/bevy/issues/1207 113 | //https://github.com/rmsc/bevy/blob/render_to_file/examples/3d/render_to_file.rs 114 | -------------------------------------------------------------------------------- /src/particle_sprites.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | 3 | use crate::components::*; 4 | use crate::defaults::*; 5 | 6 | pub(super) fn update_sprites(mut particles: Query<(&mut Transform, &Position), With>) { 7 | // todo adjust size relative to mass, min/max size determined by grid+window sizes 8 | // todo color based on velocity. (maybe acceleration?) 9 | // todo color based on constitutive model. (or initial texture.) 10 | particles.par_for_each_mut(PAR_BATCH_SIZE, |(mut transform, position)| { 11 | transform.translation.x = position.0.x; 12 | transform.translation.y = position.0.y; 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /src/spawners.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | use rand::Rng; 3 | 4 | use super::components::*; 5 | use super::grid::*; 6 | use super::world::*; 7 | 8 | const LIQUID_PARTICLE_MASS: f32 = 1.; 9 | const WOOD_PARTICLE_MASS: f32 = 1.; 10 | const STEEL_PARTICLE_MASS: f32 = 1.5; 11 | 12 | // Tags particle spawner entities 13 | #[derive(Component)] 14 | pub(super) struct ParticleSpawnerTag; 15 | 16 | // todo refactor. 17 | #[allow(dead_code)] 18 | #[derive(Clone)] 19 | pub(super) enum SpawnerPattern { 20 | SingleParticle, 21 | LineHorizontal, 22 | LineVertical, 23 | Cube, 24 | Tower, 25 | Triangle, 26 | } 27 | 28 | #[derive(Clone, Component)] 29 | pub(super) struct ParticleSpawnerInfo { 30 | pub(super) created_at: usize, 31 | pub(super) pattern: SpawnerPattern, 32 | pub(super) spawn_frequency: usize, 33 | pub(super) max_particles: usize, 34 | pub(super) particle_duration: usize, 35 | pub(super) particle_origin: Vec2, 36 | pub(super) particle_velocity: Vec2, 37 | pub(super) particle_velocity_random_vec_a: Vec2, 38 | pub(super) particle_velocity_random_vec_b: Vec2, 39 | pub(super) particle_mass: f32, 40 | } 41 | 42 | pub(super) fn create_initial_spawners( 43 | mut commands: Commands, 44 | asset_server: Res, 45 | grid: Res, 46 | ) { 47 | // shoot arrows to the right 48 | // young's modulus and shear modulus of steel. 49 | // 180 Gpa young's 50 | // 78Gpa shear 51 | commands.spawn_bundle(( 52 | // todo density option to spawners 53 | // todo calculate correct particle mass from material density and particle density 54 | ParticleSpawnerInfo { 55 | created_at: 0, 56 | pattern: SpawnerPattern::Triangle, 57 | spawn_frequency: 800, 58 | max_particles: 200000, 59 | particle_duration: 40000, 60 | particle_origin: Vec2::new(1.1 * grid.width as f32 / 4., 1. * grid.width as f32 / 4.), 61 | particle_velocity: Vec2::new(100.3, -1.3), 62 | particle_velocity_random_vec_a: Vec2::new(-0.0, -0.0), 63 | particle_velocity_random_vec_b: Vec2::new(0.0, 0.0), 64 | particle_mass: STEEL_PARTICLE_MASS, 65 | }, 66 | steel_properties(), 67 | asset_server.load::("steel_particle.png"), 68 | ParticleSpawnerTag, 69 | )); 70 | 71 | // spawn tower on first turn. 72 | // searching says the properties of wood/plywood are 9Gpa young's modulus 0.6Gpa shear modulus 73 | // but has been increased to 18 Gpa and 6 Gpa to make it more rigid 74 | commands.spawn_bundle(( 75 | ParticleSpawnerInfo { 76 | created_at: 0, 77 | pattern: SpawnerPattern::Tower, 78 | spawn_frequency: 99999999, 79 | max_particles: 50000, 80 | particle_duration: 500000, 81 | particle_origin: Vec2::new(2.5 * grid.width as f32 / 4., 1.), 82 | particle_velocity: Vec2::ZERO, 83 | particle_velocity_random_vec_a: Vec2::ZERO, 84 | particle_velocity_random_vec_b: Vec2::ZERO, 85 | particle_mass: WOOD_PARTICLE_MASS, 86 | }, 87 | NeoHookeanHyperElasticModel { 88 | deformation_gradient: Default::default(), 89 | elastic_lambda: 18. * 1000., 90 | elastic_mu: 6. * 1000., 91 | }, 92 | asset_server.load::("wood_particle.png"), 93 | ParticleSpawnerTag, 94 | )); 95 | 96 | // make it rain! 97 | commands.spawn_bundle(( 98 | ParticleSpawnerInfo { 99 | created_at: 0, 100 | pattern: SpawnerPattern::Cube, 101 | spawn_frequency: 78, 102 | max_particles: 75000, 103 | particle_duration: 100000, 104 | particle_origin: Vec2::new( 105 | 0.5 * grid.width as f32 / 4. + 12., 106 | 3. * grid.width as f32 / 4. + 16., 107 | ), 108 | particle_velocity: Vec2::new(-20., -55.), 109 | particle_velocity_random_vec_a: Vec2::ZERO, 110 | particle_velocity_random_vec_b: Vec2::ZERO, 111 | particle_mass: LIQUID_PARTICLE_MASS, 112 | }, 113 | water_properties(), 114 | asset_server.load::("liquid_particle.png"), 115 | ParticleSpawnerTag, 116 | )); 117 | commands.spawn_bundle(( 118 | ParticleSpawnerInfo { 119 | created_at: 0, 120 | pattern: SpawnerPattern::Cube, 121 | spawn_frequency: 478, 122 | max_particles: 75000, 123 | particle_duration: 100000, 124 | particle_origin: Vec2::new( 125 | 0.5 * grid.width as f32 / 4. + 20., 126 | 3. * grid.width as f32 / 4. + 12., 127 | ), 128 | particle_velocity: Vec2::new(-20., -35.), 129 | particle_velocity_random_vec_a: Vec2::ZERO, 130 | particle_velocity_random_vec_b: Vec2::ZERO, 131 | particle_mass: LIQUID_PARTICLE_MASS, 132 | }, 133 | water_properties(), 134 | asset_server.load::("liquid_particle.png"), 135 | ParticleSpawnerTag, 136 | )); 137 | commands.spawn_bundle(( 138 | ParticleSpawnerInfo { 139 | created_at: 0, 140 | pattern: SpawnerPattern::Cube, 141 | spawn_frequency: 478, 142 | max_particles: 75000, 143 | particle_duration: 100000, 144 | particle_origin: Vec2::new( 145 | 0.5 * grid.width as f32 / 4. - 16., 146 | 3. * grid.width as f32 / 4., 147 | ), 148 | particle_velocity: Vec2::new(30., -35.), 149 | particle_velocity_random_vec_a: Vec2::ZERO, 150 | particle_velocity_random_vec_b: Vec2::ZERO, 151 | particle_mass: LIQUID_PARTICLE_MASS, 152 | }, 153 | water_properties(), 154 | asset_server.load::("liquid_particle.png"), 155 | ParticleSpawnerTag, 156 | )); 157 | commands.spawn_bundle(( 158 | ParticleSpawnerInfo { 159 | created_at: 0, 160 | pattern: SpawnerPattern::Cube, 161 | spawn_frequency: 800, 162 | max_particles: 75000, 163 | particle_duration: 100000, 164 | particle_origin: Vec2::new( 165 | 0.5 * grid.width as f32 / 4. - 8., 166 | 3. * grid.width as f32 / 4., 167 | ), 168 | particle_velocity: Vec2::new(40., -45.), 169 | particle_velocity_random_vec_a: Vec2::ZERO, 170 | particle_velocity_random_vec_b: Vec2::ZERO, 171 | particle_mass: LIQUID_PARTICLE_MASS, 172 | }, 173 | water_properties(), 174 | asset_server.load::("liquid_particle.png"), 175 | ParticleSpawnerTag, 176 | )); 177 | commands.spawn_bundle(( 178 | ParticleSpawnerInfo { 179 | created_at: 0, 180 | pattern: SpawnerPattern::Cube, 181 | spawn_frequency: 700, 182 | max_particles: 75000, 183 | particle_duration: 100000, 184 | particle_origin: Vec2::new(0.5 * grid.width as f32 / 4., 3. * grid.width as f32 / 4.), 185 | particle_velocity: Vec2::new(50., -45.), 186 | particle_velocity_random_vec_a: Vec2::ZERO, 187 | particle_velocity_random_vec_b: Vec2::ZERO, 188 | particle_mass: LIQUID_PARTICLE_MASS, 189 | }, 190 | water_properties(), 191 | asset_server.load::("liquid_particle.png"), 192 | ParticleSpawnerTag, 193 | )); 194 | commands.spawn_bundle(( 195 | ParticleSpawnerInfo { 196 | created_at: 0, 197 | pattern: SpawnerPattern::Cube, 198 | spawn_frequency: 600, 199 | max_particles: 75000, 200 | particle_duration: 100000, 201 | particle_origin: Vec2::new( 202 | 0.5 * grid.width as f32 / 4. + 8., 203 | 3. * grid.width as f32 / 4., 204 | ), 205 | particle_velocity: Vec2::new(10., -45.), 206 | particle_velocity_random_vec_a: Vec2::ZERO, 207 | particle_velocity_random_vec_b: Vec2::ZERO, 208 | particle_mass: LIQUID_PARTICLE_MASS, 209 | }, 210 | water_properties(), 211 | asset_server.load::("liquid_particle.png"), 212 | ParticleSpawnerTag, 213 | )); 214 | } 215 | 216 | pub(super) fn tick_spawners( 217 | mut commands: Commands, 218 | world: Res, 219 | grid: Res, 220 | particles: Query<(), With>, 221 | spawners_solids: Query< 222 | ( 223 | &ParticleSpawnerInfo, 224 | &NeoHookeanHyperElasticModel, 225 | &Handle, 226 | ), 227 | With, 228 | >, 229 | spawners_fluids: Query< 230 | (&ParticleSpawnerInfo, &NewtonianFluidModel, &Handle), 231 | With, 232 | >, 233 | ) { 234 | // todo recreate spiral spawn pattern - rate per spawn and rotation per spawn 235 | 236 | spawners_solids.for_each(|(spawner_info, particle_properties, texture)| { 237 | if (world.current_tick - spawner_info.created_at) % spawner_info.spawn_frequency == 0 238 | && particles.iter().count() < spawner_info.max_particles 239 | { 240 | spawn_particles( 241 | spawner_info, 242 | *particle_properties, 243 | &mut commands, 244 | texture.clone(), 245 | &world, 246 | &grid, 247 | ); 248 | } 249 | }); 250 | 251 | spawners_fluids.for_each(|(spawner_info, particle_properties, texture)| { 252 | if (world.current_tick - spawner_info.created_at) % spawner_info.spawn_frequency == 0 253 | && particles.iter().count() < spawner_info.max_particles 254 | { 255 | spawn_particles( 256 | spawner_info, 257 | *particle_properties, 258 | &mut commands, 259 | texture.clone(), 260 | &world, 261 | &grid, 262 | ); 263 | } 264 | }); 265 | } 266 | 267 | fn spawn_particle( 268 | commands: &mut Commands, 269 | grid_width: usize, 270 | cm: impl ConstitutiveModel + Copy, 271 | spawner_info: &ParticleSpawnerInfo, 272 | spawn_offset: Vec2, 273 | vel: Option, 274 | texture: Handle, 275 | created_at: usize, 276 | ) { 277 | let particle_position = spawner_info.particle_origin + spawn_offset; 278 | 279 | let min = 3; 280 | let max = grid_width - 4; 281 | if particle_position.x <= min as f32 || particle_position.x >= max as f32 { 282 | return; 283 | } 284 | if particle_position.y <= min as f32 || particle_position.y >= max as f32 { 285 | return; 286 | } 287 | 288 | cm.new_particle( 289 | commands, 290 | texture.clone(), 291 | particle_position, 292 | spawner_info.particle_mass, 293 | created_at, 294 | vel, 295 | Some(spawner_info.particle_duration), 296 | ); 297 | } 298 | 299 | pub(super) fn spawn_particles( 300 | spawner_info: &ParticleSpawnerInfo, 301 | cm: impl ConstitutiveModel + Copy, 302 | commands: &mut Commands, 303 | texture: Handle, 304 | world: &WorldState, 305 | grid: &Res, 306 | ) { 307 | // todo prevent out-of-bounds spawning here. 308 | 309 | let mut rng = rand::thread_rng(); 310 | let base_vel = spawner_info.particle_velocity; 311 | let random_a_contrib = Vec2::new( 312 | rng.gen::() * spawner_info.particle_velocity_random_vec_a.x, 313 | rng.gen::() * spawner_info.particle_velocity_random_vec_a.y, 314 | ); 315 | let random_b_contrib = Vec2::new( 316 | rng.gen::() * spawner_info.particle_velocity_random_vec_b.x, 317 | rng.gen::() * spawner_info.particle_velocity_random_vec_b.y, 318 | ); 319 | let spawn_vel = base_vel + random_a_contrib + random_b_contrib; 320 | 321 | match spawner_info.pattern { 322 | SpawnerPattern::SingleParticle => { 323 | spawn_particle( 324 | commands, 325 | grid.width, 326 | cm, 327 | spawner_info, 328 | Vec2::ZERO, 329 | Some(spawn_vel), 330 | texture.clone(), 331 | world.current_tick, 332 | ); 333 | } 334 | SpawnerPattern::LineHorizontal => { 335 | for x in 0..100 { 336 | spawn_particle( 337 | commands, 338 | grid.width, 339 | cm, 340 | spawner_info, 341 | Vec2::new(x as f32, 0.), 342 | Some(spawn_vel), 343 | texture.clone(), 344 | world.current_tick, 345 | ); 346 | } 347 | } 348 | SpawnerPattern::LineVertical => { 349 | for y in 0..15 { 350 | spawn_particle( 351 | commands, 352 | grid.width, 353 | cm, 354 | spawner_info, 355 | Vec2::new(0., y as f32), 356 | Some(spawn_vel), 357 | texture.clone(), 358 | world.current_tick, 359 | ); 360 | } 361 | } 362 | SpawnerPattern::Cube => { 363 | for x in 0..15 { 364 | for y in 0..15 { 365 | spawn_particle( 366 | commands, 367 | grid.width, 368 | cm, 369 | spawner_info, 370 | Vec2::new(x as f32 + 0.001, y as f32 + 0.001), 371 | Some(spawn_vel), 372 | texture.clone(), 373 | world.current_tick, 374 | ); 375 | } 376 | } 377 | } 378 | SpawnerPattern::Tower => { 379 | for x in 0..80 { 380 | for y in 0..90 { 381 | spawn_particle( 382 | commands, 383 | grid.width, 384 | cm, 385 | spawner_info, 386 | Vec2::new(x as f32, y as f32), 387 | Some(spawn_vel), 388 | texture.clone(), 389 | world.current_tick, 390 | ); 391 | } 392 | } 393 | } 394 | SpawnerPattern::Triangle => { 395 | let x_axis: Vec2 = Vec2::new(1., 0.); 396 | let angle = match spawn_vel.length() { 397 | 0. => 0., 398 | _ => x_axis.angle_between(spawn_vel), 399 | }; 400 | 401 | for x in 0..30 { 402 | for y in 0..x { 403 | // offset y by 0.5 every other time 404 | let mut ya: f32 = if x % 2 == 0 { 405 | y as f32 - 0.25 406 | } else { 407 | y as f32 + 0.25 408 | }; 409 | ya -= x as f32 / 2.; 410 | 411 | // rotate by angle about triangle tip (15, 0) 412 | let pivot: Vec2 = Vec2::new(15., 0.); 413 | let pos: Vec2 = Vec2::new( 414 | (0.001 + pivot.x - x as f32) / 4., 415 | (0.001 + pivot.y + ya as f32) / 4., 416 | ); 417 | 418 | // 1. translate point back to origin 419 | let pos_rel_origin: Vec2 = Vec2::new(pos.x - pivot.x, pos.y - pivot.y); 420 | 421 | // 2. rotate point 422 | let pos_rel_origin_rotated: Vec2 = Vec2::new( 423 | pos_rel_origin.x * angle.cos() - pos_rel_origin.y * angle.sin(), 424 | pos_rel_origin.x * angle.sin() + pos_rel_origin.y * angle.cos(), 425 | ); 426 | 427 | // 3. translate point back: 428 | let pos_rotated: Vec2 = pos_rel_origin_rotated + pivot; 429 | 430 | spawn_particle( 431 | commands, 432 | grid.width, 433 | cm, 434 | spawner_info, 435 | pos_rotated, 436 | Some(spawn_vel), 437 | texture.clone(), 438 | world.current_tick, 439 | ); 440 | } 441 | } 442 | } 443 | } 444 | } 445 | -------------------------------------------------------------------------------- /src/step_g2p.rs: -------------------------------------------------------------------------------- 1 | use bevy::math::Mat2; 2 | use bevy::prelude::*; 3 | 4 | use crate::components::*; 5 | use crate::defaults::*; 6 | use crate::grid::*; 7 | use crate::world::*; 8 | 9 | // G2P MPM step 10 | pub(super) fn grid_to_particles( 11 | world: Res, 12 | grid: Res, 13 | mut particles: Query<(&mut Position, &mut Velocity, &mut AffineMomentum), With>, 14 | ) { 15 | particles.par_for_each_mut( 16 | PAR_BATCH_SIZE, 17 | |(mut position, mut velocity, mut affine_momentum)| { 18 | //// reset particle velocity. we calculate it from scratch each step using the grid 19 | velocity.0 = Vec2::ZERO; 20 | 21 | let cell_x: u32 = position.0.x as u32; 22 | let cell_y: u32 = position.0.y as u32; 23 | let cell_diff = Vec2::new( 24 | position.0.x - cell_x as f32 - 0.5, 25 | position.0.y - cell_y as f32 - 0.5, 26 | ); 27 | let weights = quadratic_interpolation_weights(cell_diff); 28 | 29 | // affine per-particle momentum matrix from APIC / MLS-MPM. 30 | // see APIC paper (https://web.archive.org/web/20190427165435/https://www.math.ucla.edu/~jteran/papers/JSSTS15.pdf), page 6 31 | // below equation 11 for clarification. this is calculating C = B * (D^-1) for APIC equation 8, 32 | // where B is calculated in the inner loop at (D^-1) = 4 is a constant when using quadratic interpolation functions 33 | let mut b = Mat2::ZERO; 34 | // for all surrounding 9 cells 35 | for gx in 0..3 { 36 | for gy in 0..3 { 37 | let weight = weights[gx].x * weights[gy].y; 38 | let cell_pos_x = (cell_x as i32 + gx as i32) - 1; 39 | let cell_pos_y = (cell_y as i32 + gy as i32) - 1; 40 | let cell_dist = Vec2::new( 41 | cell_pos_x as f32 - position.0.x + 0.5, 42 | cell_pos_y as f32 - position.0.y + 0.5, 43 | ); 44 | 45 | let cell_at_index = 46 | // todo why was this fine when using grid directly? 47 | grid.index_at(cell_pos_x as usize, cell_pos_y as usize); 48 | let weighted_velocity = grid.cells[cell_at_index].velocity * weight; 49 | b += weighted_velocity_and_cell_dist_to_term(weighted_velocity, cell_dist); 50 | velocity.0 += weighted_velocity; 51 | } 52 | } 53 | 54 | affine_momentum.0 = b * 4.0; 55 | 56 | // advect particles 57 | position.0 += velocity.0 * world.dt; 58 | 59 | //// safety clamp to ensure particles don't exit simulation domain 60 | position.0.x = position.0.x.clamp(1.0, (grid.width - 2) as f32); 61 | position.0.y = position.0.y.clamp(1.0, (grid.width - 2) as f32); 62 | 63 | // predictive boundary velocity cap 64 | let wall_min: f32 = 3.0; 65 | let wall_max: f32 = (grid.width - 1) as f32 - wall_min; 66 | 67 | // apply boundary conditions about 0.1 seconds before reaching edge 68 | let dt_multiplier = 0.1 / world.dt; 69 | let position_next = position.0 + velocity.0 * world.dt * dt_multiplier; 70 | if position_next.x < wall_min { 71 | velocity.0.x += wall_min - position_next.x; 72 | } 73 | if position_next.x > wall_max { 74 | velocity.0.x += wall_max - position_next.x; 75 | } 76 | if position_next.y < wall_min { 77 | velocity.0.y += wall_min - position_next.y; 78 | } 79 | if position_next.y > wall_max { 80 | velocity.0.y += wall_max - position_next.y; 81 | } 82 | }, 83 | ); 84 | } 85 | -------------------------------------------------------------------------------- /src/step_p2g.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{Add, Mul, Sub}; 2 | 3 | use bevy::math::Mat2; 4 | use bevy::prelude::*; 5 | 6 | use crate::components::*; 7 | use crate::defaults::*; 8 | use crate::grid::*; 9 | use crate::world::*; 10 | 11 | pub(super) fn particles_to_grid_solids( 12 | grid: Res, 13 | world: Res, 14 | mut particles_solid: Query< 15 | ( 16 | &Position, 17 | &Mass, 18 | &AffineMomentum, 19 | &NeoHookeanHyperElasticModel, 20 | &mut CellMassMomentumContributions, 21 | ), 22 | With, 23 | >, 24 | ) { 25 | let num_particles = particles_solid.iter().count(); 26 | if num_particles < 1 { 27 | return; 28 | } 29 | particles_solid.par_for_each_mut(PAR_BATCH_SIZE, |(position, mass, _, pp, mut mmc)| { 30 | let cell_x: u32 = position.0.x as u32; 31 | let cell_y: u32 = position.0.y as u32; 32 | let cell_diff = Vec2::new( 33 | position.0.x - cell_x as f32 - 0.5, 34 | position.0.y - cell_y as f32 - 0.5, 35 | ); 36 | let weights = quadratic_interpolation_weights(cell_diff); 37 | 38 | // check surrounding 9 cells to get volume from density 39 | let mut density: f32 = 0.0; 40 | for gx in 0..3 { 41 | for gy in 0..3 { 42 | let weight = weights[gx].x * weights[gy].y; 43 | let cell_pos_x = (cell_x as i32 + gx as i32) - 1; 44 | let cell_pos_y = (cell_y as i32 + gy as i32) - 1; 45 | let cell_at_index = grid.index_at(cell_pos_x as usize, cell_pos_y as usize); 46 | density += grid.cells[cell_at_index].mass * weight; 47 | } 48 | } 49 | 50 | let volume = mass.0 / density; 51 | 52 | let j: f32 = pp.deformation_gradient.determinant(); 53 | let volume_scaled = volume * j; 54 | 55 | let f_t: Mat2 = pp.deformation_gradient.transpose(); 56 | let f_inv_t = f_t.inverse(); 57 | let f_minus_f_inv_t = pp.deformation_gradient.sub(f_inv_t); 58 | 59 | let p_term_0: Mat2 = f_minus_f_inv_t.mul(pp.elastic_mu); 60 | let p_term_1: Mat2 = f_inv_t.mul(j.ln() * pp.elastic_lambda); 61 | let p_combined: Mat2 = p_term_0.add(p_term_1); 62 | 63 | let stress: Mat2 = p_combined.mul_mat2(&f_t).mul(1.0 / j); 64 | let eq_16_term_0 = stress * (-volume_scaled * 4.0 * world.dt); 65 | 66 | // for all surrounding 9 cells 67 | for gx in 0..3 { 68 | for gy in 0..3 { 69 | let weight = weights[gx].x * weights[gy].y; 70 | let cell_pos_x = (cell_x as i32 + gx as i32) - 1; 71 | let cell_pos_y = (cell_y as i32 + gy as i32) - 1; 72 | let cell_dist = Vec2::new( 73 | cell_pos_x as f32 - position.0.x + 0.5, 74 | cell_pos_y as f32 - position.0.y + 0.5, 75 | ); 76 | let cell_at_index = grid.index_at(cell_pos_x as usize, cell_pos_y as usize); 77 | // store the fused force/momentum update from MLS-MPM to apply onto grid later. 78 | // todo combine into grid(x,y) = total changes as they come in here...? 79 | mmc.0[gx + 3 * gy] = GridMassAndMomentumChange( 80 | cell_at_index, 81 | 0., 82 | eq_16_term_0.mul_scalar(weight).mul_vec2(cell_dist), 83 | ); 84 | } 85 | } 86 | }); 87 | } 88 | 89 | pub(super) fn particles_to_grid_fluids( 90 | world: Res, 91 | grid: Res, 92 | mut particles_fluid: Query< 93 | ( 94 | &Position, 95 | &Mass, 96 | &AffineMomentum, 97 | &NewtonianFluidModel, 98 | &mut CellMassMomentumContributions, 99 | ), 100 | With, 101 | >, 102 | ) { 103 | let num_particles = particles_fluid.iter().count(); 104 | if num_particles < 1 { 105 | return; 106 | } 107 | particles_fluid.par_for_each_mut( 108 | PAR_BATCH_SIZE, 109 | |(position, mass, affine_momentum, pp, mut mmc)| { 110 | let cell_x: u32 = position.0.x as u32; 111 | let cell_y: u32 = position.0.y as u32; 112 | let cell_diff = Vec2::new( 113 | position.0.x - cell_x as f32 - 0.5, 114 | position.0.y - cell_y as f32 - 0.5, 115 | ); 116 | let weights = quadratic_interpolation_weights(cell_diff); 117 | 118 | // check surrounding 9 cells to get volume from density 119 | let mut density: f32 = 0.0; 120 | for gx in 0..3 { 121 | for gy in 0..3 { 122 | let weight = weights[gx].x * weights[gy].y; 123 | let cell_pos_x = (cell_x as i32 + gx as i32) - 1; 124 | let cell_pos_y = (cell_y as i32 + gy as i32) - 1; 125 | let cell_at_index = grid.index_at(cell_pos_x as usize, cell_pos_y as usize); 126 | density += grid.cells[cell_at_index].mass * weight; 127 | } 128 | } 129 | 130 | let volume = mass.0 / density; 131 | 132 | // fluid constitutive model 133 | let pressure = f32::max( 134 | -0.1, 135 | pp.eos_stiffness * (f32::powf(density / pp.rest_density, pp.eos_power) - 1.0), 136 | ); 137 | let mut stress = Mat2::from_cols(Vec2::new(-pressure, 0.0), Vec2::new(0.0, -pressure)); 138 | let mut strain = affine_momentum.0; 139 | let trace = strain.y_axis.x + strain.x_axis.y; 140 | strain.y_axis.x = trace; 141 | strain.x_axis.y = trace; 142 | let viscosity_term = strain * pp.dynamic_viscosity; 143 | stress += viscosity_term; 144 | 145 | let eq_16_term_0 = stress * (-volume * 4.0 * world.dt); 146 | 147 | // for all surrounding 9 cells 148 | for gx in 0..3 { 149 | for gy in 0..3 { 150 | let weight = weights[gx].x * weights[gy].y; 151 | let cell_pos_x = (cell_x as i32 + gx as i32) - 1; 152 | let cell_pos_y = (cell_y as i32 + gy as i32) - 1; 153 | let cell_dist = Vec2::new( 154 | cell_pos_x as f32 - position.0.x + 0.5, 155 | cell_pos_y as f32 - position.0.y + 0.5, 156 | ); 157 | let cell_at_index = grid.index_at(cell_pos_x as usize, cell_pos_y as usize); 158 | let momentum = eq_16_term_0 * weight * cell_dist; 159 | mmc.0[gx + 3 * gy] = GridMassAndMomentumChange(cell_at_index, 0., momentum); 160 | } 161 | } 162 | }, 163 | ); 164 | } 165 | -------------------------------------------------------------------------------- /src/step_update_cells.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | 3 | use crate::components::*; 4 | use crate::defaults::*; 5 | use crate::grid::*; 6 | 7 | pub(super) fn update_cells( 8 | grid: Res, 9 | mut particles: Query< 10 | ( 11 | &Position, 12 | &Velocity, 13 | &Mass, 14 | &AffineMomentum, 15 | &mut CellMassMomentumContributions, 16 | ), 17 | With, 18 | >, 19 | ) { 20 | let num_particles = particles.iter().count(); 21 | if num_particles < 1 { 22 | return; 23 | } 24 | particles.par_for_each_mut( 25 | PAR_BATCH_SIZE, 26 | |(position, velocity, mass, affine_momentum, mut mmc)| { 27 | let cell_x: u32 = position.0.x as u32; 28 | let cell_y: u32 = position.0.y as u32; 29 | let cell_diff = Vec2::new( 30 | position.0.x - cell_x as f32 - 0.5, 31 | position.0.y - cell_y as f32 - 0.5, 32 | ); 33 | let weights = quadratic_interpolation_weights(cell_diff); 34 | 35 | //collect momentum changes for surrounding 9 cells. 36 | for gx in 0..3 { 37 | for gy in 0..3 { 38 | let weight = weights[gx].x * weights[gy].y; 39 | let cell_pos_x = (cell_x as i32 + gx as i32) - 1; 40 | let cell_pos_y = (cell_y as i32 + gy as i32) - 1; 41 | let cell_dist = Vec2::new( 42 | cell_pos_x as f32 - position.0.x + 0.5, 43 | cell_pos_y as f32 - position.0.y + 0.5, 44 | ); 45 | let cell_at_index = grid.index_at(cell_pos_x as usize, cell_pos_y as usize); 46 | 47 | let q = affine_momentum.0 * cell_dist; 48 | let mass_contrib = weight * mass.0; 49 | // mass and momentum update 50 | mmc.0[gx + 3 * gy] = GridMassAndMomentumChange( 51 | cell_at_index, 52 | mass_contrib, 53 | (velocity.0 + q) * mass_contrib, 54 | ); 55 | } 56 | } 57 | }, 58 | ); 59 | } 60 | 61 | // todo look into replacing CellMassMomentumContributions with bevy events .. 62 | // .. after this one is done https://github.com/bevyengine/bevy/issues/2648 63 | pub(super) fn apply_update_cell_computations( 64 | mut grid: ResMut, 65 | particles: Query<(&CellMassMomentumContributions,), With>, 66 | ) { 67 | particles.for_each(|mmc| { 68 | for change in mmc.0 .0.iter() { 69 | grid.cells[change.0].mass += change.1; 70 | grid.cells[change.0].velocity += change.2; 71 | } 72 | }); 73 | } 74 | -------------------------------------------------------------------------------- /src/step_update_deformations.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{Add, Mul}; 2 | 3 | use bevy::math::Mat2; 4 | use bevy::prelude::*; 5 | 6 | use crate::components::*; 7 | use crate::defaults::*; 8 | use crate::world::*; 9 | 10 | pub(super) fn update_deformation_gradients( 11 | world: Res, 12 | mut particles_solid: Query< 13 | (&AffineMomentum, &mut NeoHookeanHyperElasticModel), 14 | With, 15 | >, 16 | ) { 17 | particles_solid.par_for_each_mut(PAR_BATCH_SIZE, |(affine_momentum, mut pp)| { 18 | let deformation_new: Mat2 = Mat2::IDENTITY 19 | .add(affine_momentum.0.mul(world.dt)) 20 | .mul_mat2(&pp.deformation_gradient); 21 | pp.deformation_gradient = deformation_new; 22 | 23 | // todo investigate plastic deformation that makes material want to keep its damaged state. 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /src/step_update_grid.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | 3 | use crate::components::*; 4 | use crate::grid::Grid; 5 | use crate::world::*; 6 | 7 | pub(super) fn update_grid( 8 | mut grid: ResMut, 9 | mut world: ResMut, 10 | particles: Query<(&CellMassMomentumContributions,), With>, 11 | ) { 12 | particles.for_each(|mmc| { 13 | for change in mmc.0 .0.iter() { 14 | grid.cells[change.0].velocity += change.2; 15 | } 16 | }); 17 | 18 | world.update(); 19 | grid.update( 20 | world.dt, 21 | if world.gravity_enabled { 22 | world.gravity 23 | } else { 24 | 0. 25 | }, 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /src/test.rs: -------------------------------------------------------------------------------- 1 | use bevy::math::{Mat2, Vec2}; 2 | 3 | #[cfg(test)] 4 | mod tests { 5 | use crate::*; 6 | 7 | // Note this useful idiom: importing names from outer (for mod tests) scope. 8 | use super::*; 9 | 10 | const TEST_GRID_WIDTH: usize = 10; 11 | const TEST_DT: f32 = 0.1; 12 | const TEST_GRAVITY: f32 = -0.3; 13 | 14 | #[test] 15 | fn test_quadratic_interpolation_weights() { 16 | let cell_diff = Vec2::new(-0.5, -0.5); 17 | let weights = quadratic_interpolation_weights(cell_diff); 18 | assert_eq!( 19 | [ 20 | Vec2::new(0.5, 0.5), 21 | Vec2::new(0.5, 0.5), 22 | Vec2::new(0.0, 0.0) 23 | ], 24 | weights 25 | ); 26 | } 27 | 28 | #[test] 29 | fn test_weighted_velocity_and_cell_dist_to_term_x_zero() { 30 | let zm = Mat2::from_cols(Vec2::new(0.0, 0.0), Vec2::new(1.0, 1.0)); 31 | assert_eq!( 32 | weighted_velocity_and_cell_dist_to_term(Vec2::new(1.0, 1.0), Vec2::new(0.0, 1.0)), 33 | zm 34 | ); 35 | assert_eq!(0.0, zm.determinant()); 36 | } 37 | 38 | #[test] 39 | fn test_weighted_velocity_and_cell_dist_to_term_y_zero() { 40 | let zm = Mat2::from_cols(Vec2::new(1.0, 1.0), Vec2::new(0.0, 0.0)); 41 | assert_eq!( 42 | weighted_velocity_and_cell_dist_to_term(Vec2::new(1.0, 1.0), Vec2::new(1.0, 0.0)), 43 | zm 44 | ); 45 | assert_eq!(0.0, zm.determinant()); 46 | } 47 | 48 | #[test] 49 | fn test_weighted_velocity_and_cell_dist_to_term() { 50 | let zm = Mat2::from_cols( 51 | Vec2::new(0.22 * 2.0, 0.77 * 2.0), 52 | Vec2::new(0.22 * -1.0, 0.77 * -1.0), 53 | ); 54 | assert_eq!( 55 | weighted_velocity_and_cell_dist_to_term(Vec2::new(0.22, 0.77), Vec2::new(2.0, -1.0)), 56 | zm 57 | ); 58 | assert_eq!(0.0, zm.determinant()); 59 | assert_eq!(zm.row(0).x, 0.22 * 2.0); 60 | assert_eq!(zm.row(1).x, 0.77 * 2.0); 61 | } 62 | 63 | #[test] 64 | // in update_cells system, a single particle in freefall should update mass and velocity of surrounding cells. 65 | fn test_update_cells_iteration() { 66 | let mut world = World::default(); 67 | let mut update_stage = SystemStage::parallel(); 68 | world.insert_resource(Grid { 69 | cells: vec![ 70 | Cell { 71 | velocity: Vec2::ZERO, 72 | mass: 0.0, 73 | }; 74 | TEST_GRID_WIDTH * TEST_GRID_WIDTH, 75 | ], 76 | width: TEST_GRID_WIDTH, 77 | dt: TEST_DT, 78 | current_tick: 0, 79 | gravity_enabled: true, 80 | gravity: TEST_GRAVITY, 81 | }); 82 | update_stage.add_system(update_cells); 83 | // add particle to world 84 | let particle_id = world 85 | .spawn() 86 | .insert_bundle(( 87 | Position(Vec2::new(5.0, 5.0)), 88 | Velocity(Vec2::new(0.0, -1.0)), 89 | Mass(1.06), 90 | AffineMomentum(Mat2::from_cols( 91 | Vec2::new(-0.4838, 0.01124), 92 | Vec2::new(-0.0248, 0.169), 93 | )), 94 | ParticleTag, 95 | )) 96 | .id(); 97 | // iterate systems 98 | update_stage.run(&mut world); 99 | 100 | // particle position should not change 101 | let particle_position = world.get::(particle_id); 102 | assert_eq!(particle_position.unwrap().0, Vec2::new(5.0, 5.0)); 103 | //// particle velocity should not change. 104 | let particle_velocity = world.get::(particle_id); 105 | assert_eq!(particle_velocity.unwrap().0, Vec2::new(0.0, -1.0)); 106 | // particle affine momentum should not change 107 | let particle_momentum = world.get::(particle_id); 108 | // access col major 109 | assert_eq!(particle_momentum.unwrap().0.x_axis.x, -0.4838); 110 | assert_eq!(particle_momentum.unwrap().0.x_axis.y, 0.01124); 111 | assert_eq!(particle_momentum.unwrap().0.y_axis.x, -0.0248); 112 | assert_eq!(particle_momentum.unwrap().0.y_axis.y, 0.169); 113 | // access row major 114 | assert_eq!(particle_momentum.unwrap().0.row(0).x, -0.4838); 115 | assert_eq!(particle_momentum.unwrap().0.row(0).y, -0.0248); 116 | assert_eq!(particle_momentum.unwrap().0.row(1).x, 0.01124); 117 | assert_eq!(particle_momentum.unwrap().0.row(1).y, 0.169); 118 | 119 | //// local grid cells should be updated from particle. 120 | let gr = world.get_resource::().unwrap(); 121 | assert_eq!(gr.cells[44].mass, 0.265); 122 | assert_eq!(gr.cells[45].mass, 0.265); 123 | assert_eq!(gr.cells[46].mass, 0.0); 124 | assert_eq!(gr.cells[54].mass, 0.265); 125 | assert_eq!(gr.cells[55].mass, 0.265); 126 | assert_eq!(gr.cells[56].mass, 0.0); 127 | assert_eq!(gr.cells[64].mass, 0.0); 128 | assert_eq!(gr.cells[65].mass, 0.0); 129 | assert_eq!(gr.cells[66].mass, 0.0); 130 | assert_eq!(true, approx_equal(gr.cells[44].velocity.x, 0.0673895, 5)); 131 | assert_eq!(true, approx_equal(gr.cells[44].velocity.y, -0.2888818, 5)); 132 | assert_eq!(true, approx_equal(gr.cells[45].velocity.x, 0.0608175, 5)); 133 | assert_eq!(true, approx_equal(gr.cells[45].velocity.y, -0.2440968, 5)); 134 | assert_eq!(gr.cells[46].velocity, Vec2::new(0.0, 0.0)); 135 | assert_eq!(true, approx_equal(gr.cells[54].velocity.x, -0.0608175, 5)); 136 | assert_eq!(true, approx_equal(gr.cells[54].velocity.y, -0.2859032, 5)); 137 | assert_eq!(true, approx_equal(gr.cells[55].velocity.x, -0.0673895, 5)); 138 | assert_eq!(true, approx_equal(gr.cells[55].velocity.y, -0.2411182, 5)); 139 | assert_eq!(gr.cells[56].velocity, Vec2::new(0.0, 0.0)); 140 | assert_eq!(gr.cells[64].velocity, Vec2::new(0.0, 0.0)); 141 | assert_eq!(gr.cells[65].velocity, Vec2::new(0.0, 0.0)); 142 | assert_eq!(gr.cells[66].velocity, Vec2::new(0.0, 0.0)); 143 | } 144 | 145 | #[test] 146 | // in particles_to_grid system, a single particle in freefall should update momentum (stored as scaled velocity) of surrounding cells. 147 | fn test_particles_to_grid_iteration() { 148 | let mut world = World::default(); 149 | let mut update_stage = SystemStage::parallel(); 150 | // manually put some mass in the grid at particle location since previous steps not run 151 | let mut gr = Grid { 152 | cells: vec![ 153 | Cell { 154 | velocity: Vec2::ZERO, 155 | mass: 0.0, 156 | }; 157 | TEST_GRID_WIDTH * TEST_GRID_WIDTH, 158 | ], 159 | width: TEST_GRID_WIDTH, 160 | dt: TEST_DT, 161 | current_tick: 0, 162 | gravity_enabled: true, 163 | gravity: TEST_GRAVITY, 164 | }; 165 | let particle_cell_index = gr.index_at(5, 5); 166 | gr.cells[particle_cell_index].mass = 0.25; 167 | world.insert_resource(gr); 168 | update_stage.add_system(particles_to_grid); 169 | // add particle to world 170 | let particle_id = world 171 | .spawn() 172 | .insert_bundle(( 173 | Position(Vec2::new(5.0, 5.0)), 174 | Velocity(Vec2::new(0.0, -1.0)), 175 | Mass(1.06), 176 | RestDensity(4.), 177 | DynamicViscosity(0.1), 178 | EosStiffness(10.), 179 | EosPower(4.), 180 | AffineMomentum(Mat2::from_cols( 181 | Vec2::new(-0.4838, 0.01124), 182 | Vec2::new(-0.0248, 0.169), 183 | )), 184 | ParticleTag, 185 | )) 186 | .id(); 187 | 188 | // iterate systems 189 | update_stage.run(&mut world); 190 | 191 | // particle position should not change 192 | let particle_position = world.get::(particle_id); 193 | assert_eq!(particle_position.unwrap().0, Vec2::new(5.0, 5.0)); 194 | //// particle velocity should not change. 195 | let particle_velocity = world.get::(particle_id); 196 | assert_eq!(particle_velocity.unwrap().0, Vec2::new(0.0, -1.0)); 197 | // particle affine momentum should not change 198 | let particle_momentum = world.get::(particle_id); 199 | assert_eq!(particle_momentum.unwrap().0.x_axis.x, -0.4838); 200 | assert_eq!(particle_momentum.unwrap().0.x_axis.y, 0.01124); 201 | assert_eq!(particle_momentum.unwrap().0.y_axis.x, -0.0248); 202 | assert_eq!(particle_momentum.unwrap().0.y_axis.y, 0.169); 203 | 204 | //// get grid cells. 205 | let gr = world.get_resource::().unwrap(); 206 | 207 | //// local grid cells momentum (as velocity) should be updated from particle. 208 | assert_eq!(true, approx_equal(gr.cells[44].velocity.x, 0.042623872, 5)); 209 | assert_eq!(true, approx_equal(gr.cells[44].velocity.y, 0.097981312, 5)); 210 | assert_eq!(true, approx_equal(gr.cells[45].velocity.x, 0.044923648, 5)); 211 | assert_eq!(true, approx_equal(gr.cells[45].velocity.y, -0.100281088, 5)); 212 | assert_eq!(gr.cells[46].velocity, Vec2::new(0.0, 0.0)); 213 | assert_eq!(true, approx_equal(gr.cells[54].velocity.x, -0.044923648, 5)); 214 | assert_eq!(true, approx_equal(gr.cells[54].velocity.y, 0.100281088, 5)); 215 | assert_eq!(true, approx_equal(gr.cells[55].velocity.x, -0.042623872, 5)); 216 | assert_eq!(true, approx_equal(gr.cells[55].velocity.y, -0.097981312, 5)); 217 | assert_eq!(gr.cells[56].velocity, Vec2::new(0.0, 0.0)); 218 | assert_eq!(gr.cells[64].velocity, Vec2::new(0.0, 0.0)); 219 | assert_eq!(gr.cells[65].velocity, Vec2::new(0.0, 0.0)); 220 | assert_eq!(gr.cells[66].velocity, Vec2::new(0.0, 0.0)); 221 | } 222 | 223 | #[test] 224 | // in grid_to_particles system, a couple of particles should be effected by surrounding cells. 225 | fn test_grid_to_particles_iteration() { 226 | let mut world = World::default(); 227 | let mut update_stage = SystemStage::parallel(); 228 | let mut gr = Grid { 229 | cells: vec![ 230 | Cell { 231 | velocity: Vec2::ZERO, 232 | mass: 0.0, 233 | }; 234 | TEST_GRID_WIDTH * TEST_GRID_WIDTH, 235 | ], 236 | width: TEST_GRID_WIDTH, 237 | dt: TEST_DT, 238 | current_tick: 0, 239 | gravity_enabled: true, 240 | gravity: TEST_GRAVITY, 241 | }; 242 | 243 | let particle_1_id = world 244 | .spawn() 245 | .insert_bundle(( 246 | Position(Vec2::new(5.2, 5.3)), 247 | Velocity(Vec2::new(3.3, 3.0)), 248 | Mass(1.06), 249 | AffineMomentum(Mat2::from_cols( 250 | Vec2::new(-0.4838, 0.01124), 251 | Vec2::new(-0.0248, 0.169), 252 | )), 253 | ParticleTag, 254 | )) 255 | .id(); 256 | 257 | let particle_2_id = world 258 | .spawn() 259 | .insert_bundle(( 260 | Position(Vec2::new(6.6, 5.9)), 261 | Velocity(Vec2::new(1.2, -1.0)), 262 | Mass(1.23), 263 | AffineMomentum(Mat2::from_cols( 264 | Vec2::new(-0.4838, 0.01124), 265 | Vec2::new(-0.0248, 0.169), 266 | )), 267 | ParticleTag, 268 | )) 269 | .id(); 270 | 271 | let particle_1_cell_index = gr.index_at(5, 5); 272 | let particle_2_cell_index = gr.index_at(6, 5); 273 | 274 | // manually put some velocity + mass in the grid at particle location since other systems did not run 275 | gr.cells[particle_1_cell_index].velocity = Vec2::new(1.0, 1.0); 276 | gr.cells[particle_1_cell_index].mass = 0.25; 277 | 278 | gr.cells[particle_2_cell_index].velocity = Vec2::new(2.0, 2.0); 279 | gr.cells[particle_2_cell_index].mass = 0.25; 280 | 281 | world.insert_resource(gr); 282 | update_stage.add_system(grid_to_particles); 283 | 284 | // iterate systems 285 | update_stage.run(&mut world); 286 | 287 | // check particles 288 | let particle_1_position = world.get::(particle_1_id); 289 | let particle_1_velocity = world.get::(particle_1_id); 290 | let particle_1_mass = world.get::(particle_1_id); 291 | let particle_1_affine_momentum = world.get::(particle_1_id); 292 | let particle_2_position = world.get::(particle_2_id); 293 | let particle_2_velocity = world.get::(particle_2_id); 294 | let particle_2_mass = world.get::(particle_2_id); 295 | let particle_2_affine_momentum = world.get::(particle_2_id); 296 | 297 | assert_eq!( 298 | true, 299 | approx_equal(particle_1_position.unwrap().0.x, 5.2497, 3) 300 | ); 301 | assert_eq!( 302 | true, 303 | approx_equal(particle_1_position.unwrap().0.y, 5.3496, 3) 304 | ); 305 | assert_eq!( 306 | true, 307 | approx_equal(particle_1_velocity.unwrap().0.x, 0.497, 3) 308 | ); 309 | assert_eq!( 310 | true, 311 | approx_equal(particle_1_velocity.unwrap().0.y, 0.497, 3) 312 | ); 313 | assert_eq!(particle_1_mass.unwrap().0, 1.06); 314 | assert_eq!( 315 | true, 316 | approx_equal(particle_1_affine_momentum.unwrap().0.x_axis.x, 0.71, 3) 317 | ); 318 | assert_eq!( 319 | true, 320 | approx_equal(particle_1_affine_momentum.unwrap().0.x_axis.y, 0.71, 3) 321 | ); 322 | assert_eq!( 323 | true, 324 | approx_equal(particle_1_affine_momentum.unwrap().0.y_axis.x, 0.3976, 3) 325 | ); 326 | assert_eq!( 327 | true, 328 | approx_equal(particle_1_affine_momentum.unwrap().0.y_axis.y, 0.3976, 3) 329 | ); 330 | 331 | assert_eq!( 332 | true, 333 | approx_equal(particle_2_position.unwrap().0.x, 6.692, 3) 334 | ); 335 | assert_eq!( 336 | true, 337 | approx_equal(particle_2_position.unwrap().0.y, 5.992, 3) 338 | ); 339 | assert_eq!( 340 | true, 341 | approx_equal(particle_2_velocity.unwrap().0.x, -0.69135, 3) 342 | ); 343 | assert_eq!( 344 | true, 345 | approx_equal(particle_2_velocity.unwrap().0.y, 0.00704, 3) 346 | ); 347 | assert_eq!(particle_2_mass.unwrap().0, 1.23); 348 | assert_eq!( 349 | true, 350 | approx_equal(particle_2_affine_momentum.unwrap().0.x_axis.x, -0.557, 3) 351 | ); 352 | assert_eq!( 353 | true, 354 | approx_equal(particle_2_affine_momentum.unwrap().0.x_axis.y, -0.557, 3) 355 | ); 356 | assert_eq!( 357 | true, 358 | approx_equal(particle_2_affine_momentum.unwrap().0.y_axis.x, -1.47264, 3) 359 | ); 360 | assert_eq!( 361 | true, 362 | approx_equal(particle_2_affine_momentum.unwrap().0.y_axis.y, -1.47264, 3) 363 | ); 364 | } 365 | 366 | #[test] 367 | // reset_grid should zero out the cells 368 | fn test_reset_grid() { 369 | let mut gr = Grid { 370 | cells: vec![ 371 | Cell { 372 | velocity: Vec2::ZERO, 373 | mass: 0.0, 374 | }; 375 | TEST_GRID_WIDTH * TEST_GRID_WIDTH, 376 | ], 377 | width: TEST_GRID_WIDTH, 378 | dt: TEST_DT, 379 | current_tick: 0, 380 | gravity_enabled: true, 381 | gravity: TEST_GRAVITY, 382 | }; 383 | gr.cells[7].mass = 0.25; 384 | gr.cells[7].velocity = Vec2::new(1.2, 2.3); 385 | 386 | gr.reset(); 387 | 388 | assert_eq!(gr.cells[7].mass, 0.0); 389 | assert_eq!(gr.cells[7].velocity.x, 0.0); 390 | assert_eq!(gr.cells[7].velocity.y, 0.0); 391 | } 392 | 393 | #[test] 394 | // update_grid should adjust particle velocity and apply boundary conditions 395 | fn test_update_grid() { 396 | let mut gr = Grid { 397 | cells: vec![ 398 | Cell { 399 | velocity: Vec2::ZERO, 400 | mass: 0.0, 401 | }; 402 | TEST_GRID_WIDTH * TEST_GRID_WIDTH, 403 | ], 404 | width: TEST_GRID_WIDTH, 405 | dt: TEST_DT, 406 | current_tick: 0, 407 | gravity_enabled: true, 408 | gravity: TEST_GRAVITY, 409 | }; 410 | 411 | // add border cell with mass and velocity 412 | let border_cell_index = gr.index_at(3, 0); 413 | gr.cells[border_cell_index] = Cell { 414 | velocity: Vec2::new(2.2, -2.4), 415 | mass: 1.17171717, 416 | }; 417 | 418 | // add middle cell with mass and velocity 419 | let middle_cell_index = gr.index_at(5, 5); 420 | gr.cells[middle_cell_index] = Cell { 421 | velocity: Vec2::new(3.7333, -1.111), 422 | mass: 3.333, 423 | }; 424 | 425 | // apply grid update 426 | gr.update(); 427 | 428 | // border cell should have updated velocity and -y velocity cancelled 429 | assert_eq!( 430 | true, 431 | approx_equal(gr.cells[border_cell_index].velocity.x, 1.8757, 5) 432 | ); 433 | assert_eq!( 434 | true, 435 | approx_equal(gr.cells[border_cell_index].velocity.y, 0.0, 5) 436 | ); 437 | assert_eq!(gr.cells[border_cell_index].mass, 1.17171717); 438 | 439 | // middle cell should have updated velocity 440 | assert_eq!( 441 | true, 442 | approx_equal(gr.cells[middle_cell_index].velocity.x, 1.120102, 5) 443 | ); 444 | assert_eq!( 445 | true, 446 | approx_equal(gr.cells[middle_cell_index].velocity.y, -0.36333, 5) 447 | ); 448 | assert_eq!(gr.cells[middle_cell_index].mass, 3.333); 449 | } 450 | } 451 | 452 | fn mat2_equal(a: Mat2, b: Mat2, dp: u8) -> bool { 453 | vec2_equal(a.x_axis, b.x_axis, dp) && vec2_equal(a.y_axis, b.y_axis, dp) 454 | } 455 | 456 | fn vec2_equal(a: Vec2, b: Vec2, dp: u8) -> bool { 457 | approx_equal(a.x, b.x, dp) && approx_equal(a.y, b.y, dp) 458 | } 459 | 460 | fn approx_equal(a: f32, b: f32, dp: u8) -> bool { 461 | let p = 10f32.powi(-(dp as i32)); 462 | (a - b).abs() < p 463 | } 464 | -------------------------------------------------------------------------------- /src/world.rs: -------------------------------------------------------------------------------- 1 | use super::defaults::*; 2 | 3 | #[derive(Copy, Clone)] 4 | pub(super) struct WorldState { 5 | pub(super) dt: f32, 6 | pub(super) gravity: f32, 7 | pub(super) gravity_enabled: bool, 8 | pub(super) current_tick: usize, 9 | } 10 | 11 | impl WorldState { 12 | pub(super) fn toggle_gravity(&mut self) { 13 | self.gravity_enabled = !self.gravity_enabled; 14 | } 15 | 16 | pub(super) fn default() -> WorldState { 17 | WorldState { 18 | dt: DEFAULT_DT, 19 | gravity: DEFAULT_GRAVITY, 20 | gravity_enabled: true, 21 | current_tick: 0, 22 | } 23 | } 24 | 25 | pub(super) fn update(&mut self) { 26 | self.current_tick += 1; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/zoom.rs: -------------------------------------------------------------------------------- 1 | // not needed until resizeable. 2 | //fn set_zoom_from_window_size( 3 | // camera: Query, 4 | // resize_event: Res>, 5 | //) { 6 | // let mut reader = resize_event.get_reader(); 7 | // // todo calculate zoom and apply it to world. 8 | // 9 | // // zoom == window_width / grid_width 10 | // let wnd = wnds.get_primary().unwrap(); 11 | // let size = Vec2::new(wnd.width() as f32, wnd.height() as f32); 12 | // let scale = wnd.width() / grid.width as f32; // todo in response to events. 13 | // 14 | // cb.transform = Transform::from_translation(Vec3::new( 15 | // size.x / (scale * 2.0), 16 | // size.y / (scale * 2.0), 17 | // 0.0, 18 | // )); 19 | // cb.orthographic_projection.scale = 1.0 / scale; 20 | // commands.spawn_bundle(cb); 21 | //} 22 | --------------------------------------------------------------------------------