diff --git a/Cargo.toml b/Cargo.toml
index 995d754..eade847 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,11 +2,6 @@
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
@@ -41,8 +36,3 @@ rapier_testbed3d = { git = "https://github.com/dimforge/rapier" }
# 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" }
-#ncollide2d = { path = "../ncollide/build/ncollide2d" }
-#ncollide3d = { path = "../ncollide/build/ncollide3d" }
diff --git a/README.md b/README.md
index cf68242..99343ab 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
- Users guide | 2D Documentation | 3D Documentation | Forum
+ Users guide | 2D Documentation | 3D Documentation | Discord
@@ -25,13 +25,13 @@
**Salva** is a 2 and 3-dimensional particle-based fluid simulation engine for games and animations.
It uses [nalgebra](https://nalgebra.org) for vector/matrix math and can optionally interface with
-[nphysics](https://nphysics.org) for two-way coupling with rigid bodies, multibodies, and deformable bodies.
+[rapier](https://rapier.rs) for two-way coupling with rigid bodies, multibodies, and deformable bodies.
2D and 3D implementations both share (mostly) the same code!
Examples are available in the `examples2d` and `examples3d` directories. Because those demos are based on
WASM and WebGl 1.0 they should work on most modern browsers. Feel free to ask for help
-and discuss features on the official [user forum](https://discourse.nphysics.org).
+and discuss features on the official [discord](https://discord.gg/vt9DJSW).
## Why the name Salva?
@@ -44,5 +44,5 @@ is inspired from its renown painting [The Persistence of Memory](https://en.wiki
- **Surface tension:** WCSPH surface tension, and methods from He et al. 2014 and Akinci et al. 2013
- **Elasticity:** method from Becker et al. 2009
- **Multiphase fluids**: mix several fluids with different characteristics (densities, viscosities, etc.)
-- Optional **two-way coupling** with bodies from **nphysics**.
+- Optional **two-way coupling** with bodies from **rapier**.
- **WASM** support
diff --git a/build/salva2d/Cargo.toml b/build/salva2d/Cargo.toml
index c4a2da9..41399e9 100644
--- a/build/salva2d/Cargo.toml
+++ b/build/salva2d/Cargo.toml
@@ -19,7 +19,9 @@ license = "Apache-2.0"
edition = "2021"
[lints]
-workspace = true
+rust.unexpected_cfgs = { level = "warn", check-cfg = [
+ 'cfg(feature, values("dim3"))',
+] }
[badges]
maintenance = { status = "actively-developed" }
diff --git a/build/salva3d/Cargo.toml b/build/salva3d/Cargo.toml
index 98ba109..9b6244c 100644
--- a/build/salva3d/Cargo.toml
+++ b/build/salva3d/Cargo.toml
@@ -11,6 +11,11 @@ keywords = ["physics", "dynamics", "particles", "fluids", "SPH"]
license = "Apache-2.0"
edition = "2021"
+[lints]
+rust.unexpected_cfgs = { level = "warn", check-cfg = [
+ 'cfg(feature, values("dim2"))',
+] }
+
[features]
default = ["dim3"]
dim3 = []
@@ -23,9 +28,6 @@ parry = ["parry3d"]
wasm-bindgen = ["rapier3d/wasm-bindgen"]
graphics = ["bevy", "bevy_egui"]
-[lints]
-workspace = true
-
[lib]
name = "salva3d"
path = "../../src/lib.rs"
diff --git a/examples2d/all_examples2.rs b/examples2d/all_examples2.rs
index 0685ed0..b0d3390 100644
--- a/examples2d/all_examples2.rs
+++ b/examples2d/all_examples2.rs
@@ -23,7 +23,7 @@ fn demo_name_from_command_line() -> Option {
None
}
-#[cfg(any(target_arch = "wasm32"))]
+#[cfg(target_arch = "wasm32")]
fn demo_name_from_url() -> Option {
let window = stdweb::web::window();
let hash = window.location()?.search().ok()?;
@@ -34,7 +34,7 @@ fn demo_name_from_url() -> Option {
}
}
-#[cfg(not(any(target_arch = "wasm32")))]
+#[cfg(not(target_arch = "wasm32"))]
fn demo_name_from_url() -> Option {
None
}
diff --git a/examples3d/all_examples3.rs b/examples3d/all_examples3.rs
index f02addf..15afac7 100644
--- a/examples3d/all_examples3.rs
+++ b/examples3d/all_examples3.rs
@@ -27,7 +27,7 @@ fn demo_name_from_command_line() -> Option {
None
}
-#[cfg(any(target_arch = "wasm32"))]
+#[cfg(target_arch = "wasm32")]
fn demo_name_from_url() -> Option {
None
// let window = stdweb::web::window();
@@ -39,7 +39,7 @@ fn demo_name_from_url() -> Option {
// }
}
-#[cfg(not(any(target_arch = "wasm32")))]
+#[cfg(not(target_arch = "wasm32"))]
fn demo_name_from_url() -> Option {
None
}
diff --git a/src/counters/mod.rs b/src/counters/mod.rs
index 8b16125..1d91ba5 100644
--- a/src/counters/mod.rs
+++ b/src/counters/mod.rs
@@ -12,7 +12,7 @@ mod solver_counters;
mod stages_counters;
mod timer;
-/// Aggregation of all the performances counters tracked by nphysics.
+/// Aggregation of all the performances counters tracked by salva.
#[derive(Clone, Copy)]
pub struct Counters {
/// Total number of substeps performed.
@@ -30,7 +30,7 @@ pub struct Counters {
}
impl Counters {
- /// Create a new set of counters initialized to wero.
+ /// Create a new set of counters initialized to zero.
pub fn new() -> Self {
Counters {
nsubsteps: 0,
diff --git a/src/coupling/coupling_manager.rs b/src/coupling/coupling_manager.rs
index 695a982..3eeea2c 100644
--- a/src/coupling/coupling_manager.rs
+++ b/src/coupling/coupling_manager.rs
@@ -4,7 +4,7 @@ use crate::object::{BoundarySet, Fluid};
use crate::TimestepManager;
/// Trait that needs to be implemented by middlewares responsible for
-/// coupling bodies from a rigid-body physic framework (nphysics, bullet, PhysX, etc.)
+/// coupling bodies from a rigid-body physic framework (rapier, bullet, PhysX, etc.)
/// with boundary objects of salva.
pub trait CouplingManager {
/// Updates the boundary objects from the coupled bodies.
diff --git a/src/lib.rs b/src/lib.rs
index a969b6c..650ee92 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,13 +1,13 @@
/*!
**Salva** is a 2 and 3-dimensional particle-based fluid simulation engine for games and animations.
It uses [nalgebra](https://nalgebra.org) for vector/matrix math and can optionally interface with
-[nphysics](https://nphysics.org) for two-way coupling with rigid bodies, multibodies, and deformable bodies.
+[rapier](https://rapier.rs) for two-way coupling with rigid bodies, multibodies, and deformable bodies.
2D and 3D implementations both share (mostly) the same code!
Examples are available in the `examples2d` and `examples3d` directories. Because those demos are based on
WASM and WebGl 1.0 they should work on most modern browsers. Feel free to ask for help
-and discuss features on the official [user forum](https://discourse.nphysics.org).
+and discuss features on the official [discord](https://discord.gg/vt9DJSW).
## Why the name Salva?
@@ -20,7 +20,7 @@ The name of this library is inspired from the famous surrealist artist `Salvador
- **Surface tension:** WCSPH surface tension, and methods from He et al. 2014 and Akinci et al. 2013
- **Elasticity:** method from Becker et al. 2009
- **Multiphase fluids**: mix several fluids with different characteristics (densities, viscosities, etc.)
-- Optional **two-way coupling** with bodies from **nphysics**.
+- Optional **two-way coupling** with bodies from **rapier**.
- **WASM** support
*/
#![deny(non_camel_case_types)]
@@ -36,10 +36,6 @@ The name of this library is inspired from the famous surrealist artist `Salvador
#![doc(html_logo_url = "https://salva.rs/img/logo_salva_rustdoc.svg")]
extern crate nalgebra as na;
-#[cfg(all(feature = "dim2", feature = "ncollide"))]
-extern crate ncollide2d as ncollide;
-#[cfg(all(feature = "dim3", feature = "ncollide"))]
-extern crate ncollide3d as ncollide;
extern crate num_traits as num;
#[cfg(all(feature = "dim2", feature = "parry"))]
pub extern crate parry2d as parry;
diff --git a/src/object/fluid.rs b/src/object/fluid.rs
index 2c79f5e..755a967 100644
--- a/src/object/fluid.rs
+++ b/src/object/fluid.rs
@@ -166,10 +166,10 @@ impl Fluid {
}
/// Computes the AABB of this fluid.
- #[cfg(feature = "nphysics")]
- pub fn compute_aabb(&self, particle_radius: Real) -> ncollide::bounding_volume::AABB {
- use ncollide::bounding_volume::{self, BoundingVolume};
- bounding_volume::local_point_cloud_aabb(&self.positions).loosened(particle_radius)
+ #[cfg(feature = "parry")]
+ pub fn compute_aabb(&self, particle_radius: Real) -> parry::bounding_volume::Aabb {
+ use parry::bounding_volume::{details::local_point_cloud_aabb, BoundingVolume};
+ local_point_cloud_aabb(&self.positions).loosened(particle_radius)
}
/// The mass of the `i`-th particle of this fluid.
diff --git a/src/sampling/mod.rs b/src/sampling/mod.rs
index 78e79e8..d44e9dd 100644
--- a/src/sampling/mod.rs
+++ b/src/sampling/mod.rs
@@ -1,4 +1,4 @@
-//! Methods for converting shapes from ncollide to sets of points.
+//! Methods for converting shapes from parry to sets of points.
pub use self::ray_sampling::{
shape_surface_ray_sample, shape_volume_ray_sample, surface_ray_sample, volume_ray_sample,