world-digger-amethyst

[Archive] Game about Digging a lot using upgradable tools. Made using the Amethyst Engine. Might resume work on it eventually.
git clone https://git.jojolepro.com/world-digger-amethyst.git
Log | Files | Refs | README | LICENSE

commit 167e9cc21fcec1d88ed2438f6e6b9b0897c04de5
parent 591451f762f8b6400d4a920062c7d5b2a536180f
Author: Joël Lupien (Jojolepro) <jojolepromain@gmail.com>
Date:   Mon, 26 Feb 2018 19:46:57 -0500

Physic error

Diffstat:
MCargo.lock | 252+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------
MCargo.toml | 11+++++++++--
Msrc/main.rs | 61++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
Asrc/player.rs | 9+++++++++
4 files changed, 275 insertions(+), 58 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -18,17 +18,17 @@ dependencies = [ [[package]] name = "amethyst" version = "0.6.0" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" -dependencies = [ - "amethyst_assets 0.2.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_audio 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_config 0.5.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_controls 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_input 0.2.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_renderer 0.6.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_ui 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_utils 0.2.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" +dependencies = [ + "amethyst_assets 0.2.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_audio 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_config 0.5.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_controls 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_input 0.2.1 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_renderer 0.6.1 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_ui 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_utils 0.2.0 (git+https://github.com/amethyst/amethyst?branch=develop)", "derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fern 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -42,11 +42,24 @@ dependencies = [ ] [[package]] +name = "amethyst-rhusics" +version = "0.1.0" +source = "git+https://github.com/amethyst/amethyst-rhusics#43d825e4418a83ac6bade1ed6b1c6a6f1f654ca2" +dependencies = [ + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "collision 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rhusics-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rhusics-ecs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "shrev 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "amethyst_assets" version = "0.2.0" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ - "amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -61,10 +74,10 @@ dependencies = [ [[package]] name = "amethyst_audio" version = "0.1.0" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ - "amethyst_assets 0.2.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", + "amethyst_assets 0.2.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", "cpal 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rodio 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -76,7 +89,7 @@ dependencies = [ [[package]] name = "amethyst_config" version = "0.5.0" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ "ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -85,11 +98,11 @@ dependencies = [ [[package]] name = "amethyst_controls" version = "0.1.0" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ - "amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_input 0.2.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_renderer 0.6.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_input 0.2.1 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_renderer 0.6.1 (git+https://github.com/amethyst/amethyst?branch=develop)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "shred 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "specs 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -99,7 +112,7 @@ dependencies = [ [[package]] name = "amethyst_core" version = "0.1.0" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ "cgmath 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -115,10 +128,10 @@ dependencies = [ [[package]] name = "amethyst_input" version = "0.2.1" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ - "amethyst_config 0.5.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", + "amethyst_config 0.5.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", "derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -131,10 +144,10 @@ dependencies = [ [[package]] name = "amethyst_renderer" version = "0.6.1" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ - "amethyst_assets 0.2.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", + "amethyst_assets 0.2.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", "derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -161,11 +174,11 @@ dependencies = [ [[package]] name = "amethyst_ui" version = "0.1.0" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ - "amethyst_assets 0.2.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_renderer 0.6.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", + "amethyst_assets 0.2.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_renderer 0.6.1 (git+https://github.com/amethyst/amethyst?branch=develop)", "clipboard 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -183,11 +196,11 @@ dependencies = [ [[package]] name = "amethyst_utils" version = "0.2.0" -source = "git+https://github.com/jojolepro/amethyst?branch=cameracontrols#5ff90b4a84191de27cab6496d0471e21e2eff97e" +source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" dependencies = [ - "amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_input 0.2.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", - "amethyst_renderer 0.6.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", + "amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_input 0.2.1 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst_renderer 0.6.1 (git+https://github.com/amethyst/amethyst?branch=develop)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "shred 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "specs 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -248,6 +261,19 @@ dependencies = [ ] [[package]] +name = "bit-set" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bit-vec" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "bitflags" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -358,6 +384,19 @@ dependencies = [ ] [[package]] +name = "collision" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cgmath 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "core-foundation" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -886,6 +925,67 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "num" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-bigint 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "num-complex 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-bigint" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-complex" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-integer" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-iter" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-rational" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-bigint 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1096,6 +1196,30 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "rhusics-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cgmath 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "collision 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rhusics-ecs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cgmath 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "collision 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rhusics-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "shrev 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "rodio" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1123,6 +1247,11 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "rustc-serialize" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "rustc_version" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1248,6 +1377,7 @@ dependencies = [ "hibitset 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "shred 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "shred-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "tuple_utils 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1506,7 +1636,14 @@ dependencies = [ name = "world-digger" version = "0.1.0" dependencies = [ - "amethyst 0.6.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)", + "amethyst 0.6.0 (git+https://github.com/amethyst/amethyst?branch=develop)", + "amethyst-rhusics 0.1.0 (git+https://github.com/amethyst/amethyst-rhusics)", + "collision 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rhusics-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rhusics-ecs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "shrev 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1515,7 +1652,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "xcb 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "xcb 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1530,11 +1667,11 @@ dependencies = [ [[package]] name = "xcb" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1553,16 +1690,17 @@ dependencies = [ [metadata] "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" "checksum alsa-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9013f855a808ab924a4c08b5c1ec9bd6b04fdb2295b4d570fb723e0ed2802a4f" -"checksum amethyst 0.6.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_assets 0.2.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_audio 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_config 0.5.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_controls 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_core 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_input 0.2.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_renderer 0.6.1 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_ui 0.1.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" -"checksum amethyst_utils 0.2.0 (git+https://github.com/jojolepro/amethyst?branch=cameracontrols)" = "<none>" +"checksum amethyst 0.6.0 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst-rhusics 0.1.0 (git+https://github.com/amethyst/amethyst-rhusics)" = "<none>" +"checksum amethyst_assets 0.2.0 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst_audio 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst_config 0.5.0 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst_controls 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst_core 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst_input 0.2.1 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst_renderer 0.6.1 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst_ui 0.1.0 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" +"checksum amethyst_utils 0.2.0 (git+https://github.com/amethyst/amethyst?branch=develop)" = "<none>" "checksum android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" "checksum approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94" "checksum arrayvec 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)" = "06f59fe10306bb78facd90d28c2038ad23ffaaefa85bac43c8a434cde383334f" @@ -1570,6 +1708,8 @@ dependencies = [ "checksum atom 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4cd7b80cba09d9c6679f5ac66af2e5eb9c17fa1b914f142d690b069ba51eacaf" "checksum backtrace 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbbf59b1c43eefa8c3ede390fcc36820b4999f7914104015be25025e0d62af2" "checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661" +"checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" +"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" @@ -1584,6 +1724,7 @@ dependencies = [ "checksum clipboard-win 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14cc3e6c075926b96490d5f90d4a5af7be8012a4d8a8698e619655085a7641a3" "checksum cocoa 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac0d785ff4faf0ff23d7b5561346bb50dc7ef9a11cb0e65e07ef776b7752938f" "checksum cocoa 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0c23085dde1ef4429df6e5896b89356d35cdd321fb43afe3e378d010bb5adc6" +"checksum collision 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "485171691f4fbe75090777ebfdb5ea1d5596310718d46440dfc6193be77904d9" "checksum core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8047f547cd6856d45b1cdd75ef8d2f21f3d0e4bf1dab0a0041b0ae9a5dda9c0e" "checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" "checksum core-foundation-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "152195421a2e6497a8179195672e9d4ee8e45ed8c465b626f1606d27a08ebcd5" @@ -1647,6 +1788,12 @@ dependencies = [ "checksum mint 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "663bf700dcd81a0f8aac45cd0ca68fe37488becfe3a538f87fdb607a31e3c8ea" "checksum mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" +"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" +"checksum num-bigint 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "81b483ea42927c463e191802e7334556b48e7875297564c0e9951bd3a0ae53e3" +"checksum num-complex 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "26ff8edeab9f1d8cf6b595e35138c2a389ea29f4f57a0e6bc44abf406e4b0077" +"checksum num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d26da319fb45674985c78f1d1caf99aa4941f785d384a2ae36d0740bc3e2fe" +"checksum num-iter 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "4b226df12c5a59b63569dd57fafb926d91b385dfce33d8074a412411b689d593" +"checksum num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7de20f146db9d920c45ee8ed8f71681fd9ade71909b48c3acbd766aa504cf10" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" @@ -1673,9 +1820,12 @@ dependencies = [ "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" +"checksum rhusics-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab1311292fa4d03323e9a9cc77dc7f928e5bcb28a728b3a7e5124dcf35d521f0" +"checksum rhusics-ecs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bcff8ccd736c1017437d9bbef4d40a89f181e0beea0527d628de9769ad884486" "checksum rodio 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d75cd401c68ba027cb0862eb03cabe8bd6d14849e3a76f6dd832b55422a19847" "checksum ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "da06feaa07f69125ab9ddc769b11de29090122170b402547f64b86fe16ebc399" "checksum rustc-demangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f312457f8a4fa31d3581a6f423a70d6c33a10b95291985df55f1ff670ec10ce8" +"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum rustc_version_runtime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "90811d74046aca9c061fb9f7f2568c61696b7f218a7baad60a0f2ccae90efbd2" "checksum rusttype 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "24f3d32ca1619041480bd0b4756963762369f1d3f2fcc212c4877042f867b4ca" @@ -1724,6 +1874,6 @@ dependencies = [ "checksum winit 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "491e1305250e728fd9b8ef86ecef4e17a3293e87e51c7bc31e7a3913ec957d37" "checksum x11-clipboard 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2e7374c7699210cca7084ca61d57e09640fc744d1391808cb9ae2fe4ca9bd1df" "checksum x11-dl 2.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "29e78a65a3239e5511ffe2c832edb9224982ebf67bcaabc218ef1b07d8494b3e" -"checksum xcb 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "400cebeaedeca931825f11606874080f18aa51370dd3d7e11bc08d5aac8b3142" +"checksum xcb 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5e917a3f24142e9ff8be2414e36c649d47d6cc2ba81f16201cdef96e533e02de" "checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1" "checksum xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2" diff --git a/Cargo.toml b/Cargo.toml @@ -4,4 +4,11 @@ version = "0.1.0" authors = ["Joël Lupien (Jojolepro) <jojolepromain@gmail.com>"] [dependencies] -amethyst = { git = "https://github.com/jojolepro/amethyst", branch = "cameracontrols" }- \ No newline at end of file +amethyst = { git = "https://github.com/amethyst/amethyst", branch = "develop" } +amethyst-rhusics = { git = "https://github.com/amethyst/amethyst-rhusics" } +rhusics-ecs = { version = "0.1", features = ["eders"] } +rhusics-core = { version = "0.1", features = ["specs", "eders"] } +specs = "0.10" +shrev = "0.8" +collision = "0.14" +rand = "0.3"+ \ No newline at end of file diff --git a/src/main.rs b/src/main.rs @@ -1,19 +1,55 @@ extern crate amethyst; +extern crate amethyst_rhusics; +extern crate rhusics_core; +extern crate rhusics_ecs; +extern crate collision; use amethyst::{Application, Error, State, Trans}; use amethyst::assets::{Loader,AssetStorage}; use amethyst::config::Config; use amethyst::controls::{FlyControlTag,FlyControlBundle}; -use amethyst::core::cgmath::{Deg, Vector3}; use amethyst::core::frame_limiter::FrameRateLimitStrategy; use amethyst::core::transform::{GlobalTransform, Transform, TransformBundle}; -use amethyst::ecs::World; +use amethyst::ecs::{World,VecStorage,Component,Fetch,Entity}; use amethyst::input::InputBundle; use amethyst::renderer::{AmbientColor, Camera, DisplayConfig, DrawShaded, ElementState, Event, KeyboardInput, Material, MaterialDefaults, MeshHandle, ObjFormat, Pipeline, PosNormTex, Projection, RenderBundle, Rgba, Stage, VirtualKeyCode, WindowEvent,Texture}; -use amethyst::ecs::Fetch; +use amethyst::shrev::EventChannel; + +use amethyst_rhusics::{time_sync, DefaultBasicPhysicsBundle3}; +use collision::Aabb3; +use collision::primitive::{Primitive3,Cuboid}; +use rhusics_core::{CollisionShape, RigidBody,Collider,ContactEvent}; +use rhusics_ecs::WithRigidBody; +use rhusics_ecs::physics3d::{BodyPose3, CollisionMode, CollisionStrategy, Mass3}; +use amethyst::core::cgmath::{Deg, Array, Basis3,Basis2, One, Point3, Quaternion, Vector3}; + +pub type Shape = CollisionShape<Primitive3<f32>, BodyPose3<f32>, Aabb3<f32>, ObjectType>; + +#[repr(u8)] +#[derive(Debug, Clone, PartialOrd, PartialEq)] +pub enum ObjectType { + Box, +} + +impl Default for ObjectType { + fn default() -> Self { + ObjectType::Box + } +} + +impl Collider for ObjectType { + fn should_generate_contacts(&self, other: &ObjectType) -> bool { + self != other + } +} + +impl Component for ObjectType { + type Storage = VecStorage<Self>; +} + struct ExampleState; @@ -33,8 +69,8 @@ impl State for ExampleState { let tex_storage = world.read_resource(); - let radius = 10; - let cube_size = 2.0; + let radius = 4; + let cube_size = 1.0; let mut comps: Vec<(Material, Transform)> = vec![]; @@ -63,6 +99,9 @@ impl State for ExampleState { (comps,cube) }; + world.register::<ObjectType>(); + world.write_resource::<EventChannel<ContactEvent<Entity, Point3<f32>>>>(); + while let Some(c) = comps.pop(){ world .create_entity() @@ -70,6 +109,17 @@ impl State for ExampleState { .with(c.0) .with(c.1) .with(GlobalTransform::default()) + .with_static_rigid_body( + Shape::new_simple_with_type( + CollisionStrategy::FullResolution, + CollisionMode::Discrete, + Cuboid::new(1.0, 1.0,1.0).into(), + ObjectType::Box, + ), + BodyPose3::new(Point3::new(0.0, 0.0,0.0), Quaternion::one()), + RigidBody::default(), + Mass3::infinite(), + ) .build(); } @@ -148,6 +198,7 @@ fn run() -> Result<(), Error> { InputBundle::<String, String>::new().with_bindings_from_file(&key_bindings_path), )? .with_bundle(RenderBundle::new(pipeline_builder, Some(display_config)))? + .with_bundle(DefaultBasicPhysicsBundle3::<f32,ObjectType>::new())? .build()?; game.run(); Ok(()) diff --git a/src/player.rs b/src/player.rs @@ -0,0 +1,8 @@ +// tools, equipped, backpack, tool stats +struct Tool{ + +} + +struct Backpack{ + +}+ \ No newline at end of file