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 480d6a67841a9f843bfe9caf42364495be048a04
parent 167e9cc21fcec1d88ed2438f6e6b9b0897c04de5
Author: Joël Lupien (Jojolepro) <jojolepromain@gmail.com>
Date:   Mon, 26 Feb 2018 20:43:51 -0500

progress

Diffstat:
MCargo.lock | 48++++++++++++++++++++++++------------------------
MCargo.toml | 2+-
Msrc/main.rs | 37+++++++++++++++++++++++++++++--------
3 files changed, 54 insertions(+), 33 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -18,7 +18,7 @@ dependencies = [ [[package]] name = "amethyst" version = "0.6.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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)", @@ -27,7 +27,7 @@ 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)", "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_ui 0.2.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)", @@ -44,7 +44,7 @@ dependencies = [ [[package]] name = "amethyst-rhusics" version = "0.1.0" -source = "git+https://github.com/amethyst/amethyst-rhusics#43d825e4418a83ac6bade1ed6b1c6a6f1f654ca2" +source = "git+https://github.com/amethyst/amethyst-rhusics?branch=fix/docs#227d4c940f0ca42b8de61a469c668dac57a19e64" 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)", @@ -57,7 +57,7 @@ dependencies = [ [[package]] name = "amethyst_assets" version = "0.2.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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)", @@ -173,11 +173,12 @@ dependencies = [ [[package]] name = "amethyst_ui" -version = "0.1.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" +version = "0.2.0" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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)", + "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)", "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)", @@ -196,7 +197,7 @@ dependencies = [ [[package]] name = "amethyst_utils" version = "0.2.0" -source = "git+https://github.com/amethyst/amethyst?branch=develop#ba233edd0d6edf35b68b55465a9244fb156af859" +source = "git+https://github.com/amethyst/amethyst?branch=develop#efa39a7acc7d2228347ae6c458c3956f732dee67" 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 +248,7 @@ 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)", - "rustc-demangle 0.1.6 (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)", ] @@ -308,7 +309,7 @@ name = "cgl" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gleam 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", ] @@ -732,11 +733,10 @@ dependencies = [ [[package]] name = "gleam" -version = "0.4.21" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -944,7 +944,7 @@ 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)", + "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1243,7 +1243,7 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1637,7 +1637,7 @@ name = "world-digger" version = "0.1.0" dependencies = [ "amethyst 0.6.0 (git+https://github.com/amethyst/amethyst?branch=develop)", - "amethyst-rhusics 0.1.0 (git+https://github.com/amethyst/amethyst-rhusics)", + "amethyst-rhusics 0.1.0 (git+https://github.com/amethyst/amethyst-rhusics?branch=fix/docs)", "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)", @@ -1691,7 +1691,7 @@ dependencies = [ "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/amethyst/amethyst?branch=develop)" = "<none>" -"checksum amethyst-rhusics 0.1.0 (git+https://github.com/amethyst/amethyst-rhusics)" = "<none>" +"checksum amethyst-rhusics 0.1.0 (git+https://github.com/amethyst/amethyst-rhusics?branch=fix/docs)" = "<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>" @@ -1699,7 +1699,7 @@ dependencies = [ "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_ui 0.2.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" @@ -1762,7 +1762,7 @@ dependencies = [ "checksum gl_generator 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3e0220a68b8875b5a311fe67ee3b76d3d9b719a92277aff0ec5bb5e7b0ec1" "checksum gl_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f5c19cde55637681450c92f7a05ea16c78e2b6d0587e601ec1ebdab6960854b" "checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a" -"checksum gleam 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)" = "32ef9deead9e21b757450f0279eeceed0d83a4fdaa007738ac34eb90dd435aed" +"checksum gleam 0.4.23 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a7f5351837630a7dd0cd6d7976de547929f9fabd381b9d5ac35f82e90be2" "checksum glutin 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "247f825056c99961b6e6e0baef17ca586a50109ab4bba2b370babe1c5d702943" "checksum hetseq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe13b9e03ea85e9efb4cd214c760399619f5e9ad0b36d8656b6649f03645063" "checksum hibitset 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b78998e3c243d71525596e8f373dfc4b82703f25907b9e4d260383cff8307d84" @@ -1824,7 +1824,7 @@ dependencies = [ "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-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11fb43a206a04116ffd7cfcf9bcb941f8eb6cc7ff667272246b0a1c74259a3cb" "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" diff --git a/Cargo.toml b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Joël Lupien (Jojolepro) <jojolepromain@gmail.com>"] [dependencies] amethyst = { git = "https://github.com/amethyst/amethyst", branch = "develop" } -amethyst-rhusics = { git = "https://github.com/amethyst/amethyst-rhusics" } +amethyst-rhusics = { git = "https://github.com/amethyst/amethyst-rhusics", branch = "fix/docs" } rhusics-ecs = { version = "0.1", features = ["eders"] } rhusics-core = { version = "0.1", features = ["specs", "eders"] } specs = "0.10" diff --git a/src/main.rs b/src/main.rs @@ -21,10 +21,10 @@ 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_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}; +use amethyst::core::cgmath::{Deg, Array, Basis3,Basis2, One, Point3, Quaternion, Vector3,Matrix3,Zero}; pub type Shape = CollisionShape<Primitive3<f32>, BodyPose3<f32>, Aabb3<f32>, ObjectType>; @@ -70,7 +70,7 @@ impl State for ExampleState { let radius = 4; - let cube_size = 1.0; + let cube_size = 3.0; let mut comps: Vec<(Material, Transform)> = vec![]; @@ -100,29 +100,50 @@ impl State for ExampleState { }; world.register::<ObjectType>(); - world.write_resource::<EventChannel<ContactEvent<Entity, Point3<f32>>>>(); + //world.write_resource::<EventChannel<ContactEvent<Entity, Point3<f32>>>>(); while let Some(c) = comps.pop(){ world .create_entity() .with(cube.clone()) .with(c.0) - .with(c.1) .with(GlobalTransform::default()) - .with_static_rigid_body( + .with_dynamic_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()), + BodyPose3::new(Point3::new(c.1.translation.x, c.1.translation.y,c.1.translation.z), Quaternion::one()), + Velocity::<Vector3<f32>,Vector3<f32>>::new(Vector3::new(0.0,-10.0,0.0),Vector3::zero()), RigidBody::default(), - Mass3::infinite(), + Mass3::new(1.0), ) + .with(c.1) .build(); } + + let mut trans = Transform::default(); + trans.translation = Vector3::new(0.0, -20.0, 0.0); + world + .create_entity() + .with(GlobalTransform::default()) + .with_static_rigid_body( + Shape::new_simple_with_type( + CollisionStrategy::FullResolution, + CollisionMode::Discrete, + Cuboid::new(50.0, 0.5,50.0).into(), + ObjectType::Box, + ), + BodyPose3::new(Point3::new(trans.translation.x, trans.translation.y,trans.translation.z), Quaternion::one()), + RigidBody::default(), + Mass3::infinite(), + ) + .with(trans) + .build(); + world.add_resource(AmbientColor(Rgba::from([1.0; 3]))); }