├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src ├── boid.rs └── main.rs /.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_rasterizer" 7 | version = "0.1.5" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" 10 | 11 | [[package]] 12 | name = "adler" 13 | version = "1.0.2" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 16 | 17 | [[package]] 18 | name = "adler32" 19 | version = "1.2.0" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" 22 | 23 | [[package]] 24 | name = "ahash" 25 | version = "0.7.6" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 28 | dependencies = [ 29 | "getrandom 0.2.6", 30 | "once_cell", 31 | "version_check", 32 | ] 33 | 34 | [[package]] 35 | name = "andrew" 36 | version = "0.3.1" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" 39 | dependencies = [ 40 | "bitflags", 41 | "rusttype 0.9.2", 42 | "walkdir", 43 | "xdg", 44 | "xml-rs", 45 | ] 46 | 47 | [[package]] 48 | name = "approx" 49 | version = "0.3.2" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" 52 | dependencies = [ 53 | "num-traits", 54 | ] 55 | 56 | [[package]] 57 | name = "arrayvec" 58 | version = "0.5.2" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 61 | 62 | [[package]] 63 | name = "arrayvec" 64 | version = "0.7.2" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 67 | 68 | [[package]] 69 | name = "ash" 70 | version = "0.33.3+1.2.191" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219" 73 | dependencies = [ 74 | "libloading 0.7.3", 75 | ] 76 | 77 | [[package]] 78 | name = "autocfg" 79 | version = "1.1.0" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 82 | 83 | [[package]] 84 | name = "bit-set" 85 | version = "0.5.2" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" 88 | dependencies = [ 89 | "bit-vec", 90 | ] 91 | 92 | [[package]] 93 | name = "bit-vec" 94 | version = "0.6.3" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 97 | 98 | [[package]] 99 | name = "bitflags" 100 | version = "1.3.2" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 103 | 104 | [[package]] 105 | name = "block" 106 | version = "0.1.6" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" 109 | 110 | [[package]] 111 | name = "bumpalo" 112 | version = "3.9.1" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" 115 | 116 | [[package]] 117 | name = "bytemuck" 118 | version = "1.9.1" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" 121 | 122 | [[package]] 123 | name = "byteorder" 124 | version = "1.4.3" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 127 | 128 | [[package]] 129 | name = "calloop" 130 | version = "0.6.5" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" 133 | dependencies = [ 134 | "log", 135 | "nix 0.18.0", 136 | ] 137 | 138 | [[package]] 139 | name = "cc" 140 | version = "1.0.73" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 143 | 144 | [[package]] 145 | name = "cfg-if" 146 | version = "0.1.10" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 149 | 150 | [[package]] 151 | name = "cfg-if" 152 | version = "1.0.0" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 155 | 156 | [[package]] 157 | name = "cfg_aliases" 158 | version = "0.1.1" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" 161 | 162 | [[package]] 163 | name = "cocoa" 164 | version = "0.24.0" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" 167 | dependencies = [ 168 | "bitflags", 169 | "block", 170 | "cocoa-foundation", 171 | "core-foundation 0.9.3", 172 | "core-graphics 0.22.3", 173 | "foreign-types", 174 | "libc", 175 | "objc", 176 | ] 177 | 178 | [[package]] 179 | name = "cocoa-foundation" 180 | version = "0.1.0" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" 183 | dependencies = [ 184 | "bitflags", 185 | "block", 186 | "core-foundation 0.9.3", 187 | "core-graphics-types", 188 | "foreign-types", 189 | "libc", 190 | "objc", 191 | ] 192 | 193 | [[package]] 194 | name = "codespan-reporting" 195 | version = "0.11.1" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 198 | dependencies = [ 199 | "termcolor", 200 | "unicode-width", 201 | ] 202 | 203 | [[package]] 204 | name = "color_quant" 205 | version = "1.1.0" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" 208 | 209 | [[package]] 210 | name = "copyless" 211 | version = "0.1.5" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" 214 | 215 | [[package]] 216 | name = "core-foundation" 217 | version = "0.7.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 220 | dependencies = [ 221 | "core-foundation-sys 0.7.0", 222 | "libc", 223 | ] 224 | 225 | [[package]] 226 | name = "core-foundation" 227 | version = "0.9.3" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 230 | dependencies = [ 231 | "core-foundation-sys 0.8.3", 232 | "libc", 233 | ] 234 | 235 | [[package]] 236 | name = "core-foundation-sys" 237 | version = "0.7.0" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 240 | 241 | [[package]] 242 | name = "core-foundation-sys" 243 | version = "0.8.3" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 246 | 247 | [[package]] 248 | name = "core-graphics" 249 | version = "0.19.2" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" 252 | dependencies = [ 253 | "bitflags", 254 | "core-foundation 0.7.0", 255 | "foreign-types", 256 | "libc", 257 | ] 258 | 259 | [[package]] 260 | name = "core-graphics" 261 | version = "0.22.3" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" 264 | dependencies = [ 265 | "bitflags", 266 | "core-foundation 0.9.3", 267 | "core-graphics-types", 268 | "foreign-types", 269 | "libc", 270 | ] 271 | 272 | [[package]] 273 | name = "core-graphics-types" 274 | version = "0.1.1" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" 277 | dependencies = [ 278 | "bitflags", 279 | "core-foundation 0.9.3", 280 | "foreign-types", 281 | "libc", 282 | ] 283 | 284 | [[package]] 285 | name = "core-video-sys" 286 | version = "0.1.4" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" 289 | dependencies = [ 290 | "cfg-if 0.1.10", 291 | "core-foundation-sys 0.7.0", 292 | "core-graphics 0.19.2", 293 | "libc", 294 | "objc", 295 | ] 296 | 297 | [[package]] 298 | name = "crc32fast" 299 | version = "1.3.2" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 302 | dependencies = [ 303 | "cfg-if 1.0.0", 304 | ] 305 | 306 | [[package]] 307 | name = "crossbeam" 308 | version = "0.8.1" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" 311 | dependencies = [ 312 | "cfg-if 1.0.0", 313 | "crossbeam-channel", 314 | "crossbeam-deque 0.8.1", 315 | "crossbeam-epoch 0.9.8", 316 | "crossbeam-queue", 317 | "crossbeam-utils 0.8.8", 318 | ] 319 | 320 | [[package]] 321 | name = "crossbeam-channel" 322 | version = "0.5.4" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" 325 | dependencies = [ 326 | "cfg-if 1.0.0", 327 | "crossbeam-utils 0.8.8", 328 | ] 329 | 330 | [[package]] 331 | name = "crossbeam-deque" 332 | version = "0.7.4" 333 | source = "registry+https://github.com/rust-lang/crates.io-index" 334 | checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" 335 | dependencies = [ 336 | "crossbeam-epoch 0.8.2", 337 | "crossbeam-utils 0.7.2", 338 | "maybe-uninit", 339 | ] 340 | 341 | [[package]] 342 | name = "crossbeam-deque" 343 | version = "0.8.1" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" 346 | dependencies = [ 347 | "cfg-if 1.0.0", 348 | "crossbeam-epoch 0.9.8", 349 | "crossbeam-utils 0.8.8", 350 | ] 351 | 352 | [[package]] 353 | name = "crossbeam-epoch" 354 | version = "0.8.2" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" 357 | dependencies = [ 358 | "autocfg", 359 | "cfg-if 0.1.10", 360 | "crossbeam-utils 0.7.2", 361 | "lazy_static", 362 | "maybe-uninit", 363 | "memoffset 0.5.6", 364 | "scopeguard", 365 | ] 366 | 367 | [[package]] 368 | name = "crossbeam-epoch" 369 | version = "0.9.8" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" 372 | dependencies = [ 373 | "autocfg", 374 | "cfg-if 1.0.0", 375 | "crossbeam-utils 0.8.8", 376 | "lazy_static", 377 | "memoffset 0.6.5", 378 | "scopeguard", 379 | ] 380 | 381 | [[package]] 382 | name = "crossbeam-queue" 383 | version = "0.3.5" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" 386 | dependencies = [ 387 | "cfg-if 1.0.0", 388 | "crossbeam-utils 0.8.8", 389 | ] 390 | 391 | [[package]] 392 | name = "crossbeam-utils" 393 | version = "0.7.2" 394 | source = "registry+https://github.com/rust-lang/crates.io-index" 395 | checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" 396 | dependencies = [ 397 | "autocfg", 398 | "cfg-if 0.1.10", 399 | "lazy_static", 400 | ] 401 | 402 | [[package]] 403 | name = "crossbeam-utils" 404 | version = "0.8.8" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" 407 | dependencies = [ 408 | "cfg-if 1.0.0", 409 | "lazy_static", 410 | ] 411 | 412 | [[package]] 413 | name = "cty" 414 | version = "0.2.2" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" 417 | 418 | [[package]] 419 | name = "d3d12" 420 | version = "0.4.1" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" 423 | dependencies = [ 424 | "bitflags", 425 | "libloading 0.7.3", 426 | "winapi", 427 | ] 428 | 429 | [[package]] 430 | name = "darling" 431 | version = "0.10.2" 432 | source = "registry+https://github.com/rust-lang/crates.io-index" 433 | checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" 434 | dependencies = [ 435 | "darling_core", 436 | "darling_macro", 437 | ] 438 | 439 | [[package]] 440 | name = "darling_core" 441 | version = "0.10.2" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" 444 | dependencies = [ 445 | "fnv", 446 | "ident_case", 447 | "proc-macro2", 448 | "quote", 449 | "strsim", 450 | "syn", 451 | ] 452 | 453 | [[package]] 454 | name = "darling_macro" 455 | version = "0.10.2" 456 | source = "registry+https://github.com/rust-lang/crates.io-index" 457 | checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" 458 | dependencies = [ 459 | "darling_core", 460 | "quote", 461 | "syn", 462 | ] 463 | 464 | [[package]] 465 | name = "deflate" 466 | version = "0.8.6" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" 469 | dependencies = [ 470 | "adler32", 471 | "byteorder", 472 | ] 473 | 474 | [[package]] 475 | name = "dirs" 476 | version = "4.0.0" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" 479 | dependencies = [ 480 | "dirs-sys", 481 | ] 482 | 483 | [[package]] 484 | name = "dirs-sys" 485 | version = "0.3.7" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 488 | dependencies = [ 489 | "libc", 490 | "redox_users", 491 | "winapi", 492 | ] 493 | 494 | [[package]] 495 | name = "dispatch" 496 | version = "0.2.0" 497 | source = "registry+https://github.com/rust-lang/crates.io-index" 498 | checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" 499 | 500 | [[package]] 501 | name = "dlib" 502 | version = "0.4.2" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" 505 | dependencies = [ 506 | "libloading 0.6.7", 507 | ] 508 | 509 | [[package]] 510 | name = "dlib" 511 | version = "0.5.0" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" 514 | dependencies = [ 515 | "libloading 0.7.3", 516 | ] 517 | 518 | [[package]] 519 | name = "downcast-rs" 520 | version = "1.2.0" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" 523 | 524 | [[package]] 525 | name = "either" 526 | version = "1.6.1" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" 529 | 530 | [[package]] 531 | name = "euclid" 532 | version = "0.22.7" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | checksum = "b52c2ef4a78da0ba68fbe1fd920627411096d2ac478f7f4c9f3a54ba6705bade" 535 | dependencies = [ 536 | "num-traits", 537 | ] 538 | 539 | [[package]] 540 | name = "find_folder" 541 | version = "0.3.0" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "9f6d018fb95a0b59f854aed68ecd96ce2b80af7911b92b1fed3c4b1fa516b91b" 544 | 545 | [[package]] 546 | name = "float_next_after" 547 | version = "0.1.5" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "4fc612c5837986b7104a87a0df74a5460931f1c5274be12f8d0f40aa2f30d632" 550 | dependencies = [ 551 | "num-traits", 552 | ] 553 | 554 | [[package]] 555 | name = "flocking_simulation" 556 | version = "0.1.0" 557 | dependencies = [ 558 | "nannou", 559 | ] 560 | 561 | [[package]] 562 | name = "fnv" 563 | version = "1.0.7" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 566 | 567 | [[package]] 568 | name = "foreign-types" 569 | version = "0.3.2" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 572 | dependencies = [ 573 | "foreign-types-shared", 574 | ] 575 | 576 | [[package]] 577 | name = "foreign-types-shared" 578 | version = "0.1.1" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 581 | 582 | [[package]] 583 | name = "futures" 584 | version = "0.3.21" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" 587 | dependencies = [ 588 | "futures-channel", 589 | "futures-core", 590 | "futures-executor", 591 | "futures-io", 592 | "futures-sink", 593 | "futures-task", 594 | "futures-util", 595 | ] 596 | 597 | [[package]] 598 | name = "futures-channel" 599 | version = "0.3.21" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" 602 | dependencies = [ 603 | "futures-core", 604 | "futures-sink", 605 | ] 606 | 607 | [[package]] 608 | name = "futures-core" 609 | version = "0.3.21" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 612 | 613 | [[package]] 614 | name = "futures-executor" 615 | version = "0.3.21" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" 618 | dependencies = [ 619 | "futures-core", 620 | "futures-task", 621 | "futures-util", 622 | "num_cpus", 623 | ] 624 | 625 | [[package]] 626 | name = "futures-io" 627 | version = "0.3.21" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" 630 | 631 | [[package]] 632 | name = "futures-macro" 633 | version = "0.3.21" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" 636 | dependencies = [ 637 | "proc-macro2", 638 | "quote", 639 | "syn", 640 | ] 641 | 642 | [[package]] 643 | name = "futures-sink" 644 | version = "0.3.21" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" 647 | 648 | [[package]] 649 | name = "futures-task" 650 | version = "0.3.21" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" 653 | 654 | [[package]] 655 | name = "futures-util" 656 | version = "0.3.21" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" 659 | dependencies = [ 660 | "futures-channel", 661 | "futures-core", 662 | "futures-io", 663 | "futures-macro", 664 | "futures-sink", 665 | "futures-task", 666 | "memchr", 667 | "pin-project-lite", 668 | "pin-utils", 669 | "slab", 670 | ] 671 | 672 | [[package]] 673 | name = "fxhash" 674 | version = "0.2.1" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" 677 | dependencies = [ 678 | "byteorder", 679 | ] 680 | 681 | [[package]] 682 | name = "getrandom" 683 | version = "0.1.16" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 686 | dependencies = [ 687 | "cfg-if 1.0.0", 688 | "libc", 689 | "wasi 0.9.0+wasi-snapshot-preview1", 690 | ] 691 | 692 | [[package]] 693 | name = "getrandom" 694 | version = "0.2.6" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" 697 | dependencies = [ 698 | "cfg-if 1.0.0", 699 | "libc", 700 | "wasi 0.10.2+wasi-snapshot-preview1", 701 | ] 702 | 703 | [[package]] 704 | name = "gif" 705 | version = "0.11.3" 706 | source = "registry+https://github.com/rust-lang/crates.io-index" 707 | checksum = "c3a7187e78088aead22ceedeee99779455b23fc231fe13ec443f99bb71694e5b" 708 | dependencies = [ 709 | "color_quant", 710 | "weezl", 711 | ] 712 | 713 | [[package]] 714 | name = "glam" 715 | version = "0.17.3" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | checksum = "e01732b97afd8508eee3333a541b9f7610f454bb818669e66e90f5f57c93a776" 718 | dependencies = [ 719 | "num-traits", 720 | "rand 0.8.5", 721 | "serde", 722 | ] 723 | 724 | [[package]] 725 | name = "glow" 726 | version = "0.11.2" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" 729 | dependencies = [ 730 | "js-sys", 731 | "slotmap", 732 | "wasm-bindgen", 733 | "web-sys", 734 | ] 735 | 736 | [[package]] 737 | name = "gpu-alloc" 738 | version = "0.5.3" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d" 741 | dependencies = [ 742 | "bitflags", 743 | "gpu-alloc-types", 744 | ] 745 | 746 | [[package]] 747 | name = "gpu-alloc-types" 748 | version = "0.2.0" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" 751 | dependencies = [ 752 | "bitflags", 753 | ] 754 | 755 | [[package]] 756 | name = "gpu-descriptor" 757 | version = "0.2.2" 758 | source = "registry+https://github.com/rust-lang/crates.io-index" 759 | checksum = "a538f217be4d405ff4719a283ca68323cc2384003eca5baaa87501e821c81dda" 760 | dependencies = [ 761 | "bitflags", 762 | "gpu-descriptor-types", 763 | "hashbrown", 764 | ] 765 | 766 | [[package]] 767 | name = "gpu-descriptor-types" 768 | version = "0.1.1" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" 771 | dependencies = [ 772 | "bitflags", 773 | ] 774 | 775 | [[package]] 776 | name = "hashbrown" 777 | version = "0.11.2" 778 | source = "registry+https://github.com/rust-lang/crates.io-index" 779 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 780 | dependencies = [ 781 | "ahash", 782 | ] 783 | 784 | [[package]] 785 | name = "hermit-abi" 786 | version = "0.1.19" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 789 | dependencies = [ 790 | "libc", 791 | ] 792 | 793 | [[package]] 794 | name = "hexf-parse" 795 | version = "0.2.1" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" 798 | 799 | [[package]] 800 | name = "ident_case" 801 | version = "1.0.1" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 804 | 805 | [[package]] 806 | name = "image" 807 | version = "0.23.14" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" 810 | dependencies = [ 811 | "bytemuck", 812 | "byteorder", 813 | "color_quant", 814 | "gif", 815 | "jpeg-decoder", 816 | "num-iter", 817 | "num-rational", 818 | "num-traits", 819 | "png", 820 | "scoped_threadpool", 821 | "tiff", 822 | ] 823 | 824 | [[package]] 825 | name = "indexmap" 826 | version = "1.8.1" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" 829 | dependencies = [ 830 | "autocfg", 831 | "hashbrown", 832 | ] 833 | 834 | [[package]] 835 | name = "inplace_it" 836 | version = "0.3.3" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" 839 | 840 | [[package]] 841 | name = "instant" 842 | version = "0.1.12" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 845 | dependencies = [ 846 | "cfg-if 1.0.0", 847 | "js-sys", 848 | "wasm-bindgen", 849 | "web-sys", 850 | ] 851 | 852 | [[package]] 853 | name = "itoa" 854 | version = "1.0.1" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" 857 | 858 | [[package]] 859 | name = "jni-sys" 860 | version = "0.3.0" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" 863 | 864 | [[package]] 865 | name = "jpeg-decoder" 866 | version = "0.1.22" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" 869 | dependencies = [ 870 | "rayon", 871 | ] 872 | 873 | [[package]] 874 | name = "js-sys" 875 | version = "0.3.57" 876 | source = "registry+https://github.com/rust-lang/crates.io-index" 877 | checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" 878 | dependencies = [ 879 | "wasm-bindgen", 880 | ] 881 | 882 | [[package]] 883 | name = "khronos-egl" 884 | version = "4.1.0" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" 887 | dependencies = [ 888 | "libc", 889 | "libloading 0.7.3", 890 | ] 891 | 892 | [[package]] 893 | name = "lazy_static" 894 | version = "1.4.0" 895 | source = "registry+https://github.com/rust-lang/crates.io-index" 896 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 897 | 898 | [[package]] 899 | name = "libc" 900 | version = "0.2.125" 901 | source = "registry+https://github.com/rust-lang/crates.io-index" 902 | checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" 903 | 904 | [[package]] 905 | name = "libloading" 906 | version = "0.6.7" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" 909 | dependencies = [ 910 | "cfg-if 1.0.0", 911 | "winapi", 912 | ] 913 | 914 | [[package]] 915 | name = "libloading" 916 | version = "0.7.3" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" 919 | dependencies = [ 920 | "cfg-if 1.0.0", 921 | "winapi", 922 | ] 923 | 924 | [[package]] 925 | name = "linked-hash-map" 926 | version = "0.5.4" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" 929 | 930 | [[package]] 931 | name = "lock_api" 932 | version = "0.4.7" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" 935 | dependencies = [ 936 | "autocfg", 937 | "scopeguard", 938 | ] 939 | 940 | [[package]] 941 | name = "log" 942 | version = "0.4.17" 943 | source = "registry+https://github.com/rust-lang/crates.io-index" 944 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 945 | dependencies = [ 946 | "cfg-if 1.0.0", 947 | ] 948 | 949 | [[package]] 950 | name = "lyon" 951 | version = "0.17.10" 952 | source = "registry+https://github.com/rust-lang/crates.io-index" 953 | checksum = "cf0510ed5e3e2fb80f3db2061ef5ca92d87bfda1a624bb1eacf3bd50226e4cbb" 954 | dependencies = [ 955 | "lyon_algorithms", 956 | "lyon_tessellation", 957 | ] 958 | 959 | [[package]] 960 | name = "lyon_algorithms" 961 | version = "0.17.7" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "8037f716541ba0d84d3de05c0069f8068baf73990d55980558b84d944c8a244a" 964 | dependencies = [ 965 | "lyon_path", 966 | "sid", 967 | ] 968 | 969 | [[package]] 970 | name = "lyon_geom" 971 | version = "0.17.6" 972 | source = "registry+https://github.com/rust-lang/crates.io-index" 973 | checksum = "ce99ce77c22bfd8f39a95b9c749dffbfc3e2491ea30c874764c801a8b1485489" 974 | dependencies = [ 975 | "arrayvec 0.5.2", 976 | "euclid", 977 | "num-traits", 978 | ] 979 | 980 | [[package]] 981 | name = "lyon_path" 982 | version = "0.17.7" 983 | source = "registry+https://github.com/rust-lang/crates.io-index" 984 | checksum = "5b0a59fdf767ca0d887aa61d1b48d4bbf6a124c1a45503593f7d38ab945bfbc0" 985 | dependencies = [ 986 | "lyon_geom", 987 | ] 988 | 989 | [[package]] 990 | name = "lyon_tessellation" 991 | version = "0.17.10" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "7230e08dd0638048e46f387f255dbe7a7344a3e6705beab53242b5af25635760" 994 | dependencies = [ 995 | "float_next_after", 996 | "lyon_path", 997 | ] 998 | 999 | [[package]] 1000 | name = "malloc_buf" 1001 | version = "0.0.6" 1002 | source = "registry+https://github.com/rust-lang/crates.io-index" 1003 | checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" 1004 | dependencies = [ 1005 | "libc", 1006 | ] 1007 | 1008 | [[package]] 1009 | name = "maybe-uninit" 1010 | version = "2.0.0" 1011 | source = "registry+https://github.com/rust-lang/crates.io-index" 1012 | checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" 1013 | 1014 | [[package]] 1015 | name = "memchr" 1016 | version = "2.5.0" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 1019 | 1020 | [[package]] 1021 | name = "memmap2" 1022 | version = "0.1.0" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" 1025 | dependencies = [ 1026 | "libc", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "memoffset" 1031 | version = "0.5.6" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" 1034 | dependencies = [ 1035 | "autocfg", 1036 | ] 1037 | 1038 | [[package]] 1039 | name = "memoffset" 1040 | version = "0.6.5" 1041 | source = "registry+https://github.com/rust-lang/crates.io-index" 1042 | checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" 1043 | dependencies = [ 1044 | "autocfg", 1045 | ] 1046 | 1047 | [[package]] 1048 | name = "metal" 1049 | version = "0.23.1" 1050 | source = "registry+https://github.com/rust-lang/crates.io-index" 1051 | checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084" 1052 | dependencies = [ 1053 | "bitflags", 1054 | "block", 1055 | "core-graphics-types", 1056 | "foreign-types", 1057 | "log", 1058 | "objc", 1059 | ] 1060 | 1061 | [[package]] 1062 | name = "minimal-lexical" 1063 | version = "0.2.1" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 1066 | 1067 | [[package]] 1068 | name = "miniz_oxide" 1069 | version = "0.3.7" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" 1072 | dependencies = [ 1073 | "adler32", 1074 | ] 1075 | 1076 | [[package]] 1077 | name = "miniz_oxide" 1078 | version = "0.4.4" 1079 | source = "registry+https://github.com/rust-lang/crates.io-index" 1080 | checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" 1081 | dependencies = [ 1082 | "adler", 1083 | "autocfg", 1084 | ] 1085 | 1086 | [[package]] 1087 | name = "mio" 1088 | version = "0.7.14" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" 1091 | dependencies = [ 1092 | "libc", 1093 | "log", 1094 | "miow", 1095 | "ntapi", 1096 | "winapi", 1097 | ] 1098 | 1099 | [[package]] 1100 | name = "mio-misc" 1101 | version = "1.2.2" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "b47412f3a52115b936ff2a229b803498c7b4d332adeb87c2f1498c9da54c398c" 1104 | dependencies = [ 1105 | "crossbeam", 1106 | "crossbeam-queue", 1107 | "log", 1108 | "mio", 1109 | ] 1110 | 1111 | [[package]] 1112 | name = "miow" 1113 | version = "0.3.7" 1114 | source = "registry+https://github.com/rust-lang/crates.io-index" 1115 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 1116 | dependencies = [ 1117 | "winapi", 1118 | ] 1119 | 1120 | [[package]] 1121 | name = "naga" 1122 | version = "0.7.3" 1123 | source = "registry+https://github.com/rust-lang/crates.io-index" 1124 | checksum = "806f448a7ce662ca79ef5484ef8f451a9b7c51b8166c95f5a667228b3825a6ca" 1125 | dependencies = [ 1126 | "bit-set", 1127 | "bitflags", 1128 | "codespan-reporting", 1129 | "fxhash", 1130 | "hexf-parse", 1131 | "indexmap", 1132 | "log", 1133 | "num-traits", 1134 | "spirv", 1135 | "thiserror", 1136 | ] 1137 | 1138 | [[package]] 1139 | name = "nannou" 1140 | version = "0.18.1" 1141 | source = "registry+https://github.com/rust-lang/crates.io-index" 1142 | checksum = "99e905fd16cfd553b94d92badc04611410889c6fe36e5cfdc3325d6466b1991e" 1143 | dependencies = [ 1144 | "find_folder", 1145 | "futures", 1146 | "image", 1147 | "instant", 1148 | "lyon", 1149 | "nannou_core", 1150 | "nannou_mesh", 1151 | "nannou_wgpu", 1152 | "noise", 1153 | "notosans", 1154 | "num_cpus", 1155 | "pennereq", 1156 | "rusttype 0.8.3", 1157 | "serde", 1158 | "serde_derive", 1159 | "serde_json", 1160 | "toml", 1161 | "walkdir", 1162 | "wgpu", 1163 | "winit", 1164 | ] 1165 | 1166 | [[package]] 1167 | name = "nannou_core" 1168 | version = "0.18.0" 1169 | source = "registry+https://github.com/rust-lang/crates.io-index" 1170 | checksum = "8d53707a99dc3b2908f1d25d982755126d885ac6d780741de29f44956624fcac" 1171 | dependencies = [ 1172 | "glam", 1173 | "num-traits", 1174 | "palette", 1175 | "rand 0.8.5", 1176 | ] 1177 | 1178 | [[package]] 1179 | name = "nannou_mesh" 1180 | version = "0.18.0" 1181 | source = "registry+https://github.com/rust-lang/crates.io-index" 1182 | checksum = "da3ceb90554c048fb5f29a19820d3581d4fb85fe22e6f27d21faca0dbfab5e07" 1183 | dependencies = [ 1184 | "nannou_core", 1185 | "serde", 1186 | ] 1187 | 1188 | [[package]] 1189 | name = "nannou_wgpu" 1190 | version = "0.18.0" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "0ca299eec1e956df21430f66e8fe210f992f4348c1406e6ed965579d9d00d167" 1193 | dependencies = [ 1194 | "futures", 1195 | "image", 1196 | "instant", 1197 | "num_cpus", 1198 | "wgpu", 1199 | ] 1200 | 1201 | [[package]] 1202 | name = "ndk" 1203 | version = "0.3.0" 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" 1205 | checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" 1206 | dependencies = [ 1207 | "jni-sys", 1208 | "ndk-sys", 1209 | "num_enum", 1210 | "thiserror", 1211 | ] 1212 | 1213 | [[package]] 1214 | name = "ndk-glue" 1215 | version = "0.3.0" 1216 | source = "registry+https://github.com/rust-lang/crates.io-index" 1217 | checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" 1218 | dependencies = [ 1219 | "lazy_static", 1220 | "libc", 1221 | "log", 1222 | "ndk", 1223 | "ndk-macro", 1224 | "ndk-sys", 1225 | ] 1226 | 1227 | [[package]] 1228 | name = "ndk-macro" 1229 | version = "0.2.0" 1230 | source = "registry+https://github.com/rust-lang/crates.io-index" 1231 | checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" 1232 | dependencies = [ 1233 | "darling", 1234 | "proc-macro-crate 0.1.5", 1235 | "proc-macro2", 1236 | "quote", 1237 | "syn", 1238 | ] 1239 | 1240 | [[package]] 1241 | name = "ndk-sys" 1242 | version = "0.2.2" 1243 | source = "registry+https://github.com/rust-lang/crates.io-index" 1244 | checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" 1245 | 1246 | [[package]] 1247 | name = "nix" 1248 | version = "0.18.0" 1249 | source = "registry+https://github.com/rust-lang/crates.io-index" 1250 | checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" 1251 | dependencies = [ 1252 | "bitflags", 1253 | "cc", 1254 | "cfg-if 0.1.10", 1255 | "libc", 1256 | ] 1257 | 1258 | [[package]] 1259 | name = "nix" 1260 | version = "0.20.0" 1261 | source = "registry+https://github.com/rust-lang/crates.io-index" 1262 | checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" 1263 | dependencies = [ 1264 | "bitflags", 1265 | "cc", 1266 | "cfg-if 1.0.0", 1267 | "libc", 1268 | ] 1269 | 1270 | [[package]] 1271 | name = "noise" 1272 | version = "0.7.0" 1273 | source = "registry+https://github.com/rust-lang/crates.io-index" 1274 | checksum = "82051dd6745d5184c6efb7bc8be14892a7f6d4f3ad6dbf754d1c7d7d5fe24b43" 1275 | dependencies = [ 1276 | "image", 1277 | "rand 0.7.3", 1278 | "rand_xorshift", 1279 | ] 1280 | 1281 | [[package]] 1282 | name = "nom" 1283 | version = "7.1.1" 1284 | source = "registry+https://github.com/rust-lang/crates.io-index" 1285 | checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" 1286 | dependencies = [ 1287 | "memchr", 1288 | "minimal-lexical", 1289 | ] 1290 | 1291 | [[package]] 1292 | name = "notosans" 1293 | version = "0.1.0" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "004d578bbfc8a6bdd4690576a8381af234ef051dd4cc358604e1784821e8205c" 1296 | 1297 | [[package]] 1298 | name = "ntapi" 1299 | version = "0.3.7" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" 1302 | dependencies = [ 1303 | "winapi", 1304 | ] 1305 | 1306 | [[package]] 1307 | name = "num-integer" 1308 | version = "0.1.45" 1309 | source = "registry+https://github.com/rust-lang/crates.io-index" 1310 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 1311 | dependencies = [ 1312 | "autocfg", 1313 | "num-traits", 1314 | ] 1315 | 1316 | [[package]] 1317 | name = "num-iter" 1318 | version = "0.1.43" 1319 | source = "registry+https://github.com/rust-lang/crates.io-index" 1320 | checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" 1321 | dependencies = [ 1322 | "autocfg", 1323 | "num-integer", 1324 | "num-traits", 1325 | ] 1326 | 1327 | [[package]] 1328 | name = "num-rational" 1329 | version = "0.3.2" 1330 | source = "registry+https://github.com/rust-lang/crates.io-index" 1331 | checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" 1332 | dependencies = [ 1333 | "autocfg", 1334 | "num-integer", 1335 | "num-traits", 1336 | ] 1337 | 1338 | [[package]] 1339 | name = "num-traits" 1340 | version = "0.2.15" 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" 1342 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 1343 | dependencies = [ 1344 | "autocfg", 1345 | ] 1346 | 1347 | [[package]] 1348 | name = "num_cpus" 1349 | version = "1.13.1" 1350 | source = "registry+https://github.com/rust-lang/crates.io-index" 1351 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 1352 | dependencies = [ 1353 | "hermit-abi", 1354 | "libc", 1355 | ] 1356 | 1357 | [[package]] 1358 | name = "num_enum" 1359 | version = "0.5.7" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" 1362 | dependencies = [ 1363 | "num_enum_derive", 1364 | ] 1365 | 1366 | [[package]] 1367 | name = "num_enum_derive" 1368 | version = "0.5.7" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" 1371 | dependencies = [ 1372 | "proc-macro-crate 1.1.3", 1373 | "proc-macro2", 1374 | "quote", 1375 | "syn", 1376 | ] 1377 | 1378 | [[package]] 1379 | name = "objc" 1380 | version = "0.2.7" 1381 | source = "registry+https://github.com/rust-lang/crates.io-index" 1382 | checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" 1383 | dependencies = [ 1384 | "malloc_buf", 1385 | "objc_exception", 1386 | ] 1387 | 1388 | [[package]] 1389 | name = "objc_exception" 1390 | version = "0.1.2" 1391 | source = "registry+https://github.com/rust-lang/crates.io-index" 1392 | checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" 1393 | dependencies = [ 1394 | "cc", 1395 | ] 1396 | 1397 | [[package]] 1398 | name = "once_cell" 1399 | version = "1.10.0" 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" 1401 | checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" 1402 | 1403 | [[package]] 1404 | name = "ordered-float" 1405 | version = "1.1.1" 1406 | source = "registry+https://github.com/rust-lang/crates.io-index" 1407 | checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" 1408 | dependencies = [ 1409 | "num-traits", 1410 | ] 1411 | 1412 | [[package]] 1413 | name = "owned_ttf_parser" 1414 | version = "0.6.0" 1415 | source = "registry+https://github.com/rust-lang/crates.io-index" 1416 | checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" 1417 | dependencies = [ 1418 | "ttf-parser", 1419 | ] 1420 | 1421 | [[package]] 1422 | name = "palette" 1423 | version = "0.5.0" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "a05c0334468e62a4dfbda34b29110aa7d70d58c7fdb2c9857b5874dd9827cc59" 1426 | dependencies = [ 1427 | "approx", 1428 | "num-traits", 1429 | "palette_derive", 1430 | "serde", 1431 | ] 1432 | 1433 | [[package]] 1434 | name = "palette_derive" 1435 | version = "0.5.0" 1436 | source = "registry+https://github.com/rust-lang/crates.io-index" 1437 | checksum = "0b4b5f600e60dd3a147fb57b4547033d382d1979eb087af310e91cb45a63b1f4" 1438 | dependencies = [ 1439 | "proc-macro2", 1440 | "quote", 1441 | "syn", 1442 | ] 1443 | 1444 | [[package]] 1445 | name = "parking_lot" 1446 | version = "0.11.2" 1447 | source = "registry+https://github.com/rust-lang/crates.io-index" 1448 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 1449 | dependencies = [ 1450 | "instant", 1451 | "lock_api", 1452 | "parking_lot_core", 1453 | ] 1454 | 1455 | [[package]] 1456 | name = "parking_lot_core" 1457 | version = "0.8.5" 1458 | source = "registry+https://github.com/rust-lang/crates.io-index" 1459 | checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" 1460 | dependencies = [ 1461 | "cfg-if 1.0.0", 1462 | "instant", 1463 | "libc", 1464 | "redox_syscall", 1465 | "smallvec", 1466 | "winapi", 1467 | ] 1468 | 1469 | [[package]] 1470 | name = "pennereq" 1471 | version = "0.3.1" 1472 | source = "registry+https://github.com/rust-lang/crates.io-index" 1473 | checksum = "2174a8f4566f0f8cdce1af08dc29d78fc93880f70962a1e49385831b9550dc8b" 1474 | dependencies = [ 1475 | "num-traits", 1476 | ] 1477 | 1478 | [[package]] 1479 | name = "percent-encoding" 1480 | version = "2.1.0" 1481 | source = "registry+https://github.com/rust-lang/crates.io-index" 1482 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1483 | 1484 | [[package]] 1485 | name = "pin-project-lite" 1486 | version = "0.2.9" 1487 | source = "registry+https://github.com/rust-lang/crates.io-index" 1488 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1489 | 1490 | [[package]] 1491 | name = "pin-utils" 1492 | version = "0.1.0" 1493 | source = "registry+https://github.com/rust-lang/crates.io-index" 1494 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1495 | 1496 | [[package]] 1497 | name = "pkg-config" 1498 | version = "0.3.25" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" 1501 | 1502 | [[package]] 1503 | name = "png" 1504 | version = "0.16.8" 1505 | source = "registry+https://github.com/rust-lang/crates.io-index" 1506 | checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" 1507 | dependencies = [ 1508 | "bitflags", 1509 | "crc32fast", 1510 | "deflate", 1511 | "miniz_oxide 0.3.7", 1512 | ] 1513 | 1514 | [[package]] 1515 | name = "ppv-lite86" 1516 | version = "0.2.16" 1517 | source = "registry+https://github.com/rust-lang/crates.io-index" 1518 | checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 1519 | 1520 | [[package]] 1521 | name = "proc-macro-crate" 1522 | version = "0.1.5" 1523 | source = "registry+https://github.com/rust-lang/crates.io-index" 1524 | checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" 1525 | dependencies = [ 1526 | "toml", 1527 | ] 1528 | 1529 | [[package]] 1530 | name = "proc-macro-crate" 1531 | version = "1.1.3" 1532 | source = "registry+https://github.com/rust-lang/crates.io-index" 1533 | checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" 1534 | dependencies = [ 1535 | "thiserror", 1536 | "toml", 1537 | ] 1538 | 1539 | [[package]] 1540 | name = "proc-macro2" 1541 | version = "1.0.38" 1542 | source = "registry+https://github.com/rust-lang/crates.io-index" 1543 | checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" 1544 | dependencies = [ 1545 | "unicode-xid", 1546 | ] 1547 | 1548 | [[package]] 1549 | name = "profiling" 1550 | version = "1.0.5" 1551 | source = "registry+https://github.com/rust-lang/crates.io-index" 1552 | checksum = "9145ac0af1d93c638c98c40cf7d25665f427b2a44ad0a99b1dccf3e2f25bb987" 1553 | 1554 | [[package]] 1555 | name = "quote" 1556 | version = "1.0.18" 1557 | source = "registry+https://github.com/rust-lang/crates.io-index" 1558 | checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" 1559 | dependencies = [ 1560 | "proc-macro2", 1561 | ] 1562 | 1563 | [[package]] 1564 | name = "rand" 1565 | version = "0.7.3" 1566 | source = "registry+https://github.com/rust-lang/crates.io-index" 1567 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1568 | dependencies = [ 1569 | "getrandom 0.1.16", 1570 | "libc", 1571 | "rand_chacha 0.2.2", 1572 | "rand_core 0.5.1", 1573 | "rand_hc", 1574 | ] 1575 | 1576 | [[package]] 1577 | name = "rand" 1578 | version = "0.8.5" 1579 | source = "registry+https://github.com/rust-lang/crates.io-index" 1580 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1581 | dependencies = [ 1582 | "libc", 1583 | "rand_chacha 0.3.1", 1584 | "rand_core 0.6.3", 1585 | ] 1586 | 1587 | [[package]] 1588 | name = "rand_chacha" 1589 | version = "0.2.2" 1590 | source = "registry+https://github.com/rust-lang/crates.io-index" 1591 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1592 | dependencies = [ 1593 | "ppv-lite86", 1594 | "rand_core 0.5.1", 1595 | ] 1596 | 1597 | [[package]] 1598 | name = "rand_chacha" 1599 | version = "0.3.1" 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" 1601 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1602 | dependencies = [ 1603 | "ppv-lite86", 1604 | "rand_core 0.6.3", 1605 | ] 1606 | 1607 | [[package]] 1608 | name = "rand_core" 1609 | version = "0.5.1" 1610 | source = "registry+https://github.com/rust-lang/crates.io-index" 1611 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1612 | dependencies = [ 1613 | "getrandom 0.1.16", 1614 | ] 1615 | 1616 | [[package]] 1617 | name = "rand_core" 1618 | version = "0.6.3" 1619 | source = "registry+https://github.com/rust-lang/crates.io-index" 1620 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 1621 | dependencies = [ 1622 | "getrandom 0.2.6", 1623 | ] 1624 | 1625 | [[package]] 1626 | name = "rand_hc" 1627 | version = "0.2.0" 1628 | source = "registry+https://github.com/rust-lang/crates.io-index" 1629 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1630 | dependencies = [ 1631 | "rand_core 0.5.1", 1632 | ] 1633 | 1634 | [[package]] 1635 | name = "rand_xorshift" 1636 | version = "0.2.0" 1637 | source = "registry+https://github.com/rust-lang/crates.io-index" 1638 | checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" 1639 | dependencies = [ 1640 | "rand_core 0.5.1", 1641 | ] 1642 | 1643 | [[package]] 1644 | name = "range-alloc" 1645 | version = "0.1.2" 1646 | source = "registry+https://github.com/rust-lang/crates.io-index" 1647 | checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" 1648 | 1649 | [[package]] 1650 | name = "raw-window-handle" 1651 | version = "0.3.4" 1652 | source = "registry+https://github.com/rust-lang/crates.io-index" 1653 | checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" 1654 | dependencies = [ 1655 | "libc", 1656 | "raw-window-handle 0.4.3", 1657 | ] 1658 | 1659 | [[package]] 1660 | name = "raw-window-handle" 1661 | version = "0.4.3" 1662 | source = "registry+https://github.com/rust-lang/crates.io-index" 1663 | checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" 1664 | dependencies = [ 1665 | "cty", 1666 | ] 1667 | 1668 | [[package]] 1669 | name = "rayon" 1670 | version = "1.5.2" 1671 | source = "registry+https://github.com/rust-lang/crates.io-index" 1672 | checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" 1673 | dependencies = [ 1674 | "autocfg", 1675 | "crossbeam-deque 0.8.1", 1676 | "either", 1677 | "rayon-core", 1678 | ] 1679 | 1680 | [[package]] 1681 | name = "rayon-core" 1682 | version = "1.9.2" 1683 | source = "registry+https://github.com/rust-lang/crates.io-index" 1684 | checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" 1685 | dependencies = [ 1686 | "crossbeam-channel", 1687 | "crossbeam-deque 0.8.1", 1688 | "crossbeam-utils 0.8.8", 1689 | "num_cpus", 1690 | ] 1691 | 1692 | [[package]] 1693 | name = "redox_syscall" 1694 | version = "0.2.13" 1695 | source = "registry+https://github.com/rust-lang/crates.io-index" 1696 | checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" 1697 | dependencies = [ 1698 | "bitflags", 1699 | ] 1700 | 1701 | [[package]] 1702 | name = "redox_users" 1703 | version = "0.4.3" 1704 | source = "registry+https://github.com/rust-lang/crates.io-index" 1705 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1706 | dependencies = [ 1707 | "getrandom 0.2.6", 1708 | "redox_syscall", 1709 | "thiserror", 1710 | ] 1711 | 1712 | [[package]] 1713 | name = "renderdoc-sys" 1714 | version = "0.7.1" 1715 | source = "registry+https://github.com/rust-lang/crates.io-index" 1716 | checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" 1717 | 1718 | [[package]] 1719 | name = "rustc-hash" 1720 | version = "1.1.0" 1721 | source = "registry+https://github.com/rust-lang/crates.io-index" 1722 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1723 | 1724 | [[package]] 1725 | name = "rusttype" 1726 | version = "0.8.3" 1727 | source = "registry+https://github.com/rust-lang/crates.io-index" 1728 | checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" 1729 | dependencies = [ 1730 | "approx", 1731 | "crossbeam-deque 0.7.4", 1732 | "crossbeam-utils 0.7.2", 1733 | "linked-hash-map", 1734 | "num_cpus", 1735 | "ordered-float", 1736 | "rustc-hash", 1737 | "stb_truetype", 1738 | ] 1739 | 1740 | [[package]] 1741 | name = "rusttype" 1742 | version = "0.9.2" 1743 | source = "registry+https://github.com/rust-lang/crates.io-index" 1744 | checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" 1745 | dependencies = [ 1746 | "ab_glyph_rasterizer", 1747 | "owned_ttf_parser", 1748 | ] 1749 | 1750 | [[package]] 1751 | name = "ryu" 1752 | version = "1.0.9" 1753 | source = "registry+https://github.com/rust-lang/crates.io-index" 1754 | checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" 1755 | 1756 | [[package]] 1757 | name = "same-file" 1758 | version = "1.0.6" 1759 | source = "registry+https://github.com/rust-lang/crates.io-index" 1760 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1761 | dependencies = [ 1762 | "winapi-util", 1763 | ] 1764 | 1765 | [[package]] 1766 | name = "scoped-tls" 1767 | version = "1.0.0" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" 1770 | 1771 | [[package]] 1772 | name = "scoped_threadpool" 1773 | version = "0.1.9" 1774 | source = "registry+https://github.com/rust-lang/crates.io-index" 1775 | checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" 1776 | 1777 | [[package]] 1778 | name = "scopeguard" 1779 | version = "1.1.0" 1780 | source = "registry+https://github.com/rust-lang/crates.io-index" 1781 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1782 | 1783 | [[package]] 1784 | name = "serde" 1785 | version = "1.0.137" 1786 | source = "registry+https://github.com/rust-lang/crates.io-index" 1787 | checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" 1788 | dependencies = [ 1789 | "serde_derive", 1790 | ] 1791 | 1792 | [[package]] 1793 | name = "serde_derive" 1794 | version = "1.0.137" 1795 | source = "registry+https://github.com/rust-lang/crates.io-index" 1796 | checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" 1797 | dependencies = [ 1798 | "proc-macro2", 1799 | "quote", 1800 | "syn", 1801 | ] 1802 | 1803 | [[package]] 1804 | name = "serde_json" 1805 | version = "1.0.81" 1806 | source = "registry+https://github.com/rust-lang/crates.io-index" 1807 | checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" 1808 | dependencies = [ 1809 | "itoa", 1810 | "ryu", 1811 | "serde", 1812 | ] 1813 | 1814 | [[package]] 1815 | name = "sid" 1816 | version = "0.6.1" 1817 | source = "registry+https://github.com/rust-lang/crates.io-index" 1818 | checksum = "bd5ac56c121948b4879bba9e519852c211bcdd8f014efff766441deff0b91bdb" 1819 | dependencies = [ 1820 | "num-traits", 1821 | ] 1822 | 1823 | [[package]] 1824 | name = "slab" 1825 | version = "0.4.6" 1826 | source = "registry+https://github.com/rust-lang/crates.io-index" 1827 | checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" 1828 | 1829 | [[package]] 1830 | name = "slotmap" 1831 | version = "1.0.6" 1832 | source = "registry+https://github.com/rust-lang/crates.io-index" 1833 | checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" 1834 | dependencies = [ 1835 | "version_check", 1836 | ] 1837 | 1838 | [[package]] 1839 | name = "smallvec" 1840 | version = "1.8.0" 1841 | source = "registry+https://github.com/rust-lang/crates.io-index" 1842 | checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" 1843 | 1844 | [[package]] 1845 | name = "smithay-client-toolkit" 1846 | version = "0.12.3" 1847 | source = "registry+https://github.com/rust-lang/crates.io-index" 1848 | checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" 1849 | dependencies = [ 1850 | "andrew", 1851 | "bitflags", 1852 | "calloop", 1853 | "dlib 0.4.2", 1854 | "lazy_static", 1855 | "log", 1856 | "memmap2", 1857 | "nix 0.18.0", 1858 | "wayland-client", 1859 | "wayland-cursor", 1860 | "wayland-protocols", 1861 | ] 1862 | 1863 | [[package]] 1864 | name = "spirv" 1865 | version = "0.2.0+1.5.4" 1866 | source = "registry+https://github.com/rust-lang/crates.io-index" 1867 | checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" 1868 | dependencies = [ 1869 | "bitflags", 1870 | "num-traits", 1871 | ] 1872 | 1873 | [[package]] 1874 | name = "stb_truetype" 1875 | version = "0.3.1" 1876 | source = "registry+https://github.com/rust-lang/crates.io-index" 1877 | checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" 1878 | dependencies = [ 1879 | "byteorder", 1880 | ] 1881 | 1882 | [[package]] 1883 | name = "strsim" 1884 | version = "0.9.3" 1885 | source = "registry+https://github.com/rust-lang/crates.io-index" 1886 | checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" 1887 | 1888 | [[package]] 1889 | name = "syn" 1890 | version = "1.0.92" 1891 | source = "registry+https://github.com/rust-lang/crates.io-index" 1892 | checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" 1893 | dependencies = [ 1894 | "proc-macro2", 1895 | "quote", 1896 | "unicode-xid", 1897 | ] 1898 | 1899 | [[package]] 1900 | name = "termcolor" 1901 | version = "1.1.3" 1902 | source = "registry+https://github.com/rust-lang/crates.io-index" 1903 | checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" 1904 | dependencies = [ 1905 | "winapi-util", 1906 | ] 1907 | 1908 | [[package]] 1909 | name = "thiserror" 1910 | version = "1.0.31" 1911 | source = "registry+https://github.com/rust-lang/crates.io-index" 1912 | checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" 1913 | dependencies = [ 1914 | "thiserror-impl", 1915 | ] 1916 | 1917 | [[package]] 1918 | name = "thiserror-impl" 1919 | version = "1.0.31" 1920 | source = "registry+https://github.com/rust-lang/crates.io-index" 1921 | checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" 1922 | dependencies = [ 1923 | "proc-macro2", 1924 | "quote", 1925 | "syn", 1926 | ] 1927 | 1928 | [[package]] 1929 | name = "tiff" 1930 | version = "0.6.1" 1931 | source = "registry+https://github.com/rust-lang/crates.io-index" 1932 | checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" 1933 | dependencies = [ 1934 | "jpeg-decoder", 1935 | "miniz_oxide 0.4.4", 1936 | "weezl", 1937 | ] 1938 | 1939 | [[package]] 1940 | name = "toml" 1941 | version = "0.5.9" 1942 | source = "registry+https://github.com/rust-lang/crates.io-index" 1943 | checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" 1944 | dependencies = [ 1945 | "serde", 1946 | ] 1947 | 1948 | [[package]] 1949 | name = "ttf-parser" 1950 | version = "0.6.2" 1951 | source = "registry+https://github.com/rust-lang/crates.io-index" 1952 | checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" 1953 | 1954 | [[package]] 1955 | name = "unicode-width" 1956 | version = "0.1.9" 1957 | source = "registry+https://github.com/rust-lang/crates.io-index" 1958 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 1959 | 1960 | [[package]] 1961 | name = "unicode-xid" 1962 | version = "0.2.3" 1963 | source = "registry+https://github.com/rust-lang/crates.io-index" 1964 | checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" 1965 | 1966 | [[package]] 1967 | name = "version_check" 1968 | version = "0.9.4" 1969 | source = "registry+https://github.com/rust-lang/crates.io-index" 1970 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1971 | 1972 | [[package]] 1973 | name = "walkdir" 1974 | version = "2.3.2" 1975 | source = "registry+https://github.com/rust-lang/crates.io-index" 1976 | checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" 1977 | dependencies = [ 1978 | "same-file", 1979 | "winapi", 1980 | "winapi-util", 1981 | ] 1982 | 1983 | [[package]] 1984 | name = "wasi" 1985 | version = "0.9.0+wasi-snapshot-preview1" 1986 | source = "registry+https://github.com/rust-lang/crates.io-index" 1987 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1988 | 1989 | [[package]] 1990 | name = "wasi" 1991 | version = "0.10.2+wasi-snapshot-preview1" 1992 | source = "registry+https://github.com/rust-lang/crates.io-index" 1993 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 1994 | 1995 | [[package]] 1996 | name = "wasm-bindgen" 1997 | version = "0.2.80" 1998 | source = "registry+https://github.com/rust-lang/crates.io-index" 1999 | checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" 2000 | dependencies = [ 2001 | "cfg-if 1.0.0", 2002 | "wasm-bindgen-macro", 2003 | ] 2004 | 2005 | [[package]] 2006 | name = "wasm-bindgen-backend" 2007 | version = "0.2.80" 2008 | source = "registry+https://github.com/rust-lang/crates.io-index" 2009 | checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" 2010 | dependencies = [ 2011 | "bumpalo", 2012 | "lazy_static", 2013 | "log", 2014 | "proc-macro2", 2015 | "quote", 2016 | "syn", 2017 | "wasm-bindgen-shared", 2018 | ] 2019 | 2020 | [[package]] 2021 | name = "wasm-bindgen-futures" 2022 | version = "0.4.30" 2023 | source = "registry+https://github.com/rust-lang/crates.io-index" 2024 | checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" 2025 | dependencies = [ 2026 | "cfg-if 1.0.0", 2027 | "js-sys", 2028 | "wasm-bindgen", 2029 | "web-sys", 2030 | ] 2031 | 2032 | [[package]] 2033 | name = "wasm-bindgen-macro" 2034 | version = "0.2.80" 2035 | source = "registry+https://github.com/rust-lang/crates.io-index" 2036 | checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" 2037 | dependencies = [ 2038 | "quote", 2039 | "wasm-bindgen-macro-support", 2040 | ] 2041 | 2042 | [[package]] 2043 | name = "wasm-bindgen-macro-support" 2044 | version = "0.2.80" 2045 | source = "registry+https://github.com/rust-lang/crates.io-index" 2046 | checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" 2047 | dependencies = [ 2048 | "proc-macro2", 2049 | "quote", 2050 | "syn", 2051 | "wasm-bindgen-backend", 2052 | "wasm-bindgen-shared", 2053 | ] 2054 | 2055 | [[package]] 2056 | name = "wasm-bindgen-shared" 2057 | version = "0.2.80" 2058 | source = "registry+https://github.com/rust-lang/crates.io-index" 2059 | checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" 2060 | 2061 | [[package]] 2062 | name = "wayland-client" 2063 | version = "0.28.6" 2064 | source = "registry+https://github.com/rust-lang/crates.io-index" 2065 | checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" 2066 | dependencies = [ 2067 | "bitflags", 2068 | "downcast-rs", 2069 | "libc", 2070 | "nix 0.20.0", 2071 | "scoped-tls", 2072 | "wayland-commons", 2073 | "wayland-scanner", 2074 | "wayland-sys", 2075 | ] 2076 | 2077 | [[package]] 2078 | name = "wayland-commons" 2079 | version = "0.28.6" 2080 | source = "registry+https://github.com/rust-lang/crates.io-index" 2081 | checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" 2082 | dependencies = [ 2083 | "nix 0.20.0", 2084 | "once_cell", 2085 | "smallvec", 2086 | "wayland-sys", 2087 | ] 2088 | 2089 | [[package]] 2090 | name = "wayland-cursor" 2091 | version = "0.28.6" 2092 | source = "registry+https://github.com/rust-lang/crates.io-index" 2093 | checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" 2094 | dependencies = [ 2095 | "nix 0.20.0", 2096 | "wayland-client", 2097 | "xcursor", 2098 | ] 2099 | 2100 | [[package]] 2101 | name = "wayland-protocols" 2102 | version = "0.28.6" 2103 | source = "registry+https://github.com/rust-lang/crates.io-index" 2104 | checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" 2105 | dependencies = [ 2106 | "bitflags", 2107 | "wayland-client", 2108 | "wayland-commons", 2109 | "wayland-scanner", 2110 | ] 2111 | 2112 | [[package]] 2113 | name = "wayland-scanner" 2114 | version = "0.28.6" 2115 | source = "registry+https://github.com/rust-lang/crates.io-index" 2116 | checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" 2117 | dependencies = [ 2118 | "proc-macro2", 2119 | "quote", 2120 | "xml-rs", 2121 | ] 2122 | 2123 | [[package]] 2124 | name = "wayland-sys" 2125 | version = "0.28.6" 2126 | source = "registry+https://github.com/rust-lang/crates.io-index" 2127 | checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" 2128 | dependencies = [ 2129 | "dlib 0.5.0", 2130 | "lazy_static", 2131 | "pkg-config", 2132 | ] 2133 | 2134 | [[package]] 2135 | name = "web-sys" 2136 | version = "0.3.57" 2137 | source = "registry+https://github.com/rust-lang/crates.io-index" 2138 | checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" 2139 | dependencies = [ 2140 | "js-sys", 2141 | "wasm-bindgen", 2142 | ] 2143 | 2144 | [[package]] 2145 | name = "weezl" 2146 | version = "0.1.6" 2147 | source = "registry+https://github.com/rust-lang/crates.io-index" 2148 | checksum = "9c97e489d8f836838d497091de568cf16b117486d529ec5579233521065bd5e4" 2149 | 2150 | [[package]] 2151 | name = "wgpu" 2152 | version = "0.11.1" 2153 | source = "registry+https://github.com/rust-lang/crates.io-index" 2154 | checksum = "eae7181fe6ba5f4b632a9079cc9e922a64555156c87def72c063f94b180c7d68" 2155 | dependencies = [ 2156 | "arrayvec 0.7.2", 2157 | "js-sys", 2158 | "log", 2159 | "parking_lot", 2160 | "raw-window-handle 0.3.4", 2161 | "smallvec", 2162 | "wasm-bindgen", 2163 | "wasm-bindgen-futures", 2164 | "web-sys", 2165 | "wgpu-core", 2166 | "wgpu-hal", 2167 | "wgpu-types", 2168 | ] 2169 | 2170 | [[package]] 2171 | name = "wgpu-core" 2172 | version = "0.11.3" 2173 | source = "registry+https://github.com/rust-lang/crates.io-index" 2174 | checksum = "35600627b6c718ad0e23ed75fb6140bfe32cdf21c8f539ce3c9ab8180e2cb38e" 2175 | dependencies = [ 2176 | "arrayvec 0.7.2", 2177 | "bitflags", 2178 | "cfg_aliases", 2179 | "copyless", 2180 | "fxhash", 2181 | "log", 2182 | "naga", 2183 | "parking_lot", 2184 | "profiling", 2185 | "raw-window-handle 0.3.4", 2186 | "smallvec", 2187 | "thiserror", 2188 | "wgpu-hal", 2189 | "wgpu-types", 2190 | ] 2191 | 2192 | [[package]] 2193 | name = "wgpu-hal" 2194 | version = "0.11.5" 2195 | source = "registry+https://github.com/rust-lang/crates.io-index" 2196 | checksum = "af28b29ef0b44cd22dd9895d4349b9d5a687df42f58da234871198637eabe328" 2197 | dependencies = [ 2198 | "arrayvec 0.7.2", 2199 | "ash", 2200 | "bit-set", 2201 | "bitflags", 2202 | "block", 2203 | "core-graphics-types", 2204 | "d3d12", 2205 | "foreign-types", 2206 | "fxhash", 2207 | "glow", 2208 | "gpu-alloc", 2209 | "gpu-descriptor", 2210 | "inplace_it", 2211 | "js-sys", 2212 | "khronos-egl", 2213 | "libloading 0.7.3", 2214 | "log", 2215 | "metal", 2216 | "naga", 2217 | "objc", 2218 | "parking_lot", 2219 | "profiling", 2220 | "range-alloc", 2221 | "raw-window-handle 0.3.4", 2222 | "renderdoc-sys", 2223 | "thiserror", 2224 | "wasm-bindgen", 2225 | "web-sys", 2226 | "wgpu-types", 2227 | "winapi", 2228 | ] 2229 | 2230 | [[package]] 2231 | name = "wgpu-types" 2232 | version = "0.11.0" 2233 | source = "registry+https://github.com/rust-lang/crates.io-index" 2234 | checksum = "e15e44ba88ec415466e18e91881319e7c9e96cb905dc623305168aea65b85ccc" 2235 | dependencies = [ 2236 | "bitflags", 2237 | ] 2238 | 2239 | [[package]] 2240 | name = "winapi" 2241 | version = "0.3.9" 2242 | source = "registry+https://github.com/rust-lang/crates.io-index" 2243 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2244 | dependencies = [ 2245 | "winapi-i686-pc-windows-gnu", 2246 | "winapi-x86_64-pc-windows-gnu", 2247 | ] 2248 | 2249 | [[package]] 2250 | name = "winapi-i686-pc-windows-gnu" 2251 | version = "0.4.0" 2252 | source = "registry+https://github.com/rust-lang/crates.io-index" 2253 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2254 | 2255 | [[package]] 2256 | name = "winapi-util" 2257 | version = "0.1.5" 2258 | source = "registry+https://github.com/rust-lang/crates.io-index" 2259 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2260 | dependencies = [ 2261 | "winapi", 2262 | ] 2263 | 2264 | [[package]] 2265 | name = "winapi-x86_64-pc-windows-gnu" 2266 | version = "0.4.0" 2267 | source = "registry+https://github.com/rust-lang/crates.io-index" 2268 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2269 | 2270 | [[package]] 2271 | name = "winit" 2272 | version = "0.25.0" 2273 | source = "registry+https://github.com/rust-lang/crates.io-index" 2274 | checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" 2275 | dependencies = [ 2276 | "bitflags", 2277 | "cocoa", 2278 | "core-foundation 0.9.3", 2279 | "core-graphics 0.22.3", 2280 | "core-video-sys", 2281 | "dispatch", 2282 | "instant", 2283 | "lazy_static", 2284 | "libc", 2285 | "log", 2286 | "mio", 2287 | "mio-misc", 2288 | "ndk", 2289 | "ndk-glue", 2290 | "ndk-sys", 2291 | "objc", 2292 | "parking_lot", 2293 | "percent-encoding", 2294 | "raw-window-handle 0.3.4", 2295 | "scopeguard", 2296 | "smithay-client-toolkit", 2297 | "wayland-client", 2298 | "winapi", 2299 | "x11-dl", 2300 | ] 2301 | 2302 | [[package]] 2303 | name = "x11-dl" 2304 | version = "2.19.1" 2305 | source = "registry+https://github.com/rust-lang/crates.io-index" 2306 | checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" 2307 | dependencies = [ 2308 | "lazy_static", 2309 | "libc", 2310 | "pkg-config", 2311 | ] 2312 | 2313 | [[package]] 2314 | name = "xcursor" 2315 | version = "0.3.4" 2316 | source = "registry+https://github.com/rust-lang/crates.io-index" 2317 | checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" 2318 | dependencies = [ 2319 | "nom", 2320 | ] 2321 | 2322 | [[package]] 2323 | name = "xdg" 2324 | version = "2.4.1" 2325 | source = "registry+https://github.com/rust-lang/crates.io-index" 2326 | checksum = "0c4583db5cbd4c4c0303df2d15af80f0539db703fa1c68802d4cbbd2dd0f88f6" 2327 | dependencies = [ 2328 | "dirs", 2329 | ] 2330 | 2331 | [[package]] 2332 | name = "xml-rs" 2333 | version = "0.8.4" 2334 | source = "registry+https://github.com/rust-lang/crates.io-index" 2335 | checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" 2336 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "flocking_simulation" 3 | version = "0.1.0" 4 | edition = "2021" 5 | license = "MIT" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | nannou = "0.18.1" 11 | -------------------------------------------------------------------------------- /src/boid.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{Div, Mul, Sub}; 2 | 3 | use nannou::prelude::*; 4 | 5 | #[derive(Debug, PartialEq)] 6 | pub enum BoidType { 7 | Predator, 8 | Prey, 9 | } 10 | 11 | #[derive(Debug)] 12 | pub struct Boid { 13 | pub position: Vec2, 14 | pub velocity: Vec2, 15 | pub nature: BoidType, 16 | pub acceleration: Vec2, 17 | radius: f32, 18 | max_velocity: f32, 19 | min_velocity: f32, 20 | max_force: f32, 21 | } 22 | 23 | impl Boid { 24 | pub fn new(pos_x: f32, pos_y: f32, radius: f32, boid_type: BoidType) -> Boid { 25 | Boid { 26 | position: vec2(pos_x, pos_y), 27 | velocity: vec2(random_f32() - 0.5, random_f32() - 0.5), 28 | radius, 29 | acceleration: vec2(random_f32() - 0.5, random_f32() - 0.5), 30 | max_velocity: if boid_type == BoidType::Prey { 31 | 5.0 32 | } else { 33 | 3.0 34 | }, 35 | min_velocity: if boid_type == BoidType::Prey { 36 | 1.5 37 | } else { 38 | 1.0 39 | }, 40 | max_force: if boid_type == BoidType::Prey { 41 | 0.5 42 | } else { 43 | 1.0 44 | }, 45 | nature: boid_type, 46 | } 47 | } 48 | 49 | pub fn show(&self, draw: &Draw) { 50 | let red = if self.nature == BoidType::Predator { 51 | 255.0 52 | } else { 53 | 0.0 54 | }; 55 | 56 | draw.tri() 57 | .w_h(self.radius, self.radius) 58 | .x_y(self.position.x, self.position.y) 59 | .rotate(self.velocity.angle()) 60 | .rgba(red, 0.0, 0.0, 0.85); 61 | } 62 | 63 | pub fn update(&mut self) { 64 | self.acceleration = set_max_acc(self.max_force, &self.acceleration); 65 | self.position += self.velocity; 66 | self.velocity += self.acceleration; 67 | self.velocity = set_velocity(self.max_velocity, self.min_velocity, &self.velocity); 68 | 69 | self.acceleration = vec2(0.0, 0.0); 70 | } 71 | 72 | pub fn edge(&mut self, top: f32, right: f32) { 73 | if self.position.x > right { 74 | self.position.x = -right; 75 | } else if self.position.x < -right { 76 | self.position.x = right 77 | } 78 | if self.position.y > top { 79 | self.position.y = -top; 80 | } else if self.position.y < -top { 81 | self.position.y = top 82 | } 83 | } 84 | 85 | pub fn local_boids<'a>(&self, all_boids: &'a Vec, boid_index: usize) -> Vec<&'a Boid> { 86 | let perception = if self.nature == BoidType::Predator { 87 | 300.0 88 | } else { 89 | 100.0 90 | }; 91 | 92 | let mut local_boids = Vec::new(); 93 | 94 | for i in 0..all_boids.len() { 95 | if i != boid_index { 96 | let distance = self.position.distance(all_boids[i].position); 97 | if distance <= perception { 98 | local_boids.push(&all_boids[i]); 99 | } 100 | } 101 | } 102 | 103 | local_boids 104 | } 105 | 106 | pub fn alignment(&self, other_boids: &Vec<&Boid>) -> Vec2 { 107 | let len = other_boids.len(); 108 | 109 | if len == 0 { 110 | return vec2(0.0, 0.0); 111 | } 112 | 113 | let mut average_velocity = vec2(0.0, 0.0); 114 | for i in other_boids { 115 | average_velocity += i.velocity; 116 | } 117 | average_velocity = average_velocity.div(len as f32); 118 | average_velocity.sub(self.velocity) / 2.5 119 | } 120 | 121 | pub fn cohesion(&self, other_boids: &Vec<&Boid>) -> Vec2 { 122 | let len = other_boids.len(); 123 | 124 | if len == 0 { 125 | return vec2(0.0, 0.0); 126 | } 127 | 128 | let mut average_position = vec2(0.0, 0.0); 129 | for i in other_boids { 130 | average_position += i.position; 131 | } 132 | average_position = average_position.div(len as f32); 133 | average_position.sub(self.position) / 20.0 134 | } 135 | 136 | pub fn separation(&self, other_boids: &Vec<&Boid>) -> Vec2 { 137 | let len = other_boids.len(); 138 | 139 | if len == 0 { 140 | return vec2(0.0, 0.0); 141 | } 142 | 143 | let mut average_seperation = vec2(0.0, 0.0); 144 | for i in other_boids { 145 | let difference_vec = i 146 | .position 147 | .sub(self.position) 148 | .div(self.position.distance(i.position) * 2.0); 149 | average_seperation -= difference_vec; 150 | } 151 | average_seperation * 1.5 152 | } 153 | 154 | pub fn avoid_predators(&self, other_boids: &Vec<&Boid>) -> Vec2 { 155 | let len = other_boids.len(); 156 | 157 | if len == 0 { 158 | return vec2(0.0, 0.0); 159 | } 160 | 161 | let mut avoid_vec = vec2(0.0, 0.0); 162 | for i in other_boids { 163 | if i.nature == BoidType::Predator { 164 | let difference_vec = i 165 | .position 166 | .sub(self.position) 167 | .div(self.position.distance(i.position) * 2.0); 168 | avoid_vec -= difference_vec; 169 | } 170 | } 171 | avoid_vec * 5.0 172 | } 173 | 174 | pub fn convert_to_predator(&self, other_boids: &Vec<&Boid>) -> bool { 175 | let len = other_boids.len(); 176 | 177 | if len == 0 { 178 | return false; 179 | } 180 | for i in other_boids { 181 | if i.nature == BoidType::Predator && self.position.distance(i.position) < 40.0 { 182 | return true; 183 | } 184 | } 185 | 186 | false 187 | } 188 | 189 | pub fn catch_prey(&self, other_boids: &Vec<&Boid>) -> Vec2 { 190 | let len = other_boids.len(); 191 | 192 | if len == 0 { 193 | return vec2(0.0, 0.0); 194 | } 195 | 196 | let mut average_velocity = vec2(0.0, 0.0); 197 | let mut average_position = vec2(0.0, 0.0); 198 | 199 | let mut no_prey_counter = 0; 200 | 201 | for i in other_boids { 202 | if i.nature == BoidType::Prey { 203 | average_velocity += i.velocity; 204 | average_position += i.position; 205 | } else { 206 | no_prey_counter += 1; 207 | } 208 | } 209 | 210 | if no_prey_counter == len { 211 | return vec2(0.0, 0.0); 212 | } 213 | 214 | average_velocity = average_velocity.div(len as f32); 215 | average_position = average_position.div(len as f32) ; 216 | 217 | average_velocity.sub(self.velocity) + (average_position.sub(self.position)) 218 | } 219 | } 220 | 221 | //HELPER FUNCTIONS 222 | fn set_velocity(max_vel: f32, min_vel: f32, vel: &Vec2) -> Vec2 { 223 | let vel_len = vel.length_squared(); 224 | 225 | let mut new_vel = vel.clone(); 226 | 227 | if vel_len > max_vel * max_vel { 228 | new_vel = vel.normalize_or_zero(); 229 | new_vel = new_vel.mul(max_vel); 230 | } else if vel_len < min_vel * min_vel { 231 | new_vel = vel.normalize_or_zero(); 232 | new_vel = new_vel.mul(min_vel); 233 | } 234 | new_vel 235 | } 236 | 237 | fn set_max_acc(max_acc: f32, acc: &Vec2) -> Vec2 { 238 | let acc_len = acc.length_squared(); 239 | 240 | let mut new_acc = acc.clone(); 241 | 242 | if acc_len > max_acc * max_acc { 243 | new_acc = acc.normalize_or_zero(); 244 | new_acc = new_acc.mul(max_acc); 245 | } 246 | new_acc 247 | } 248 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use nannou::prelude::*; 2 | 3 | mod boid; 4 | use boid::{Boid, BoidType}; 5 | 6 | fn main() { 7 | nannou::app(model).update(update).run(); 8 | } 9 | 10 | const NO_BOIDS: usize = 50; 11 | const NO_PREDATOR: usize = 2; 12 | 13 | struct Model { 14 | boids: Vec, 15 | } 16 | 17 | fn model(app: &App) -> Model { 18 | app.new_window() 19 | .size(1500, 900) 20 | .view(view) 21 | .build() 22 | .unwrap(); 23 | 24 | let mut boids = Vec::new(); 25 | 26 | for i in 0..NO_BOIDS { 27 | let boid = Boid::new( 28 | (random_f32() - 0.5) * 1000.0, 29 | (random_f32() - 0.5) * 800.0, 30 | 20.0, 31 | if i < NO_PREDATOR { 32 | BoidType::Predator 33 | } else { 34 | BoidType::Prey 35 | }, 36 | ); 37 | boids.push(boid); 38 | } 39 | 40 | Model { boids } 41 | } 42 | 43 | fn update(app: &App, model: &mut Model, _update: Update) { 44 | let screen_right = app.window_rect().right() as f32; 45 | let screen_top = app.window_rect().top() as f32; 46 | 47 | for i in 0..NO_BOIDS { 48 | let local_boids = model.boids[i].local_boids(&model.boids, i); 49 | 50 | if model.boids[i].nature == BoidType::Prey { 51 | let alignment = model.boids[i].alignment(&local_boids); 52 | let cohesion = model.boids[i].cohesion(&local_boids); 53 | let separation = model.boids[i].separation(&local_boids); 54 | 55 | let predator_avoidance = model.boids[i].avoid_predators(&local_boids); 56 | 57 | // Uncomment the code if you want preys to turn into predators 58 | if model.boids[i].convert_to_predator(&local_boids) { 59 | // model.boids[i].nature = BoidType::Predator 60 | } 61 | 62 | model.boids[i].acceleration += alignment + cohesion + separation + predator_avoidance; 63 | } else { 64 | let catch_prey = model.boids[i].catch_prey(&local_boids); 65 | let avoid_other_predators = model.boids[i].avoid_predators(&local_boids); 66 | 67 | model.boids[i].acceleration += catch_prey + avoid_other_predators; 68 | } 69 | 70 | model.boids[i].update(); 71 | model.boids[i].edge(screen_top, screen_right); 72 | } 73 | } 74 | 75 | fn view(app: &App, model: &Model, frame: Frame) { 76 | let draw = app.draw(); 77 | 78 | draw.background().color(GREY); 79 | 80 | for i in 0..NO_BOIDS { 81 | model.boids[i].show(&draw); 82 | } 83 | 84 | draw.to_frame(app, &frame).unwrap(); 85 | } 86 | --------------------------------------------------------------------------------