Skip to content

Commit

Permalink
update bevy 0.14 + fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Aug 26, 2024
1 parent 8ac39a3 commit b98b3fd
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 76 deletions.
15 changes: 10 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[workspace]
members = [ "build/salva2d", "build/salva3d", "examples2d", "examples3d" ]
members = ["build/salva2d", "build/salva3d", "examples2d", "examples3d"]
resolver = "2"

[workspace.lints]
rust.unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(feature, values("dim2", "dim3", "nphysics", "ncollide"))',
] }

[profile.release]
#lto = true
#codegen-units = 1
Expand Down Expand Up @@ -32,10 +37,10 @@ salva3d = { path = "./build/salva3d" }
# 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 = { path = "../rapier/crates/rapier2d" }
rapier3d = { path = "../rapier/crates/rapier3d" }
rapier_testbed2d = { path = "../rapier/crates/rapier_testbed2d" }
rapier_testbed3d = { path = "../rapier/crates/rapier_testbed3d" }

#nphysics2d = { path = "../nphysics/build/nphysics2d" }
#nphysics3d = { path = "../nphysics/build/nphysics3d" }
Expand Down
60 changes: 38 additions & 22 deletions build/salva2d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,56 +1,72 @@
[package]
name = "salva2d"
name = "salva2d"
version = "0.9.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
authors = ["Sébastien Crozet <[email protected]>"]
description = "2-dimensional particle-based fluid dynamics in Rust."
documentation = "https://salva.rs/docs"
homepage = "https://salva.rs"
repository = "https://github.com/dimforge/salva"
readme = "README.md"
categories = [ "science", "game-development", "mathematics", "simulation", "wasm"]
keywords = [ "physics", "dynamics", "particles", "fluids", "SPH" ]
categories = [
"science",
"game-development",
"mathematics",
"simulation",
"wasm",
]
keywords = ["physics", "dynamics", "particles", "fluids", "SPH"]
license = "Apache-2.0"
edition = "2021"

[lints]
workspace = true

[badges]
maintenance = { status = "actively-developed" }

[features]
default = [ "dim2" ]
dim2 = [ ]
parallel = [ "rayon" ]
sampling = [ "rapier" ]
rapier = [ "parry", "rapier2d" ]
rapier-testbed = [ "rapier", "rapier_testbed2d", "graphics" ]
rapier-harness = [ "rapier-testbed" ]
parry = [ "parry2d" ]
wasm-bindgen = [ "rapier2d/wasm-bindgen" ]
graphics = [ "bevy", "bevy_egui" ]
default = ["dim2"]
dim2 = []
parallel = ["rayon"]
sampling = ["rapier"]
rapier = ["parry", "rapier2d"]
rapier-testbed = ["rapier", "rapier_testbed2d", "graphics"]
rapier-harness = ["rapier-testbed"]
parry = ["parry2d"]
wasm-bindgen = ["rapier2d/wasm-bindgen"]
graphics = ["bevy", "bevy_egui"]

[lib]
name = "salva2d"
path = "../../src/lib.rs"
required-features = [ "dim2" ]
required-features = ["dim2"]

[dependencies]
approx = "0.5"
num-traits = "0.2"
fnv = "1.0"
itertools = "0.13"
generational-arena = "0.2"
instant = { version = "0.1", features = [ "now" ] }
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 }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = { version = "0.13.2", default-features = false, features = ["bevy_winit", "bevy_render", "x11"], optional = true }
bevy = { version = "0.14", default-features = false, features = [
"bevy_winit",
"bevy_render",
"x11",
], optional = true }

# Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render"], optional = true }
bevy = { version = "0.14", default-features = false, features = [
"bevy_winit",
"bevy_render",
], optional = true }
52 changes: 31 additions & 21 deletions build/salva3d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,52 +1,62 @@
[package]
name = "salva3d"
name = "salva3d"
version = "0.9.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
authors = ["Sébastien Crozet <[email protected]>"]
description = "3-dimensional particle-based fluid dynamics in Rust."
documentation = "https://salva.rs/rustdoc/salva3d/index.html"
homepage = "https://salva.rs"
repository = "https://github.com/dimforge/salva"
readme = "README.md"
keywords = [ "physics", "dynamics", "particles", "fluids", "SPH" ]
keywords = ["physics", "dynamics", "particles", "fluids", "SPH"]
license = "Apache-2.0"
edition = "2021"

[features]
default = [ "dim3" ]
dim3 = [ ]
parallel = [ "rayon" ]
rapier = [ "parry", "rapier3d" ]
sampling = [ "rapier" ]
rapier-testbed = [ "rapier", "rapier_testbed3d", "graphics" ]
rapier-harness = [ "rapier-testbed" ]
parry = [ "parry3d" ]
wasm-bindgen = [ "rapier3d/wasm-bindgen" ]
graphics = [ "bevy", "bevy_egui" ]
default = ["dim3"]
dim3 = []
parallel = ["rayon"]
rapier = ["parry", "rapier3d"]
sampling = ["rapier"]
rapier-testbed = ["rapier", "rapier_testbed3d", "graphics"]
rapier-harness = ["rapier-testbed"]
parry = ["parry3d"]
wasm-bindgen = ["rapier3d/wasm-bindgen"]
graphics = ["bevy", "bevy_egui"]

[lints]
workspace = true

[lib]
name = "salva3d"
path = "../../src/lib.rs"
required-features = [ "dim3" ]
required-features = ["dim3"]

[dependencies]
approx = "0.5"
num-traits = "0.2"
fnv = "1.0"
itertools = "0.13"
generational-arena = "0.2"
instant = { version = "0.1", features = [ "now" ] }
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 }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render", "x11"], optional = true }
bevy = { version = "0.14", default-features = false, features = [
"bevy_winit",
"bevy_render",
"x11",
], optional = true }

# Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render"], optional = true }
bevy = { version = "0.14", default-features = false, features = [
"bevy_winit",
"bevy_render",
], optional = true }
25 changes: 11 additions & 14 deletions examples2d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
[package]
name = "examples2d"
name = "examples2d"
version = "0.1.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
authors = ["Sébastien Crozet <[email protected]>"]
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"

[target.wasm32-unknown-emscripten.dependencies]
stdweb = "0.4"

[target.asmjs-unknown-emscripten.dependencies]
stdweb = "0.4"

[[bin]]
name = "all_examples2"
path = "./all_examples2.rs"
4 changes: 2 additions & 2 deletions examples2d/all_examples2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn demo_name_from_command_line() -> Option<String> {
None
}

#[cfg(any(target_arch = "wasm32", target_arch = "asmjs"))]
#[cfg(any(target_arch = "wasm32"))]
fn demo_name_from_url() -> Option<String> {
let window = stdweb::web::window();
let hash = window.location()?.search().ok()?;
Expand All @@ -34,7 +34,7 @@ fn demo_name_from_url() -> Option<String> {
}
}

#[cfg(not(any(target_arch = "wasm32", target_arch = "asmjs")))]
#[cfg(not(any(target_arch = "wasm32")))]
fn demo_name_from_url() -> Option<String> {
None
}
Expand Down
20 changes: 10 additions & 10 deletions examples3d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[package]
name = "examples3d"
name = "examples3d"
version = "0.1.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
authors = ["Sébastien Crozet <[email protected]>"]
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"
Expand Down
4 changes: 2 additions & 2 deletions examples3d/all_examples3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn demo_name_from_command_line() -> Option<String> {
None
}

#[cfg(any(target_arch = "wasm32", target_arch = "asmjs"))]
#[cfg(any(target_arch = "wasm32"))]
fn demo_name_from_url() -> Option<String> {
None
// let window = stdweb::web::window();
Expand All @@ -39,7 +39,7 @@ fn demo_name_from_url() -> Option<String> {
// }
}

#[cfg(not(any(target_arch = "wasm32", target_arch = "asmjs")))]
#[cfg(not(any(target_arch = "wasm32")))]
fn demo_name_from_url() -> Option<String> {
None
}
Expand Down

0 comments on commit b98b3fd

Please sign in to comment.