diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-03-20 12:50:42 +0100 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2022-03-20 21:49:16 +0100 |
| commit | d22d3fcc9f69c874f08a21b7333933788067fc79 (patch) | |
| tree | eb2f56625860c8eb0a02d65f2a5abaa34e5d5376 /src/dynamics | |
| parent | 8a7ec1f72e663c80d019c6dae6b455e410bf7807 (diff) | |
| download | rapier-d22d3fcc9f69c874f08a21b7333933788067fc79.tar.gz rapier-d22d3fcc9f69c874f08a21b7333933788067fc79.tar.bz2 rapier-d22d3fcc9f69c874f08a21b7333933788067fc79.zip | |
Cargo fmt
Diffstat (limited to 'src/dynamics')
| -rw-r--r-- | src/dynamics/joint/mod.rs | 4 | ||||
| -rw-r--r-- | src/dynamics/solver/parallel_island_solver.rs | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/dynamics/joint/mod.rs b/src/dynamics/joint/mod.rs index 11b5c0f..bb35927 100644 --- a/src/dynamics/joint/mod.rs +++ b/src/dynamics/joint/mod.rs @@ -1,6 +1,6 @@ pub use self::fixed_joint::*; -pub use self::impulse_joint::*; pub use self::generic_joint::*; +pub use self::impulse_joint::*; pub use self::motor_model::MotorModel; pub use self::multibody_joint::*; pub use self::prismatic_joint::*; @@ -10,8 +10,8 @@ pub use self::revolute_joint::*; pub use self::spherical_joint::*; mod fixed_joint; -mod impulse_joint; mod generic_joint; +mod impulse_joint; mod motor_model; mod multibody_joint; mod prismatic_joint; diff --git a/src/dynamics/solver/parallel_island_solver.rs b/src/dynamics/solver/parallel_island_solver.rs index f227e7f..61b3fcb 100644 --- a/src/dynamics/solver/parallel_island_solver.rs +++ b/src/dynamics/solver/parallel_island_solver.rs @@ -186,7 +186,7 @@ impl ParallelIslandSolver { 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? - + // Interactions grouping. self.parallel_groups.group_interactions( island_id, @@ -229,7 +229,9 @@ impl ParallelIslandSolver { if self.parallel_contact_constraints.generic_jacobians.len() < contact_j_id { self.parallel_contact_constraints.generic_jacobians = DVector::zeros(contact_j_id); } else { - self.parallel_contact_constraints.generic_jacobians.fill(0.0); + self.parallel_contact_constraints + .generic_jacobians + .fill(0.0); } if self.parallel_joint_constraints.generic_jacobians.len() < joint_j_id { @@ -315,7 +317,7 @@ impl ParallelIslandSolver { let multibody = multibodies .get_multibody_mut_internal(link.multibody) .unwrap(); - + if link.id == 0 || link.id == 1 && !multibody.root_is_dynamic { let mut mj_lambdas = velocity_solver .generic_mj_lambdas @@ -325,9 +327,9 @@ impl ParallelIslandSolver { } else { let (ids, mprops, forces): (&RigidBodyIds, &RigidBodyMassProps, &RigidBodyForces) = bodies.index_bundle(handle.0); - + let dvel = &mut velocity_solver.mj_lambdas[ids.active_set_offset]; - + // NOTE: `dvel.angular` is actually storing angular velocity delta multiplied // by the square root of the inertia tensor: dvel.angular += mprops.effective_world_inv_inertia_sqrt * forces.torque * params.dt; |
