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 b73d3c2138bb0e8570ee09bbffec701e5c8ea86f
parent 480d6a67841a9f843bfe9caf42364495be048a04
Author: Joël Lupien (Jojolepro) <jojolepromain@gmail.com>
Date:   Fri,  2 Mar 2018 07:07:57 -0500

tried to integrate raycasts and fix physics

Diffstat:
MCargo.lock | 92++++++++++++++++++++++++++++++++++++++++----------------------------------------
Aingameui.png | 0
Msrc/main.rs | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
Msrc/player.rs | 31++++++++++++++++++++++++++++++-
4 files changed, 157 insertions(+), 56 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -11,14 +11,14 @@ name = "alsa-sys" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "amethyst" version = "0.6.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" 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)", @@ -57,7 +57,7 @@ dependencies = [ [[package]] name = "amethyst_assets" version = "0.2.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" dependencies = [ "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)", @@ -74,7 +74,7 @@ dependencies = [ [[package]] name = "amethyst_audio" version = "0.1.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" dependencies = [ "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)", @@ -89,7 +89,7 @@ dependencies = [ [[package]] name = "amethyst_config" version = "0.5.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" 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)", @@ -98,7 +98,7 @@ dependencies = [ [[package]] name = "amethyst_controls" version = "0.1.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" dependencies = [ "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)", @@ -112,7 +112,7 @@ dependencies = [ [[package]] name = "amethyst_core" version = "0.1.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" 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)", @@ -128,7 +128,7 @@ dependencies = [ [[package]] name = "amethyst_input" version = "0.2.1" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" dependencies = [ "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)", @@ -144,7 +144,7 @@ dependencies = [ [[package]] name = "amethyst_renderer" version = "0.6.1" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" dependencies = [ "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)", @@ -174,7 +174,7 @@ dependencies = [ [[package]] name = "amethyst_ui" version = "0.2.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" dependencies = [ "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)", @@ -197,7 +197,7 @@ dependencies = [ [[package]] name = "amethyst_utils" version = "0.2.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" +source = "git+https://github.com/amethyst/amethyst?branch=develop#db552a76139a4f2fba1fafcabc81f69fa95223e8" dependencies = [ "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)", @@ -247,7 +247,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -258,7 +258,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -310,7 +310,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gleam 0.4.23 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -368,7 +368,7 @@ dependencies = [ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -380,7 +380,7 @@ dependencies = [ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -403,7 +403,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -412,7 +412,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -420,7 +420,7 @@ name = "core-foundation-sys" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -428,7 +428,7 @@ name = "core-foundation-sys" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -439,7 +439,7 @@ dependencies = [ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -450,7 +450,7 @@ dependencies = [ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -460,7 +460,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "coreaudio-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -468,7 +468,7 @@ name = "coreaudio-sys" version = "0.1.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)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -481,7 +481,7 @@ dependencies = [ "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -584,7 +584,7 @@ name = "flate2" version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -751,7 +751,7 @@ dependencies = [ "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "shared_library 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -836,7 +836,7 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.36" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -875,7 +875,7 @@ name = "malloc_buf" version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -883,7 +883,7 @@ name = "memchr" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -891,7 +891,7 @@ name = "memmap" version = "0.6.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)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -906,7 +906,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1003,7 +1003,7 @@ name = "num_cpus" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1093,7 +1093,7 @@ name = "parking_lot_core" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1139,7 +1139,7 @@ version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1149,7 +1149,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1168,7 +1168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1321,7 +1321,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1429,7 +1429,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1441,7 +1441,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1457,7 +1457,7 @@ name = "time" version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1525,7 +1525,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "token_store 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-scanner 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-sys 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1621,7 +1621,7 @@ dependencies = [ "core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-client 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1661,7 +1661,7 @@ version = "2.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1670,7 +1670,7 @@ name = "xcb" 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)", + "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1775,7 +1775,7 @@ dependencies = [ "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" "checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" "checksum lewton 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c1b7b81410f7895d4793bae921cc62317c5500c6ef211c9c24cad778eda77c20" -"checksum libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1e5d97d6708edaa407429faa671b942dc0f2727222fb6b6539bf1db936e4b121" +"checksum libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "56aebce561378d99a0bb578f8cb15b6114d2a1814a6c7949bbe646d968bb4fa9" "checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" "checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" diff --git a/ingameui.png b/ingameui.png Binary files differ. diff --git a/src/main.rs b/src/main.rs @@ -10,7 +10,7 @@ use amethyst::config::Config; use amethyst::controls::{FlyControlTag,FlyControlBundle}; use amethyst::core::frame_limiter::FrameRateLimitStrategy; use amethyst::core::transform::{GlobalTransform, Transform, TransformBundle}; -use amethyst::ecs::{World,VecStorage,Component,Fetch,Entity}; +use amethyst::ecs::{World,VecStorage,Component,Fetch,Entity,System,Join,ReadStorage}; use amethyst::input::InputBundle; use amethyst::renderer::{AmbientColor, Camera, DisplayConfig, DrawShaded, ElementState, Event, KeyboardInput, Material, MaterialDefaults, MeshHandle, ObjFormat, @@ -19,12 +19,59 @@ use amethyst::renderer::{AmbientColor, Camera, DisplayConfig, DrawShaded, Elemen use amethyst::shrev::EventChannel; use amethyst_rhusics::{time_sync, DefaultBasicPhysicsBundle3}; -use collision::Aabb3; +use collision::{Aabb3,Ray3}; +use collision::dbvt::query_ray_closest; use collision::primitive::{Primitive3,Cuboid}; use rhusics_core::{CollisionShape, RigidBody,Collider,ContactEvent,Velocity}; use rhusics_ecs::WithRigidBody; -use rhusics_ecs::physics3d::{BodyPose3, CollisionMode, CollisionStrategy, Mass3}; -use amethyst::core::cgmath::{Deg, Array, Basis3,Basis2, One, Point3, Quaternion, Vector3,Matrix3,Zero}; +use rhusics_ecs::physics3d::{register_physics,BodyPose3, CollisionMode, + CollisionStrategy, Mass3,DynamicBoundingVolumeTree3,SpatialSortingSystem3,ContactEvent3, + SpatialCollisionSystem3,GJK3,CurrentFrameUpdateSystem3,NextFrameSetupSystem3,ContactResolutionSystem3}; +use amethyst::core::cgmath::{Deg, Array, Basis3,Basis2, One, Point3, Quaternion, Vector3,Matrix3,Zero,EuclideanSpace}; + + + +/* +TODO + +Raycast +Click mine +UI +-Layouting +-Macro for btn, auto layout by pos + + + + +*/ + + + + +struct RayCastSystem; + +impl<'a> System<'a> for RayCastSystem { + type SystemData = ( + Fetch<'a, DynamicBoundingVolumeTree3<f32>>, + ReadStorage<'a, Camera>, + ReadStorage<'a, Transform>, + ); + + fn run(&mut self, (tree,camera,transform): Self::SystemData) { + for (tr,_) in (&transform,&camera).join(){ + //let ray = Ray3::new(Point3::new(-4., 10., 0.), Vector3::new(0., -1., 0.)); + let forward = Quaternion::from(tr.rotation).conjugate() * Vector3::unit_z(); + let ray = Ray3::new(Point3::from_vec(tr.translation), forward); + if let Some((v, p)) = query_ray_closest(&*tree, ray) { + println!("hit bounding volume of {:?} at point {:?}", v.value, p); + } + } + } +} + + + + pub type Shape = CollisionShape<Primitive3<f32>, BodyPose3<f32>, Aabb3<f32>, ObjectType>; @@ -54,7 +101,15 @@ impl Component for ObjectType { struct ExampleState; impl State for ExampleState { - fn on_start(&mut self, world: &mut World) { + fn on_start(&mut self, mut world: &mut World) { + register_physics::<f32, ObjectType>(&mut world); + //world.register_physics_3d + + + + + + initialise_camera(world); let (mut comps,cube) = { @@ -99,11 +154,11 @@ impl State for ExampleState { (comps,cube) }; - world.register::<ObjectType>(); + //world.register::<ObjectType>(); //world.write_resource::<EventChannel<ContactEvent<Entity, Point3<f32>>>>(); while let Some(c) = comps.pop(){ - world + /*world .create_entity() .with(cube.clone()) .with(c.0) @@ -121,7 +176,7 @@ impl State for ExampleState { Mass3::new(1.0), ) .with(c.1) - .build(); + .build();*/ } @@ -207,6 +262,12 @@ fn run() -> Result<(), Error> { .clear_target([1.0, 0.6, 0.8, 1.0], 1.0) .with_pass(DrawShaded::<PosNormTex>::new()), ); + + // PHYSIC------------------------- + let mut channel = EventChannel::<ContactEvent<Entity,Point3<f32>>>::new(); + let reader_2 = channel + .register_reader(); + let mut game = Application::build(resources_directory, ExampleState)? .with_frame_limit(FrameRateLimitStrategy::Unlimited, 0) .with_bundle(FlyControlBundle::<String, String>::new( @@ -219,7 +280,18 @@ 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())? + //.with_bundle(DefaultBasicPhysicsBundle3::<f32,ObjectType>::new())? + + //PHYSICS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + .with(SpatialSortingSystem3::<f32, BodyPose3<f32>, ObjectType>::new(),"1",&[]) + .with(SpatialCollisionSystem3::<f32, BodyPose3<f32>, ObjectType>::new().with_narrow_phase(GJK3::new()),"2",&["1"]) + .with(CurrentFrameUpdateSystem3::<f32>::new(),"3",&["2"]) + .with(NextFrameSetupSystem3::<f32>::new(),"4",&["3"]) + //.with(RayCastSystem,"raycast_test",&["3"]) + .with(ContactResolutionSystem3::<f32>::new(reader_2),"5",&["4"]) + .with_resource(EventChannel::<ContactEvent<Entity,Point3<f32>>>::new()) + .with_resource(channel) .build()?; game.run(); Ok(()) diff --git a/src/player.rs b/src/player.rs @@ -1,8 +1,37 @@ +use specs::{VecStorage,Component}; + // tools, equipped, backpack, tool stats -struct Tool{ +struct Tool{ + pub use_time: f32, + pub mine_quantity: i32, + pub cost: i32, } struct Backpack{ + pub capacity: i32, + pub cost: i32, +} + +struct BlockInstance{ + pub weight_left: i32, +} + +impl Component for BlockInstance{ + type Storage = VecStorage<Self>; +} + +struct BlockDefinition{ + pub since_depth: i32, + pub weight: i32, +} + +struct BlockDefinitions{ + blocks: Vec<BlockDefinition>, +} +struct Inventory{ + pub tool: Tool, + pub backpack: Backpack, + pub carrying: i32, } \ No newline at end of file