diff options
| author | SΓ©bastien Crozet <developer@crozet.re> | 2022-03-06 11:32:25 +0100 |
|---|---|---|
| committer | SΓ©bastien Crozet <sebastien@crozet.re> | 2022-03-20 21:49:16 +0100 |
| commit | 891c08177d090c5f045fd01b5e1b5f7b7b26552f (patch) | |
| tree | b606617586adc0298c213aaa4ab834e9f06430d9 | |
| parent | 815de4beff2ca31255c7fb937337602eb784ed67 (diff) | |
| download | rapier-891c08177d090c5f045fd01b5e1b5f7b7b26552f.tar.gz rapier-891c08177d090c5f045fd01b5e1b5f7b7b26552f.tar.bz2 rapier-891c08177d090c5f045fd01b5e1b5f7b7b26552f.zip | |
Rebase on master branch
| -rw-r--r-- | .vscode/settings.json | 3 | ||||
| -rw-r--r-- | .vscode/tasks.json | 82 | ||||
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | examples2d/add_remove2.rs | 1 | ||||
| -rw-r--r-- | src/dynamics/joint/generic_joint.rs | 6 | ||||
| -rw-r--r-- | src/dynamics/solver/joint_constraint/joint_constraint.rs | 2 | ||||
| -rw-r--r-- | src/dynamics/solver/joint_constraint/joint_generic_velocity_constraint_builder.rs | 4 | ||||
| -rw-r--r-- | src/dynamics/solver/joint_constraint/joint_velocity_constraint_builder.rs | 19 | ||||
| -rw-r--r-- | src/dynamics/solver/parallel_island_solver.rs | 5 | ||||
| -rw-r--r-- | src/dynamics/solver/parallel_solver_constraints.rs | 2 | ||||
| -rw-r--r-- | src/dynamics/solver/parallel_velocity_solver.rs | 7 | ||||
| -rw-r--r-- | src/dynamics/solver/velocity_constraint.rs | 4 | ||||
| -rw-r--r-- | src/geometry/narrow_phase.rs | 2 |
13 files changed, 78 insertions, 60 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 9293d73..e932736 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,5 @@ { "rust-analyzer.cargo.features": [ - "simd-stable", - "parallel" + "simd-stable" ] }
\ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 285a051..1f7b545 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -9,7 +9,7 @@ }, "tasks": [ { - "label": "run 3d (no-simd - release) ", + "label": "π run 3d", "type": "shell", "command": "cargo", "args": [ @@ -25,7 +25,7 @@ "group": "build" }, { - "label": "run 3d (simd - release) ", + "label": "π run 3d β π simd", "type": "shell", "command": "cargo", "args": [ @@ -41,7 +41,7 @@ "group": "build" }, { - "label": "run 3d (simd - parallel - release) ", + "label": "π run 3d β π simd πͺ’ parallel", "type": "shell", "command": "cargo", "args": [ @@ -57,22 +57,7 @@ "group": "build" }, { - "label": "run 3d (simd - parallel - debug) ", - "type": "shell", - "command": "cargo", - "args": [ - "run", - "--bin", - "all_examples3", - "--features", - "simd-stable,parallel", - "--", - "--pause" - ], - "group": "build" - }, - { - "label": "run 2d (no-simd - release) ", + "label": "π run 2d", "type": "shell", "command": "cargo", "args": [ @@ -88,7 +73,7 @@ "group": "build" }, { - "label": "run 2d (simd - release) ", + "label": "π run 2d β π simd", "type": "shell", "command": "cargo", "args": [ @@ -104,7 +89,7 @@ "group": "build" }, { - "label": "run 2d (simd - parallel - release) ", + "label": "π run 2d β π simd πͺ’ parallel", "type": "shell", "command": "cargo", "args": [ @@ -120,7 +105,7 @@ "group": "build" }, { - "label": "bench 3d (no-simd - release) ", + "label": "β± bench 3d", "type": "shell", "command": "cargo", "args": [ @@ -136,7 +121,7 @@ "group": "build" }, { - "label": "bench 3d (simd - release) ", + "label": "β± bench 3d β π simd", "type": "shell", "command": "cargo", "args": [ @@ -152,7 +137,7 @@ "group": "build" }, { - "label": "bench 3d (simd - parallel - release) ", + "label": "β± bench 3d β π simd πͺ’ parallel", "type": "shell", "command": "cargo", "args": [ @@ -168,7 +153,7 @@ "group": "build" }, { - "label": "bench 2d (no-simd - release) ", + "label": "β± bench 2d", "type": "shell", "command": "cargo", "args": [ @@ -184,7 +169,7 @@ "group": "build" }, { - "label": "bench 2d (simd - release) ", + "label": "β± bench 2d β π simd", "type": "shell", "command": "cargo", "args": [ @@ -200,7 +185,7 @@ "group": "build" }, { - "label": "bench 2d (simd - parallel - release) ", + "label": "β± bench 2d β π simd πͺ’ parallel", "type": "shell", "command": "cargo", "args": [ @@ -214,6 +199,49 @@ "--pause" ], "group": "build" + }, + { + "label": "πͺ² debug 3d", + "type": "shell", + "command": "cargo", + "args": [ + "run", + "--bin", + "all_examples3", + "--", + "--pause" + ], + "group": "build" + }, + { + "label": "πͺ² debug 3d β π simd", + "type": "shell", + "command": "cargo", + "args": [ + "run", + "--bin", + "all_examples3", + "--features", + "simd-stable", + "--", + "--pause" + ], + "group": "build" + }, + { + "label": "πͺ² debug 3d β π simd πͺ’ parallel", + "type": "shell", + "command": "cargo", + "args": [ + "run", + "--bin", + "all_examples3", + "--features", + "simd-stable,parallel", + "--", + "--pause" + ], + "group": "build" } ] ] @@ -24,7 +24,6 @@ resolver = "2" [profile.release] #debug = true #codegen-units = 1 -#opt-level = 1 #lto = true [profile.dev] diff --git a/examples2d/add_remove2.rs b/examples2d/add_remove2.rs index dfc96d9..261071b 100644 --- a/examples2d/add_remove2.rs +++ b/examples2d/add_remove2.rs @@ -58,6 +58,7 @@ pub fn init_world(testbed: &mut Testbed) { &mut physics.colliders, &mut physics.impulse_joints, &mut physics.multibody_joints, + true, ); if let Some(graphics) = &mut graphics { diff --git a/src/dynamics/joint/generic_joint.rs b/src/dynamics/joint/generic_joint.rs index 7323194..4aea61c 100644 --- a/src/dynamics/joint/generic_joint.rs +++ b/src/dynamics/joint/generic_joint.rs @@ -1,9 +1,7 @@ -use na::SimdRealField; - use crate::dynamics::solver::MotorParameters; use crate::dynamics::{FixedJoint, MotorModel, PrismaticJoint, RevoluteJoint}; use crate::math::{Isometry, Point, Real, Rotation, UnitVector, Vector, SPATIAL_DIM}; -use crate::utils::WBasis; +use crate::utils::{WBasis, WReal}; #[cfg(feature = "dim3")] use crate::dynamics::SphericalJoint; @@ -77,7 +75,7 @@ pub struct JointLimits<N> { pub impulse: N, } -impl<N: SimdRealField<Element = Real>> Default for JointLimits<N> { +impl<N: WReal> Default for JointLimits<N> { fn default() -> Self { Self { min: -N::splat(Real::MAX), diff --git a/src/dynamics/solver/joint_constraint/joint_constraint.rs b/src/dynamics/solver/joint_constraint/joint_constraint.rs index 988e6a2..f571bc6 100644 --- a/src/dynamics/solver/joint_constraint/joint_constraint.rs +++ b/src/dynamics/solver/joint_constraint/joint_constraint.rs @@ -12,7 +12,7 @@ use crate::dynamics::{ }; #[cfg(feature = "simd-is-enabled")] use crate::math::{Isometry, SimdReal, SIMD_WIDTH}; -use crate::math::{Real, DIM, SPATIAL_DIM}; +use crate::math::{Real, SPATIAL_DIM}; use crate::prelude::MultibodyJointSet; use na::DVector; diff --git a/src/dynamics/solver/joint_constraint/joint_generic_velocity_constraint_builder.rs b/src/dynamics/solver/joint_constraint/joint_generic_velocity_constraint_builder.rs index 510f46f..1e7df89 100644 --- a/src/dynamics/solver/joint_constraint/joint_generic_velocity_constraint_builder.rs +++ b/src/dynamics/solver/joint_constraint/joint_generic_velocity_constraint_builder.rs @@ -58,7 +58,7 @@ impl SolverBody<Real, 1> { impl JointVelocityConstraintBuilder<Real> { pub fn lock_jacobians_generic( &self, - params: &IntegrationParameters, + _params: &IntegrationParameters, jacobians: &mut DVector<Real>, j_id: &mut usize, joint_id: JointIndex, @@ -500,7 +500,7 @@ impl JointVelocityConstraintBuilder<Real> { impl JointVelocityConstraintBuilder<Real> { pub fn lock_jacobians_generic_ground( &self, - params: &IntegrationParameters, + _params: &IntegrationParameters, jacobians: &mut DVector<Real>, j_id: &mut usize, joint_id: JointIndex, diff --git a/src/dynamics/solver/joint_constraint/joint_velocity_constraint_builder.rs b/src/dynamics/solver/joint_constraint/joint_velocity_constraint_builder.rs index 95ab288..8544e31 100644 --- a/src/dynamics/solver/joint_constraint/joint_velocity_constraint_builder.rs +++ b/src/dynamics/solver/joint_constraint/joint_velocity_constraint_builder.rs @@ -3,7 +3,7 @@ use crate::dynamics::solver::joint_constraint::joint_velocity_constraint::{ }; use crate::dynamics::solver::joint_constraint::SolverBody; use crate::dynamics::solver::MotorParameters; -use crate::dynamics::{IntegrationParameters, JointAxesMask, JointIndex, JointLimits, JointMotor}; +use crate::dynamics::{IntegrationParameters, JointIndex, JointLimits}; use crate::math::{AngVector, Isometry, Matrix, Point, Real, Rotation, Vector, ANG_DIM, DIM}; use crate::utils::{IndexMut2, WCrossMatrix, WDot, WQuat, WReal}; use na::SMatrix; @@ -660,15 +660,14 @@ impl<N: WReal> JointVelocityConstraintBuilder<N> { pub fn motor_linear_coupled_ground<const LANES: usize>( &self, - params: &IntegrationParameters, - joint_id: [JointIndex; LANES], - body1: &SolverBody<N, LANES>, - body2: &SolverBody<N, LANES>, - motor_coupled_axes: u8, - motors: &[MotorParameters<N>], - limited_coupled_axes: u8, - limits: &[JointLimits<N>], - writeback_id: WritebackId, + _joint_id: [JointIndex; LANES], + _body1: &SolverBody<N, LANES>, + _body2: &SolverBody<N, LANES>, + _motor_coupled_axes: u8, + _motors: &[MotorParameters<N>], + _limited_coupled_axes: u8, + _limits: &[JointLimits<N>], + _writeback_id: WritebackId, ) -> JointVelocityGroundConstraint<N, LANES> { todo!() /* diff --git a/src/dynamics/solver/parallel_island_solver.rs b/src/dynamics/solver/parallel_island_solver.rs index 463845b..f227e7f 100644 --- a/src/dynamics/solver/parallel_island_solver.rs +++ b/src/dynamics/solver/parallel_island_solver.rs @@ -3,7 +3,6 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use rayon::Scope; use crate::data::{BundleSet, ComponentSet, ComponentSetMut}; -use crate::dynamics::solver::generic_velocity_constraint::GenericVelocityConstraint; use crate::dynamics::solver::{ AnyJointVelocityConstraint, AnyVelocityConstraint, ParallelSolverConstraints, }; @@ -13,7 +12,6 @@ use crate::dynamics::{ RigidBodyType, RigidBodyVelocity, }; use crate::geometry::{ContactManifold, ContactManifoldIndex}; -use crate::math::{Isometry, Real}; use na::DVector; use super::{DeltaVel, ParallelInteractionGroups, ParallelVelocitySolver}; @@ -139,7 +137,6 @@ impl ThreadContext { pub struct ParallelIslandSolver { velocity_solver: ParallelVelocitySolver, - positions: Vec<Isometry<Real>>, parallel_groups: ParallelInteractionGroups, parallel_joint_groups: ParallelInteractionGroups, parallel_contact_constraints: ParallelSolverConstraints<AnyVelocityConstraint>, @@ -157,7 +154,6 @@ impl ParallelIslandSolver { pub fn new() -> Self { Self { velocity_solver: ParallelVelocitySolver::new(), - positions: Vec::new(), parallel_groups: ParallelInteractionGroups::new(), parallel_joint_groups: ParallelInteractionGroups::new(), parallel_contact_constraints: ParallelSolverConstraints::new(), @@ -192,7 +188,6 @@ impl ParallelIslandSolver { self.thread = ThreadContext::new(8); // TODO: could we compute some kind of optimal value here? // Interactions grouping. - let mut j_id = 0; self.parallel_groups.group_interactions( island_id, islands, diff --git a/src/dynamics/solver/parallel_solver_constraints.rs b/src/dynamics/solver/parallel_solver_constraints.rs index 4c43f46..aadee48 100644 --- a/src/dynamics/solver/parallel_solver_constraints.rs +++ b/src/dynamics/solver/parallel_solver_constraints.rs @@ -13,7 +13,7 @@ use crate::dynamics::{ RigidBodyType, RigidBodyVelocity, }; use crate::geometry::ContactManifold; -use crate::math::{Real, DIM, SPATIAL_DIM}; +use crate::math::{Real, SPATIAL_DIM}; #[cfg(feature = "simd-is-enabled")] use crate::{ dynamics::solver::{WVelocityConstraint, WVelocityGroundConstraint}, diff --git a/src/dynamics/solver/parallel_velocity_solver.rs b/src/dynamics/solver/parallel_velocity_solver.rs index d56c358..b913eef 100644 --- a/src/dynamics/solver/parallel_velocity_solver.rs +++ b/src/dynamics/solver/parallel_velocity_solver.rs @@ -2,10 +2,9 @@ use super::{AnyJointVelocityConstraint, AnyVelocityConstraint, DeltaVel, ThreadC use crate::concurrent_loop; use crate::data::{BundleSet, ComponentSet, ComponentSetMut}; use crate::dynamics::{ - solver::{GenericVelocityConstraint, ParallelSolverConstraints}, - IntegrationParameters, IslandManager, JointGraphEdge, MultibodyJointSet, RigidBodyDamping, - RigidBodyForces, RigidBodyIds, RigidBodyMassProps, RigidBodyPosition, RigidBodyType, - RigidBodyVelocity, + solver::ParallelSolverConstraints, IntegrationParameters, IslandManager, JointGraphEdge, + MultibodyJointSet, RigidBodyDamping, RigidBodyForces, RigidBodyIds, RigidBodyMassProps, + RigidBodyPosition, RigidBodyType, RigidBodyVelocity, }; use crate::geometry::ContactManifold; use crate::math::Real; diff --git a/src/dynamics/solver/velocity_constraint.rs b/src/dynamics/solver/velocity_constraint.rs index f1c213d..50c2625 100644 --- a/src/dynamics/solver/velocity_constraint.rs +++ b/src/dynamics/solver/velocity_constraint.rs @@ -7,7 +7,7 @@ use crate::dynamics::solver::{WVelocityConstraint, WVelocityGroundConstraint}; use crate::dynamics::{IntegrationParameters, RigidBodyIds, RigidBodyMassProps, RigidBodyVelocity}; use crate::geometry::{ContactManifold, ContactManifoldIndex}; use crate::math::{Real, Vector, DIM, MAX_MANIFOLD_POINTS}; -use crate::utils::{self, WAngularInertia, WBasis, WCross, WDot, WReal}; +use crate::utils::{self, WAngularInertia, WBasis, WCross, WDot}; use na::DVector; use super::{DeltaVel, VelocityConstraintElement, VelocityConstraintNormalPart}; @@ -405,7 +405,7 @@ pub(crate) fn compute_tangent_contact_directions<N>( linvel2: &Vector<N>, ) -> [Vector<N>; DIM - 1] where - N: WReal, + N: utils::WReal, Vector<N>: WBasis, { use na::SimdValue; diff --git a/src/geometry/narrow_phase.rs b/src/geometry/narrow_phase.rs index 46635b3..400c635 100644 --- a/src/geometry/narrow_phase.rs +++ b/src/geometry/narrow_phase.rs @@ -712,7 +712,7 @@ impl NarrowPhase { par_iter_mut!(&mut self.intersection_graph.graph.edges).for_each(|edge| { let handle1 = nodes[edge.source().index()].weight; let handle2 = nodes[edge.target().index()].weight; - let mut had_intersection = edge.weight; + let had_intersection = edge.weight; // TODO: remove the `loop` once labels on blocks is stabilized. 'emit_events: loop { |
