diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-04-19 18:57:40 +0200 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2022-04-20 19:02:49 +0200 |
| commit | 2b1374c596957ac8cabe085859be3b823a1ba0c6 (patch) | |
| tree | a7f37ec29199a5a2c6198a6b001e665524fdab96 /src/dynamics/solver/parallel_island_solver.rs | |
| parent | ee679427cda6363e4de94a59e293d01133a44d1f (diff) | |
| download | rapier-2b1374c596957ac8cabe085859be3b823a1ba0c6.tar.gz rapier-2b1374c596957ac8cabe085859be3b823a1ba0c6.tar.bz2 rapier-2b1374c596957ac8cabe085859be3b823a1ba0c6.zip | |
First round deleting the component sets.
Diffstat (limited to 'src/dynamics/solver/parallel_island_solver.rs')
| -rw-r--r-- | src/dynamics/solver/parallel_island_solver.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/dynamics/solver/parallel_island_solver.rs b/src/dynamics/solver/parallel_island_solver.rs index 61b3fcb..261c627 100644 --- a/src/dynamics/solver/parallel_island_solver.rs +++ b/src/dynamics/solver/parallel_island_solver.rs @@ -2,7 +2,6 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use rayon::Scope; -use crate::data::{BundleSet, ComponentSet, ComponentSetMut}; use crate::dynamics::solver::{ AnyJointVelocityConstraint, AnyVelocityConstraint, ParallelSolverConstraints, }; @@ -162,27 +161,19 @@ impl ParallelIslandSolver { } } - pub fn init_and_solve<'s, Bodies>( + pub fn init_and_solve<'s>( &'s mut self, scope: &Scope<'s>, island_id: usize, islands: &'s IslandManager, params: &'s IntegrationParameters, - bodies: &'s mut Bodies, + bodies: &'s mut RigidBodySet, manifolds: &'s mut Vec<&'s mut ContactManifold>, manifold_indices: &'s [ContactManifoldIndex], impulse_joints: &'s mut Vec<JointGraphEdge>, joint_indices: &[JointIndex], multibodies: &mut MultibodyJointSet, - ) where - Bodies: ComponentSet<RigidBodyForces> - + ComponentSetMut<RigidBodyPosition> - + ComponentSetMut<RigidBodyVelocity> - + ComponentSetMut<RigidBodyMassProps> - + ComponentSet<RigidBodyDamping> - + ComponentSet<RigidBodyIds> - + ComponentSet<RigidBodyType>, - { + ) { let num_threads = rayon::current_num_threads(); let num_task_per_island = num_threads; // (num_threads / num_islands).max(1); // TODO: not sure this is the best value. Also, perhaps it is better to interleave tasks of each island? self.thread = ThreadContext::new(8); // TODO: could we compute some kind of optimal value here? @@ -288,7 +279,7 @@ impl ParallelIslandSolver { // Transmute *mut -> &mut let velocity_solver: &mut ParallelVelocitySolver = unsafe { std::mem::transmute(velocity_solver.load(Ordering::Relaxed)) }; - let bodies: &mut Bodies = + let bodies: &mut RigidBodySet = unsafe { std::mem::transmute(bodies.load(Ordering::Relaxed)) }; let multibodies: &mut MultibodyJointSet = unsafe { std::mem::transmute(multibodies.load(Ordering::Relaxed)) }; |
