gdritter repos wenaglia / 37af6c0
Bad first pass at using ncollide Getty Ritter 4 years ago
7 changed file(s) with 236 addition(s) and 7 deletion(s). Collapse all Expand all
2121 "approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
2222 "num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
2323 "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
24 ]
25
26 [[package]]
27 name = "alga"
28 version = "0.9.0"
29 source = "registry+https://github.com/rust-lang/crates.io-index"
30 dependencies = [
31 "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
32 "libm 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
33 "num-complex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
34 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
2435 ]
2536
2637 [[package]]
5566 name = "approx"
5667 version = "0.1.1"
5768 source = "registry+https://github.com/rust-lang/crates.io-index"
69
70 [[package]]
71 name = "approx"
72 version = "0.3.2"
73 source = "registry+https://github.com/rust-lang/crates.io-index"
74 dependencies = [
75 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
76 ]
5877
5978 [[package]]
6079 name = "arrayvec"
419438 ]
420439
421440 [[package]]
441 name = "downcast-rs"
442 version = "1.0.3"
443 source = "registry+https://github.com/rust-lang/crates.io-index"
444
445 [[package]]
422446 name = "draw_state"
423447 version = "0.8.0"
424448 source = "registry+https://github.com/rust-lang/crates.io-index"
449473 ]
450474
451475 [[package]]
476 name = "fixedbitset"
477 version = "0.1.9"
478 source = "registry+https://github.com/rust-lang/crates.io-index"
479
480 [[package]]
452481 name = "flate2"
453482 version = "1.0.6"
454483 source = "registry+https://github.com/rust-lang/crates.io-index"
483512 source = "registry+https://github.com/rust-lang/crates.io-index"
484513 dependencies = [
485514 "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
515 "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
516 ]
517
518 [[package]]
519 name = "generic-array"
520 version = "0.12.0"
521 source = "registry+https://github.com/rust-lang/crates.io-index"
522 dependencies = [
486523 "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
487524 ]
488525
705742 ]
706743
707744 [[package]]
745 name = "libm"
746 version = "0.1.2"
747 source = "registry+https://github.com/rust-lang/crates.io-index"
748
749 [[package]]
708750 name = "linked-hash-map"
709751 version = "0.5.1"
710752 source = "registry+https://github.com/rust-lang/crates.io-index"
777819 [[package]]
778820 name = "matrixmultiply"
779821 version = "0.1.15"
822 source = "registry+https://github.com/rust-lang/crates.io-index"
823 dependencies = [
824 "rawpointer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
825 ]
826
827 [[package]]
828 name = "matrixmultiply"
829 version = "0.2.2"
780830 source = "registry+https://github.com/rust-lang/crates.io-index"
781831 dependencies = [
782832 "rawpointer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
858908 ]
859909
860910 [[package]]
911 name = "nalgebra"
912 version = "0.18.0"
913 source = "registry+https://github.com/rust-lang/crates.io-index"
914 dependencies = [
915 "alga 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
916 "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
917 "generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
918 "matrixmultiply 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
919 "num-complex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
920 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
921 "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
922 "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
923 ]
924
925 [[package]]
926 name = "ncollide2d"
927 version = "0.19.0"
928 source = "registry+https://github.com/rust-lang/crates.io-index"
929 dependencies = [
930 "alga 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
931 "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
932 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
933 "downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
934 "either 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
935 "nalgebra 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
936 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
937 "petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
938 "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
939 "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
940 "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
941 ]
942
943 [[package]]
861944 name = "nodrop"
862945 version = "0.1.13"
863946 source = "registry+https://github.com/rust-lang/crates.io-index"
894977 ]
895978
896979 [[package]]
980 name = "num-complex"
981 version = "0.2.1"
982 source = "registry+https://github.com/rust-lang/crates.io-index"
983 dependencies = [
984 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
985 ]
986
987 [[package]]
897988 name = "num-derive"
898989 version = "0.2.4"
899990 source = "registry+https://github.com/rust-lang/crates.io-index"
9751066 "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
9761067 "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
9771068 ]
1069
1070 [[package]]
1071 name = "ordermap"
1072 version = "0.3.5"
1073 source = "registry+https://github.com/rust-lang/crates.io-index"
9781074
9791075 [[package]]
9801076 name = "owning_ref"
10371133 name = "peeking_take_while"
10381134 version = "0.1.2"
10391135 source = "registry+https://github.com/rust-lang/crates.io-index"
1136
1137 [[package]]
1138 name = "petgraph"
1139 version = "0.4.13"
1140 source = "registry+https://github.com/rust-lang/crates.io-index"
1141 dependencies = [
1142 "fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
1143 "ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
1144 ]
10401145
10411146 [[package]]
10421147 name = "pkg-config"
14321537 dependencies = [
14331538 "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
14341539 ]
1540
1541 [[package]]
1542 name = "slab"
1543 version = "0.4.2"
1544 source = "registry+https://github.com/rust-lang/crates.io-index"
14351545
14361546 [[package]]
14371547 name = "smallvec"
16561766 dependencies = [
16571767 "ggez 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
16581768 "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1769 "nalgebra 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
1770 "ncollide2d 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
16591771 "sdl2 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)",
16601772 "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
16611773 "specs-derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
17401852 "checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
17411853 "checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5"
17421854 "checksum alga 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "88c4144cd393075e782c633b4f9c5dea4811aed18ed59f518ae2ca2b553e3d09"
1855 "checksum alga 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a033171acc255e6d0c6490e701097632377c2435fdf084a2a4c0cbeb9e1395ac"
17431856 "checksum alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58"
17441857 "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
17451858 "checksum app_dirs2 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0aa02944d8a100b79057d1619032b1ad39de5eed6567cdeccbd53908b326e082"
17461859 "checksum approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94"
1860 "checksum approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3"
17471861 "checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71"
17481862 "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2"
17491863 "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
17851899 "checksum crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c"
17861900 "checksum deflate 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)" = "8a6abb26e16e8d419b5c78662aa9f82857c2386a073da266840e474d5055ec86"
17871901 "checksum derivative 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6073e9676dbebdddeabaeb63e3b7cefd23c86f5c41d381ee1237cc77b1079898"
1902 "checksum downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "18df8ce4470c189d18aa926022da57544f31e154631eb4cfe796aea97051fe6c"
17881903 "checksum draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651"
17891904 "checksum either 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c67353c641dc847124ea1902d69bd753dee9bb3beff9aa3662ecf86c971d1fac"
17901905 "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b"
17911906 "checksum euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c95fd0d455f114291a3109286bd387bd423770058474a2d3f38b712cd661df60"
1907 "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
17921908 "checksum flate2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2291c165c8e703ee54ef3055ad6188e3d51108e2ded18e9f2476e774fc5ad3d4"
17931909 "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
17941910 "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
17951911 "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
1912 "checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592"
17961913 "checksum generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fceb69994e330afed50c93524be68c42fa898c2d9fd4ee8da03bd7363acd26f2"
17971914 "checksum gfx 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7d7ce0c1f747245342a73453fdb098ea0764c430421fbc4d98cdc8ef8ede4834"
17981915 "checksum gfx_core 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c74932837e61f20956c3da1a47471513707dde300274812bba94373ab51830ae"
18171934 "checksum lewton 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c1b7b81410f7895d4793bae921cc62317c5500c6ef211c9c24cad778eda77c20"
18181935 "checksum libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)" = "aab692d7759f5cd8c859e169db98ae5b52c924add2af5fbbca11d12fefb567c1"
18191936 "checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9"
1937 "checksum libm 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "03c0bb6d5ce1b5cc6fd0578ec1cbc18c9d88b5b591a5c7c1d6c6175e266a0819"
18201938 "checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e"
18211939 "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c"
18221940 "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
18271945 "checksum lyon_tessellation 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cc4db444ab87e187c29286f0f2aab6e93380f0e6ae064a2140078698b3d924a7"
18281946 "checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084"
18291947 "checksum matrixmultiply 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "dcad67dcec2d58ff56f6292582377e6921afdf3bfbd533e26fb8900ae575e002"
1948 "checksum matrixmultiply 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfed72d871629daa12b25af198f110e8095d7650f5f4c61c5bac28364604f9b"
18301949 "checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a"
18311950 "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
18321951 "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
18361955 "checksum mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915"
18371956 "checksum msdos_time 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aad9dfe950c057b1bfe9c1f2aa51583a8468ef2a5baba2ebbe06d775efeb7729"
18381957 "checksum nalgebra 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3f73409a1a0876d9d7be16a7fb8fd7e0658df54098210c93a17d2d5e8ca7afe4"
1958 "checksum nalgebra 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e12856109b5cb8e2934b5e45e4624839416e1c6c1f7d286711a7a66b79db29d"
1959 "checksum ncollide2d 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0bca1a1b070a28a380cb452d979d05dcee1c1a14fdab0e9b0f88e2c3fff29643"
18391960 "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
18401961 "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b"
18411962 "checksum nonzero_signed 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "02783a0482333b0d3f5f5411b8fb60454a596696da041da0470ac9ef3e6e37d8"
18421963 "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e"
18431964 "checksum num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656"
1965 "checksum num-complex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "107b9be86cd2481930688277b675b0114578227f034674726605b8a482d8baf8"
18441966 "checksum num-derive 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d9fe8fcafd1b86a37ce8a1cfa15ae504817e0c8c2e7ad42767371461ac1d316d"
18451967 "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea"
18461968 "checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124"
18511973 "checksum ogg 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "013b78ceb7fb82555a2f8a95d8e40866fe64a5d15b83c51b3e1fdd40cd903ed3"
18521974 "checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c"
18531975 "checksum ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7eb5259643245d3f292c7a146b2df53bba24d7eab159410e648eb73dc164669d"
1976 "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
18541977 "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
18551978 "checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13"
18561979 "checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac"
18581981 "checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
18591982 "checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c"
18601983 "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
1984 "checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f"
18611985 "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
18621986 "checksum png 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f54b9600d584d3b8a739e1662a595fab051329eff43f20e7d8cc22872962145b"
18631987 "checksum podio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "780fb4b6698bbf9cf2444ea5d22411cef2953f0824b98f33cf454ec5615645bd"
19032027 "checksum shred-derive 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fcf34e5e5302d3024aba7afc291f6d1ca7573ed035d3c0796976ba3f10691a1"
19042028 "checksum shrev 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ec60ed6f60a4b3cdc2ceacf57215db3408fbd8990f66a38686a31558cd9da482"
19052029 "checksum sid 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "29e0a6006cf04d568a49363baca3dabddbbe46538f7c76692d405f5f5d140ecd"
2030 "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
19062031 "checksum smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c4488ae950c49d403731982257768f48fada354a5203fe81f9bb6f43ca9002be"
19072032 "checksum smart-default 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e7392ae8cdf79428cc98170bf264af7219887def8a30bb61d7ad2200313e88d"
19082033 "checksum specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "de65613ada4338aa7ba71eca60eca24c60483433eec0077bc4f33cfc31f4bdf0"
1010 itertools = "0.8"
1111 specs = "0.14"
1212 specs-derive = "0.4"
13 sdl2 = "0.31"
13 sdl2 = "0.31"
14 ncollide2d = "0.19"
15 nalgebra = "*"
1616 /// The `Position` component represents (in world coordinates) a thing
1717 /// that has a position in the world, measured from the top-left of
1818 /// the thing.
19 #[derive(Component, Debug)]
19 #[derive(Component, Debug, Clone)]
2020 #[storage(VecStorage)]
2121 pub struct Position {
2222 pub x: f32,
108108 pub has_collision: bool
109109 }
110110
111 #[derive(Component, Default, Debug)]
112 #[storage(NullStorage)]
113 pub struct Blocking;
111 #[derive(Component)]
112 #[storage(VecStorage)]
113 pub struct Blocking {
114 pub volume: Box<dyn ncollide2d::shape::Shape<f32>>,
115 }
116
117 impl Blocking {
118 pub fn new() -> Blocking { Default::default() }
119 }
120
121 impl Default for Blocking {
122 fn default() -> Blocking {
123 Blocking {
124 volume: Box::new(ncollide2d::shape::Cuboid::new(nalgebra::Vector2::new(11.0, 11.0))),
125 }
126 }
127 }
77 event::{self, EventHandler},
88 };
99
10 mod nc {
11 pub use ncollide2d::bounding_volume::*;
12 pub use ncollide2d::broad_phase::*;
13 pub use ncollide2d::narrow_phase::*;
14 }
1015 use sdl2::keyboard as sdl;
1116
1217 pub mod consts;
1419 pub mod game;
1520 pub mod res;
1621 pub mod sys;
22 pub mod types;
1723
1824 use game::MyGame;
1925
7278 ..Default::default()
7379 })
7480 .build()?;
81
7582 let image = ggez::graphics::Image::new(&mut ctx, "/spritesheet.png")?;
7683 let mut sprites = ggez::graphics::spritebatch::SpriteBatch::new(image);
7784 sprites.set_filter(ggez::graphics::FilterMode::Nearest);
7885 world.add_resource(sprites);
7986 world.add_resource(res::KeySet::new());
8087
88 let broad_phase: types::BPhase =
89 nc::DBVTBroadPhase::new(0.0f32);
90 world.add_resource(broad_phase);
91
92 let narrow_phase: types::NPhase =
93 nc::NarrowPhase::new(
94 Box::new(nc::DefaultContactDispatcher::new()),
95 Box::new(nc::DefaultProximityDispatcher::new()),
96 );
97 world.add_resource(narrow_phase);
98
8199 let mut my_game = MyGame { world };
82100
83101 event::run(&mut ctx, &mut my_game)
7070
7171 let e = if tilesets[0].tiles[n as usize].properties["pass"] ==
7272 tiled::PropertyValue::BoolValue(false) {
73 e.with(Blocking)
73 e.with(Blocking::new())
7474 } else {
7575 e
7676 };
9191 .with(Foreground)
9292 .with(Controlled)
9393 .with(Collision { has_collision: false })
94 .with(Blocking {
95 volume: Box::new(ncollide2d::shape::Ball::new(10.0)),
96 })
9497 .build();
9598 }
11 use crate::com::{Blocking, Collision, Velocity, Position};
2 use crate::types::{NPhase,BPhase};
23 use crate::game::MyGame;
34
5 use nalgebra::{Isometry2, Vector2};
6 use ncollide2d::broad_phase::{
7 ProxyHandle,
8 broad_phase::BroadPhase,
9 BroadPhaseInterferenceHandler,
10 };
411 use specs::{Join,RunNow};
12
13 struct InterferenceHandler<'a> {
14 collisions: specs::WriteStorage<'a, Collision>,
15 }
16
17 impl<'a> BroadPhaseInterferenceHandler<specs::Entity> for InterferenceHandler<'a> {
18 fn is_interference_allowed(&mut self, a: &specs::Entity, b: &specs::Entity) -> bool {
19 // Prevent self-collision.
20 *a != *b
21 }
22
23 fn interference_started(&mut self, a: &specs::Entity, b: &specs::Entity) {
24 self.collisions.get_mut(*a).map (|r| r.has_collision = true );
25 self.collisions.get_mut(*b).map (|r| r.has_collision = true );
26 }
27
28 fn interference_stopped(&mut self, _: &specs::Entity, _: &specs::Entity) {
29 }
30 }
31
32
33 struct Collide;
34
35 impl<'a> specs::System<'a> for Collide {
36 type SystemData = (
37 specs::Entities<'a>,
38 specs::ReadStorage<'a, Position>,
39 specs::ReadStorage<'a, Velocity>,
40 specs::ReadStorage<'a, Blocking>,
41 specs::WriteStorage<'a, Collision>,
42 specs::WriteExpect<'a, BPhase>,
43 specs::WriteExpect<'a, NPhase>,
44 );
45
46 fn run(&mut self, (entities, position, velocity, blocking, collisions, mut bf, _narrow): Self::SystemData) {
47 let handles: Vec<ProxyHandle> =
48 (&entities, &position, &blocking).join().map( |(e, pos, bl)| {
49 let np = if let Some(vel) = velocity.get(e) {
50 pos.moved(vel)
51 } else {
52 pos.clone()
53 };
54 bf.create_proxy(
55 bl.volume.aabb(&Isometry2::new(Vector2::new(pos.x, pos.y), nalgebra::zero())),
56 e,
57 )
58 }).collect();
59
60 bf.update(&mut InterferenceHandler {
61 collisions: collisions,
62 });
63
64 bf.remove(&handles, &mut |_, _| {});
65 }
66 }
567
668 struct Intersection;
769
61123 }
62124
63125 pub fn systems(game: &mut MyGame) {
64 Intersection.run_now(&game.world.res);
126 Collide.run_now(&game.world.res);
127 // Intersection.run_now(&game.world.res);
65128 Physics.run_now(&game.world.res);
66129 ResetCollision.run_now(&game.world.res);
67130 }
1 pub type BPhase =
2 ncollide2d::broad_phase::DBVTBroadPhase<f32, ncollide2d::bounding_volume::AABB<f32>, specs::Entity>;
3 pub type NPhase =
4 ncollide2d::narrow_phase::NarrowPhase<f32>;