diff --git a/.github/workflows/salva-ci-build.yml b/.github/workflows/salva-ci-build.yml index 0fba918..e9b947f 100644 --- a/.github/workflows/salva-ci-build.yml +++ b/.github/workflows/salva-ci-build.yml @@ -2,17 +2,17 @@ name: Salva CI build on: push: - branches: [ master ] - pull_request: - branches: [ master ] + branches: [master] + pull_request: + branches: [master] jobs: check-fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Check formatting - run: cargo fmt -- --check + - uses: actions/checkout@v2 + - name: Check formatting + run: cargo fmt -- --check build-native: runs-on: ubuntu-latest env: @@ -22,10 +22,10 @@ jobs: package: [salva2d, salva3d] feature: [default, parallel, sampling, parry, rapier, rapier-testbed] steps: - - uses: actions/checkout@v2 - - run: sudo apt-get install -y cmake libxcb-composite0-dev - - name: build ${{ matrix.package }} --features ${{ matrix.feature }} - run: cargo build --verbose -p ${{ matrix.package }} --features ${{ matrix.feature }} + - uses: actions/checkout@v2 + - run: sudo apt-get install -y cmake libxcb-composite0-dev + - name: build ${{ matrix.package }} --features ${{ matrix.feature }} + run: cargo build --verbose -p ${{ matrix.package }} --features ${{ matrix.feature }} all-features-native: runs-on: ubuntu-latest env: @@ -34,10 +34,10 @@ jobs: matrix: package: [salva2d, salva3d] steps: - - uses: actions/checkout@v2 - - run: sudo apt-get install -y cmake - - name: build ${{ matrix.package }} --all-features - run: cargo build --verbose -p ${{ matrix.package }} --all-features + - uses: actions/checkout@v2 + - run: sudo apt-get install -y cmake + - name: build ${{ matrix.package }} --all-features + run: cargo build --verbose -p ${{ matrix.package }} --all-features test-native: runs-on: ubuntu-latest env: @@ -46,10 +46,10 @@ jobs: matrix: package: [salva2d, salva3d] steps: - - uses: actions/checkout@v2 - - run: sudo apt-get install -y cmake - - name: test ${{ matrix.package }} - run: cargo test --verbose -p ${{ matrix.package }} + - uses: actions/checkout@v2 + - run: sudo apt-get install -y cmake + - name: test ${{ matrix.package }} + run: cargo test --verbose -p ${{ matrix.package }} examples-native: runs-on: ubuntu-latest env: @@ -59,22 +59,22 @@ jobs: package: [examples2d, examples3d] feature: [default, parallel] steps: - - uses: actions/checkout@v2 - - run: sudo apt-get install -y cmake libxcb-composite0-dev libx11-dev libasound2-dev libudev-dev - - name: build ${{ matrix.package }} --features ${{ matrix.feature }} - run: cargo build --verbose -p ${{ matrix.package }} --features ${{ matrix.feature }} + - uses: actions/checkout@v2 + - run: sudo apt-get install -y cmake libxcb-composite0-dev libx11-dev libasound2-dev libudev-dev + - name: build ${{ matrix.package }} --features ${{ matrix.feature }} + run: cargo build --verbose -p ${{ matrix.package }} --features ${{ matrix.feature }} build-wasm: runs-on: ubuntu-latest env: RUSTFLAGS: -D warnings strategy: matrix: - package: [salva2d, salva3d] + package: [salva2d, salva3d] steps: - uses: actions/checkout@v2 - run: rustup target add wasm32-unknown-unknown - name: wasm build ${{ matrix.package }} - run: cargo build -p ${{ matrix.package }} --verbose --features wasm-bindgen --target wasm32-unknown-unknown; + run: cargo build -p ${{ matrix.package }} --verbose --target wasm32-unknown-unknown; # build-wasm-emscripten: # runs-on: ubuntu-latest # env: diff --git a/Cargo.toml b/Cargo.toml index dc9065a..7945542 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,17 +22,12 @@ salva3d = { path = "./build/salva3d" } #rapier_testbed2d = { git = "https://github.com/dimforge/rapier", branch = "split_geom" } #rapier_testbed3d = { git = "https://github.com/dimforge/rapier", branch = "split_geom" } -#rapier2d = { git = "https://github.com/dimforge/rapier" } -#rapier3d = { git = "https://github.com/dimforge/rapier" } -#rapier_testbed2d = { git = "https://github.com/dimforge/rapier" } -#rapier_testbed3d = { git = "https://github.com/dimforge/rapier" } - -# rapier2d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } -# rapier3d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } -# rapier_testbed2d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } -# rapier_testbed3d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } - -# rapier2d = { path = "../rapier/build/rapier2d" } -# rapier3d = { path = "../rapier/build/rapier3d" } -# rapier_testbed2d = { path = "../rapier/build/rapier_testbed2d" } -# rapier_testbed3d = { path = "../rapier/build/rapier_testbed3d" } +rapier2d = { git = "https://github.com/dimforge/rapier", rev = "cf77b5bf574f8363794f979510deec5c08e58401" } +rapier3d = { git = "https://github.com/dimforge/rapier", rev = "cf77b5bf574f8363794f979510deec5c08e58401" } +rapier_testbed2d = { git = "https://github.com/dimforge/rapier", rev = "cf77b5bf574f8363794f979510deec5c08e58401" } +rapier_testbed3d = { git = "https://github.com/dimforge/rapier", rev = "cf77b5bf574f8363794f979510deec5c08e58401" } + +# rapier2d = { path = "../rapier/crates/rapier2d" } +# rapier3d = { path = "../rapier/crates/rapier3d" } +# rapier_testbed2d = { path = "../rapier/crates/rapier_testbed2d" } +# rapier_testbed3d = { path = "../rapier/crates/rapier_testbed3d" } diff --git a/build/salva2d/Cargo.toml b/build/salva2d/Cargo.toml index 425538c..d2fe5e4 100644 --- a/build/salva2d/Cargo.toml +++ b/build/salva2d/Cargo.toml @@ -18,6 +18,11 @@ keywords = ["physics", "dynamics", "particles", "fluids", "SPH"] license = "Apache-2.0" edition = "2021" +[lints] +rust.unexpected_cfgs = { level = "warn", check-cfg = [ + 'cfg(feature, values("dim3"))', +] } + [badges] maintenance = { status = "actively-developed" } @@ -30,14 +35,8 @@ rapier = ["parry", "rapier2d"] rapier-testbed = ["rapier", "rapier_testbed2d", "graphics"] rapier-harness = ["rapier-testbed"] parry = ["parry2d"] -wasm-bindgen = ["rapier2d/wasm-bindgen"] graphics = ["bevy", "bevy_egui"] -[lints] -rust.unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(feature, values("dim3"))', -] } - [lib] name = "salva2d" path = "../../src/lib.rs" @@ -53,15 +52,15 @@ instant = { version = "0.1", features = ["now"] } rayon = { version = "1.8", optional = true } nalgebra = "0.33" -parry2d = { version = "0.16", optional = true } -rapier2d = { version = "0.21", optional = true } -rapier_testbed2d = { version = "0.21", optional = true } +parry2d = { version = "0.17", optional = true } +rapier2d = { version = "0.22", optional = true } +rapier_testbed2d = { version = "0.22", optional = true } -bevy_egui = { version = "0.26", features = ["immutable_ctx"], optional = true } +bevy_egui = { version = "0.29", features = ["immutable_ctx"], optional = true } bitflags = "2" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = { version = "0.13.2", default-features = false, features = [ +bevy = { version = "0.14", default-features = false, features = [ "bevy_winit", "bevy_render", "x11", @@ -69,7 +68,7 @@ bevy = { version = "0.13.2", default-features = false, features = [ # Dependencies for WASM only. [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = { version = "0.13", default-features = false, features = [ +bevy = { version = "0.14", default-features = false, features = [ "bevy_winit", "bevy_render", ], optional = true } diff --git a/build/salva3d/Cargo.toml b/build/salva3d/Cargo.toml index 75e2cf0..673742c 100644 --- a/build/salva3d/Cargo.toml +++ b/build/salva3d/Cargo.toml @@ -25,7 +25,6 @@ sampling = ["rapier"] rapier-testbed = ["rapier", "rapier_testbed3d", "graphics"] rapier-harness = ["rapier-testbed"] parry = ["parry3d"] -wasm-bindgen = ["rapier3d/wasm-bindgen"] graphics = ["bevy", "bevy_egui"] [lib] @@ -43,15 +42,15 @@ instant = { version = "0.1", features = ["now"] } rayon = { version = "1.8", optional = true } nalgebra = "0.33" -parry3d = { version = "0.16", optional = true } -rapier3d = { version = "0.21", optional = true } -rapier_testbed3d = { version = "0.21", optional = true } +parry3d = { version = "0.17", optional = true } +rapier3d = { version = "0.22", optional = true } +rapier_testbed3d = { version = "0.22", optional = true } -bevy_egui = { version = "0.26", features = ["immutable_ctx"], optional = true } +bevy_egui = { version = "0.29", features = ["immutable_ctx"], optional = true } bitflags = "2.6.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = { version = "0.13", default-features = false, features = [ +bevy = { version = "0.14", default-features = false, features = [ "bevy_winit", "bevy_render", "x11", @@ -59,7 +58,7 @@ bevy = { version = "0.13", default-features = false, features = [ # Dependencies for WASM only. [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = { version = "0.13", default-features = false, features = [ +bevy = { version = "0.14", default-features = false, features = [ "bevy_winit", "bevy_render", ], optional = true } diff --git a/examples2d/Cargo.toml b/examples2d/Cargo.toml index ec07788..778a48b 100644 --- a/examples2d/Cargo.toml +++ b/examples2d/Cargo.toml @@ -1,25 +1,25 @@ [package] -name = "examples2d" +name = "examples2d" version = "0.1.0" -authors = [ "Sébastien Crozet " ] +authors = ["Sébastien Crozet "] edition = "2018" [features] default = [] -parallel = [ "rapier_testbed2d/parallel"] +parallel = ["rapier_testbed2d/parallel"] [dependencies] -Inflector = "0.11" -nalgebra = "0.33" -parry2d = "0.16" -rapier2d = "0.21" -rapier_testbed2d = "0.21" -parry3d = "0.16" -bevy = "0.13.2" +Inflector = "0.11" +nalgebra = "0.33" +parry2d = "0.17" +rapier2d = "0.22" +rapier_testbed2d = "0.22" +parry3d = "0.17" +bevy = "0.14" [dependencies.salva2d] path = "../build/salva2d" -features = [ "rapier", "rapier-testbed", "sampling" ] +features = ["rapier", "rapier-testbed", "sampling"] [target.wasm32-unknown-unknown.dependencies] stdweb = "0.4" @@ -27,9 +27,6 @@ stdweb = "0.4" [target.wasm32-unknown-emscripten.dependencies] stdweb = "0.4" -[target.asmjs-unknown-emscripten.dependencies] -stdweb = "0.4" - [[bin]] name = "all_examples2" path = "./all_examples2.rs" diff --git a/examples3d/Cargo.toml b/examples3d/Cargo.toml index cd71aeb..0d6a690 100644 --- a/examples3d/Cargo.toml +++ b/examples3d/Cargo.toml @@ -1,25 +1,25 @@ [package] -name = "examples3d" +name = "examples3d" version = "0.1.0" -authors = [ "Sébastien Crozet " ] +authors = ["Sébastien Crozet "] edition = "2018" [features] default = [] -parallel = [ "rapier_testbed3d/parallel", "salva3d/parallel"] +parallel = ["rapier_testbed3d/parallel", "salva3d/parallel"] [dependencies] num-traits = "0.2" -Inflector = "0.11" -nalgebra = "0.33" -rapier3d = "0.21" -rapier_testbed3d = "0.21" -parry3d = "0.16" -bevy = "0.13.2" +Inflector = "0.11" +nalgebra = "0.33" +rapier3d = "0.22" +rapier_testbed3d = "0.22" +parry3d = "0.17" +bevy = "0.14" [dependencies.salva3d] path = "../build/salva3d" -features = [ "rapier", "rapier-testbed", "sampling", "rapier-harness" ] +features = ["rapier", "rapier-testbed", "sampling", "rapier-harness"] [target.wasm32-unknown-unknown.dependencies] stdweb = "0.4" diff --git a/src/integrations/rapier/fluids_pipeline.rs b/src/integrations/rapier/fluids_pipeline.rs index 0881c86..2406d4e 100644 --- a/src/integrations/rapier/fluids_pipeline.rs +++ b/src/integrations/rapier/fluids_pipeline.rs @@ -126,7 +126,7 @@ impl ColliderCouplingSet { &'a mut self, colliders: &'a ColliderSet, bodies: &'a mut RigidBodySet, - ) -> ColliderCouplingManager { + ) -> ColliderCouplingManager<'a> { ColliderCouplingManager { coupling: self, colliders, diff --git a/src/integrations/rapier/testbed_plugin.rs b/src/integrations/rapier/testbed_plugin.rs index 8699dd1..aa7c246 100644 --- a/src/integrations/rapier/testbed_plugin.rs +++ b/src/integrations/rapier/testbed_plugin.rs @@ -2,6 +2,7 @@ use crate::math::{Isometry, Point, Real, Rotation, Translation, Vector}; use crate::object::{BoundaryHandle, FluidHandle}; use bevy::math::Quat; use bevy::prelude::{Assets, Commands, Mesh, Query, Transform}; +use bevy_egui::egui; use bevy_egui::{egui::ComboBox, egui::Window, EguiContexts}; #[cfg(feature = "dim3")] use na::Quaternion; @@ -487,7 +488,16 @@ impl TestbedPlugin for FluidsTestbedPlugin { || changed; } }); - + let counters = self.fluids_pipeline.liquid_world.counters; + let _ = egui::CollapsingHeader::new(format!( + "Total: {:.2}ms - {} fps", + counters.step_time.time(), + (1000.0 / counters.step_time.time()).round() + )) + .id_source("total_fluids") + .show(ui, |ui| { + let _ = ui.label(format!("{}", counters)); + }); if changed { // FIXME: not too sure what to do here for color // let fluid_handle = self