Rebase on master branch

This commit is contained in:
Sébastien Crozet
2022-03-06 11:32:25 +01:00
committed by Sébastien Crozet
parent 815de4beff
commit 891c08177d
13 changed files with 199 additions and 181 deletions

View File

@@ -1,6 +1,5 @@
{
"rust-analyzer.cargo.features": [
"simd-stable",
"parallel"
"simd-stable"
]
}

324
.vscode/tasks.json vendored
View File

@@ -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,7 +57,179 @@
"group": "build"
},
{
"label": "run 3d (simd - parallel - debug) ",
"label": "🚀 run 2d",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_examples2",
"--release",
"--features",
"other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "🚀 run 2d 🌈 simd",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_examples2",
"--release",
"--features",
"simd-stable,other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "🚀 run 2d 🌈 simd 🪢 parallel",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_examples2",
"--release",
"--features",
"simd-stable,other-backends,parallel",
"--",
"--pause"
],
"group": "build"
},
{
"label": "⏱ bench 3d",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks3",
"--release",
"--features",
"other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "⏱ bench 3d 🌈 simd",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks3",
"--release",
"--features",
"simd-stable,other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "⏱ bench 3d 🌈 simd 🪢 parallel",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks3",
"--release",
"--features",
"simd-stable,other-backends,parallel",
"--",
"--pause"
],
"group": "build"
},
{
"label": "⏱ bench 2d",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks2",
"--release",
"--features",
"other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "⏱ bench 2d 🌈 simd",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks2",
"--release",
"--features",
"simd-stable,other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "⏱ bench 2d 🌈 simd 🪢 parallel",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks2",
"--release",
"--features",
"simd-stable,other-backends,parallel",
"--",
"--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": [
@@ -70,150 +242,6 @@
"--pause"
],
"group": "build"
},
{
"label": "run 2d (no-simd - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_examples2",
"--release",
"--features",
"other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "run 2d (simd - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_examples2",
"--release",
"--features",
"simd-stable,other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "run 2d (simd - parallel - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_examples2",
"--release",
"--features",
"simd-stable,other-backends,parallel",
"--",
"--pause"
],
"group": "build"
},
{
"label": "bench 3d (no-simd - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks3",
"--release",
"--features",
"other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "bench 3d (simd - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks3",
"--release",
"--features",
"simd-stable,other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "bench 3d (simd - parallel - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks3",
"--release",
"--features",
"simd-stable,other-backends,parallel",
"--",
"--pause"
],
"group": "build"
},
{
"label": "bench 2d (no-simd - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks2",
"--release",
"--features",
"other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "bench 2d (simd - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks2",
"--release",
"--features",
"simd-stable,other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "bench 2d (simd - parallel - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_benchmarks2",
"--release",
"--features",
"simd-stable,other-backends,parallel",
"--",
"--pause"
],
"group": "build"
}
]
]

View File

@@ -24,7 +24,6 @@ resolver = "2"
[profile.release]
#debug = true
#codegen-units = 1
#opt-level = 1
#lto = true
[profile.dev]

View File

@@ -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 {

View File

@@ -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),

View File

@@ -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;

View File

@@ -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,

View File

@@ -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!()
/*

View File

@@ -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,

View File

@@ -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},

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {