Skip to content

Commit 3403bf7

Browse files
committed
fix compilation ; remove mentions to nphysics/ncollide ; update community links
1 parent 8ac39a3 commit 3403bf7

File tree

9 files changed

+77
-67
lines changed

9 files changed

+77
-67
lines changed

Cargo.toml

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
[workspace]
2-
members = [ "build/salva2d", "build/salva3d", "examples2d", "examples3d" ]
2+
members = ["build/salva2d", "build/salva3d", "examples2d", "examples3d"]
33
resolver = "2"
44

55
[profile.release]
66
#lto = true
77
#codegen-units = 1
88

9-
[profile.dev]
10-
# Use slightly better optimization by default, as examples otherwise seem laggy.
11-
opt-level = 1
12-
139
[patch.crates-io]
1410
salva2d = { path = "./build/salva2d" }
1511
salva3d = { path = "./build/salva3d" }
@@ -36,8 +32,3 @@ salva3d = { path = "./build/salva3d" }
3632
# rapier3d = { path = "../rapier/build/rapier3d" }
3733
# rapier_testbed2d = { path = "../rapier/build/rapier_testbed2d" }
3834
# rapier_testbed3d = { path = "../rapier/build/rapier_testbed3d" }
39-
40-
#nphysics2d = { path = "../nphysics/build/nphysics2d" }
41-
#nphysics3d = { path = "../nphysics/build/nphysics3d" }
42-
#ncollide2d = { path = "../ncollide/build/ncollide2d" }
43-
#ncollide3d = { path = "../ncollide/build/ncollide3d" }

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@
1717
</p>
1818
<p align = "center">
1919
<strong>
20-
<a href="https://salva.rs">Users guide</a> | <a href="https://docs.rs/salva2d/latest/salva2d">2D Documentation</a> | <a href="https://docs.rs/salva3d/latest/salva3d">3D Documentation</a> | <a href="https://discourse.nphysics.org">Forum</a>
20+
<a href="https://salva.rs">Users guide</a> | <a href="https://docs.rs/salva2d/latest/salva2d">2D Documentation</a> | <a href="https://docs.rs/salva3d/latest/salva3d">3D Documentation</a> | <a href="https://discord.gg/vt9DJSW">Discord</a>
2121
</strong>
2222
</p>
2323

2424
-----
2525

2626
**Salva** is a 2 and 3-dimensional particle-based fluid simulation engine for games and animations.
2727
It uses [nalgebra](https://nalgebra.org) for vector/matrix math and can optionally interface with
28-
[nphysics](https://nphysics.org) for two-way coupling with rigid bodies, multibodies, and deformable bodies.
28+
[rapier](https://rapier.rs) for two-way coupling with rigid bodies, multibodies, and deformable bodies.
2929
2D and 3D implementations both share (mostly) the same code!
3030

3131

3232
Examples are available in the `examples2d` and `examples3d` directories. Because those demos are based on
3333
WASM and WebGl 1.0 they should work on most modern browsers. Feel free to ask for help
34-
and discuss features on the official [user forum](https://discourse.nphysics.org).
34+
and discuss features on the official [discord](https://discord.gg/vt9DJSW).
3535

3636
## Why the name Salva?
3737

@@ -44,5 +44,5 @@ is inspired from its renown painting [The Persistence of Memory](https://en.wiki
4444
- **Surface tension:** WCSPH surface tension, and methods from He et al. 2014 and Akinci et al. 2013
4545
- **Elasticity:** method from Becker et al. 2009
4646
- **Multiphase fluids**: mix several fluids with different characteristics (densities, viscosities, etc.)
47-
- Optional **two-way coupling** with bodies from **nphysics**.
47+
- Optional **two-way coupling** with bodies from **rapier**.
4848
- **WASM** support

build/salva2d/Cargo.toml

+36-18
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,55 @@
11
[package]
2-
name = "salva2d"
2+
name = "salva2d"
33
version = "0.9.0"
4-
authors = [ "Sébastien Crozet <[email protected]>" ]
4+
authors = ["Sébastien Crozet <[email protected]>"]
55
description = "2-dimensional particle-based fluid dynamics in Rust."
66
documentation = "https://salva.rs/docs"
77
homepage = "https://salva.rs"
88
repository = "https://github.com/dimforge/salva"
99
readme = "README.md"
10-
categories = [ "science", "game-development", "mathematics", "simulation", "wasm"]
11-
keywords = [ "physics", "dynamics", "particles", "fluids", "SPH" ]
10+
categories = [
11+
"science",
12+
"game-development",
13+
"mathematics",
14+
"simulation",
15+
"wasm",
16+
]
17+
keywords = ["physics", "dynamics", "particles", "fluids", "SPH"]
1218
license = "Apache-2.0"
1319
edition = "2021"
1420

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

1824
[features]
19-
default = [ "dim2" ]
20-
dim2 = [ ]
21-
parallel = [ "rayon" ]
22-
sampling = [ "rapier" ]
23-
rapier = [ "parry", "rapier2d" ]
24-
rapier-testbed = [ "rapier", "rapier_testbed2d", "graphics" ]
25-
rapier-harness = [ "rapier-testbed" ]
26-
parry = [ "parry2d" ]
27-
wasm-bindgen = [ "rapier2d/wasm-bindgen" ]
28-
graphics = [ "bevy", "bevy_egui" ]
25+
default = ["dim2"]
26+
dim2 = []
27+
parallel = ["rayon"]
28+
sampling = ["rapier"]
29+
rapier = ["parry", "rapier2d"]
30+
rapier-testbed = ["rapier", "rapier_testbed2d", "graphics"]
31+
rapier-harness = ["rapier-testbed"]
32+
parry = ["parry2d"]
33+
wasm-bindgen = ["rapier2d/wasm-bindgen"]
34+
graphics = ["bevy", "bevy_egui"]
35+
36+
[lints]
37+
rust.unexpected_cfgs = { level = "warn", check-cfg = [
38+
'cfg(feature, values("dim3"))',
39+
] }
2940

3041
[lib]
3142
name = "salva2d"
3243
path = "../../src/lib.rs"
33-
required-features = [ "dim2" ]
44+
required-features = ["dim2"]
3445

3546
[dependencies]
3647
approx = "0.5"
3748
num-traits = "0.2"
3849
fnv = "1.0"
3950
itertools = "0.13"
4051
generational-arena = "0.2"
41-
instant = { version = "0.1", features = [ "now" ] }
52+
instant = { version = "0.1", features = ["now"] }
4253
rayon = { version = "1.8", optional = true }
4354

4455
nalgebra = "0.33"
@@ -49,8 +60,15 @@ rapier_testbed2d = { version = "0.21", optional = true }
4960
bevy_egui = { version = "0.26", features = ["immutable_ctx"], optional = true }
5061

5162
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
52-
bevy = { version = "0.13.2", default-features = false, features = ["bevy_winit", "bevy_render", "x11"], optional = true }
63+
bevy = { version = "0.13.2", default-features = false, features = [
64+
"bevy_winit",
65+
"bevy_render",
66+
"x11",
67+
], optional = true }
5368

5469
# Dependencies for WASM only.
5570
[target.'cfg(target_arch = "wasm32")'.dependencies]
56-
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render"], optional = true }
71+
bevy = { version = "0.13", default-features = false, features = [
72+
"bevy_winit",
73+
"bevy_render",
74+
], optional = true }

build/salva3d/Cargo.toml

+29-17
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
11
[package]
2-
name = "salva3d"
2+
name = "salva3d"
33
version = "0.9.0"
4-
authors = [ "Sébastien Crozet <[email protected]>" ]
4+
authors = ["Sébastien Crozet <[email protected]>"]
55
description = "3-dimensional particle-based fluid dynamics in Rust."
66
documentation = "https://salva.rs/rustdoc/salva3d/index.html"
77
homepage = "https://salva.rs"
88
repository = "https://github.com/dimforge/salva"
99
readme = "README.md"
10-
keywords = [ "physics", "dynamics", "particles", "fluids", "SPH" ]
10+
keywords = ["physics", "dynamics", "particles", "fluids", "SPH"]
1111
license = "Apache-2.0"
1212
edition = "2021"
1313

14+
[lints]
15+
rust.unexpected_cfgs = { level = "warn", check-cfg = [
16+
'cfg(feature, values("dim2"))',
17+
] }
18+
1419
[features]
15-
default = [ "dim3" ]
16-
dim3 = [ ]
17-
parallel = [ "rayon" ]
18-
rapier = [ "parry", "rapier3d" ]
19-
sampling = [ "rapier" ]
20-
rapier-testbed = [ "rapier", "rapier_testbed3d", "graphics" ]
21-
rapier-harness = [ "rapier-testbed" ]
22-
parry = [ "parry3d" ]
23-
wasm-bindgen = [ "rapier3d/wasm-bindgen" ]
24-
graphics = [ "bevy", "bevy_egui" ]
20+
default = ["dim3"]
21+
dim3 = []
22+
parallel = ["rayon"]
23+
rapier = ["parry", "rapier3d"]
24+
sampling = ["rapier"]
25+
rapier-testbed = ["rapier", "rapier_testbed3d", "graphics"]
26+
rapier-harness = ["rapier-testbed"]
27+
parry = ["parry3d"]
28+
wasm-bindgen = ["rapier3d/wasm-bindgen"]
29+
graphics = ["bevy", "bevy_egui"]
2530

2631
[lib]
2732
name = "salva3d"
2833
path = "../../src/lib.rs"
29-
required-features = [ "dim3" ]
34+
required-features = ["dim3"]
3035

3136
[dependencies]
3237
approx = "0.5"
3338
num-traits = "0.2"
3439
fnv = "1.0"
3540
itertools = "0.13"
3641
generational-arena = "0.2"
37-
instant = { version = "0.1", features = [ "now" ] }
42+
instant = { version = "0.1", features = ["now"] }
3843
rayon = { version = "1.8", optional = true }
3944

4045
nalgebra = "0.33"
@@ -45,8 +50,15 @@ rapier_testbed3d = { version = "0.21", optional = true }
4550
bevy_egui = { version = "0.26", features = ["immutable_ctx"], optional = true }
4651

4752
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
48-
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render", "x11"], optional = true }
53+
bevy = { version = "0.13", default-features = false, features = [
54+
"bevy_winit",
55+
"bevy_render",
56+
"x11",
57+
], optional = true }
4958

5059
# Dependencies for WASM only.
5160
[target.'cfg(target_arch = "wasm32")'.dependencies]
52-
bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render"], optional = true }
61+
bevy = { version = "0.13", default-features = false, features = [
62+
"bevy_winit",
63+
"bevy_render",
64+
], optional = true }

src/counters/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mod solver_counters;
1212
mod stages_counters;
1313
mod timer;
1414

15-
/// Aggregation of all the performances counters tracked by nphysics.
15+
/// Aggregation of all the performances counters tracked by salva.
1616
#[derive(Clone, Copy)]
1717
pub struct Counters {
1818
/// Total number of substeps performed.
@@ -30,7 +30,7 @@ pub struct Counters {
3030
}
3131

3232
impl Counters {
33-
/// Create a new set of counters initialized to wero.
33+
/// Create a new set of counters initialized to zero.
3434
pub fn new() -> Self {
3535
Counters {
3636
nsubsteps: 0,

src/coupling/coupling_manager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::object::{BoundarySet, Fluid};
44
use crate::TimestepManager;
55

66
/// Trait that needs to be implemented by middlewares responsible for
7-
/// coupling bodies from a rigid-body physic framework (nphysics, bullet, PhysX, etc.)
7+
/// coupling bodies from a rigid-body physic framework (rapier, bullet, PhysX, etc.)
88
/// with boundary objects of salva.
99
pub trait CouplingManager {
1010
/// Updates the boundary objects from the coupled bodies.

src/lib.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*!
22
**Salva** is a 2 and 3-dimensional particle-based fluid simulation engine for games and animations.
33
It uses [nalgebra](https://nalgebra.org) for vector/matrix math and can optionally interface with
4-
[nphysics](https://nphysics.org) for two-way coupling with rigid bodies, multibodies, and deformable bodies.
4+
[rapier](https://rapier.rs) for two-way coupling with rigid bodies, multibodies, and deformable bodies.
55
2D and 3D implementations both share (mostly) the same code!
66
77
88
Examples are available in the `examples2d` and `examples3d` directories. Because those demos are based on
99
WASM and WebGl 1.0 they should work on most modern browsers. Feel free to ask for help
10-
and discuss features on the official [user forum](https://discourse.nphysics.org).
10+
and discuss features on the official [discord](https://discord.gg/vt9DJSW).
1111
1212
## Why the name Salva?
1313
@@ -20,7 +20,7 @@ The name of this library is inspired from the famous surrealist artist `Salvador
2020
- **Surface tension:** WCSPH surface tension, and methods from He et al. 2014 and Akinci et al. 2013
2121
- **Elasticity:** method from Becker et al. 2009
2222
- **Multiphase fluids**: mix several fluids with different characteristics (densities, viscosities, etc.)
23-
- Optional **two-way coupling** with bodies from **nphysics**.
23+
- Optional **two-way coupling** with bodies from **rapier**.
2424
- **WASM** support
2525
*/
2626
#![deny(non_camel_case_types)]
@@ -36,10 +36,6 @@ The name of this library is inspired from the famous surrealist artist `Salvador
3636
#![doc(html_logo_url = "https://salva.rs/img/logo_salva_rustdoc.svg")]
3737

3838
extern crate nalgebra as na;
39-
#[cfg(all(feature = "dim2", feature = "ncollide"))]
40-
extern crate ncollide2d as ncollide;
41-
#[cfg(all(feature = "dim3", feature = "ncollide"))]
42-
extern crate ncollide3d as ncollide;
4339
extern crate num_traits as num;
4440
#[cfg(all(feature = "dim2", feature = "parry"))]
4541
pub extern crate parry2d as parry;

src/object/fluid.rs

-7
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,6 @@ impl Fluid {
165165
self.positions.len()
166166
}
167167

168-
/// Computes the AABB of this fluid.
169-
#[cfg(feature = "nphysics")]
170-
pub fn compute_aabb(&self, particle_radius: Real) -> ncollide::bounding_volume::AABB<Real> {
171-
use ncollide::bounding_volume::{self, BoundingVolume};
172-
bounding_volume::local_point_cloud_aabb(&self.positions).loosened(particle_radius)
173-
}
174-
175168
/// The mass of the `i`-th particle of this fluid.
176169
pub fn particle_mass(&self, i: usize) -> Real {
177170
self.volumes[i] * self.density0

src/sampling/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Methods for converting shapes from ncollide to sets of points.
1+
//! Methods for converting shapes from parry to sets of points.
22
33
pub use self::ray_sampling::{
44
shape_surface_ray_sample, shape_volume_ray_sample, surface_ray_sample, volume_ray_sample,

0 commit comments

Comments
 (0)