chore: clippy fixes

This commit is contained in:
Sébastien Crozet
2024-04-28 18:23:30 +02:00
committed by Sébastien Crozet
parent 929aa6b925
commit 0a9153e273
29 changed files with 38 additions and 52 deletions

View File

@@ -178,10 +178,16 @@ impl IntegrationParameters {
* self.joint_damping_ratio)
}
/// Amount of penetration the engine wont attempt to correct (default: `0.001` multiplied by
/// [`Self::length_unit`]).
pub fn allowed_linear_error(&self) -> Real {
self.normalized_allowed_linear_error * self.length_unit
}
/// Maximum amount of penetration the solver will attempt to resolve in one timestep.
///
/// This is equal to [`Self::normalized_max_penetration_correction`] multiplied by
/// [`Self::length_unit`].
pub fn max_penetration_correction(&self) -> Real {
if self.normalized_max_penetration_correction != Real::MAX {
self.normalized_max_penetration_correction * self.length_unit
@@ -190,11 +196,13 @@ impl IntegrationParameters {
}
}
/// The maximal distance separating two objects that will generate predictive contacts
/// (default: `0.002m` multiped by [`Self::length_unit`]).
pub fn prediction_distance(&self) -> Real {
self.normalized_prediction_distance * self.length_unit
}
/// Initialize the simulation paramaters with settings matching the TGS-soft solver
/// Initialize the simulation parameters with settings matching the TGS-soft solver
/// with warmstarting.
///
/// This is the default configuration, equivalent to [`IntegrationParameters::default()`].

View File

@@ -128,7 +128,7 @@ impl OneBodyConstraintBuilder {
// Normal part.
let normal_rhs_wo_bias;
{
let mut gcross2 = mprops2
let gcross2 = mprops2
.effective_world_inv_inertia_sqrt
.transform_vector(dp2.gcross(-force_dir1));

View File

@@ -8,7 +8,6 @@ use crate::geometry::{ContactManifold, ContactManifoldIndex};
use crate::math::{Isometry, Real, Vector, DIM, MAX_MANIFOLD_POINTS};
use crate::utils::{self, SimdAngularInertia, SimdBasis, SimdCross, SimdDot};
use na::{DVector, Matrix2};
use num::Pow;
use super::{TwoBodyConstraintElement, TwoBodyConstraintNormalPart};

View File

@@ -1,11 +1,9 @@
use crate::dynamics::integration_parameters::BLOCK_SOLVER_ENABLED;
use crate::dynamics::solver::contact_constraint::OneBodyConstraintNormalPart;
use crate::dynamics::solver::SolverVel;
use crate::math::{AngVector, TangentImpulse, Vector, DIM};
use crate::utils::{SimdBasis, SimdDot, SimdRealCopy};
use na::{Matrix2, Vector2};
use num::Zero;
use simba::simd::{SimdPartialOrd, SimdValue};
use na::Vector2;
use simba::simd::SimdValue;
#[derive(Copy, Clone, Debug)]
pub(crate) struct TwoBodyConstraintTangentPart<N: SimdRealCopy> {

View File

@@ -14,7 +14,6 @@ use crate::math::{
#[cfg(feature = "dim2")]
use crate::utils::SimdBasis;
use crate::utils::{self, SimdAngularInertia, SimdCross, SimdDot};
use na::Matrix2;
use num::Zero;
use parry::math::SimdBool;
use parry::utils::SdpMatrix2;

View File

@@ -10,7 +10,6 @@ use crate::math::Real;
use crate::prelude::RigidBodyVelocity;
use crate::utils::SimdAngularInertia;
use na::DVector;
use ordered_float::OrderedFloat;
pub(crate) struct VelocitySolver {
pub solver_bodies: Vec<SolverBody>,

View File

@@ -3,7 +3,7 @@ use super::{
};
use crate::geometry::{
BroadPhaseProxyIndex, Collider, ColliderBroadPhaseData, ColliderChanges, ColliderHandle,
ColliderPosition, ColliderSet, ColliderShape,
ColliderSet,
};
use crate::math::{Isometry, Real};
use crate::prelude::{BroadPhase, RigidBodySet};
@@ -606,7 +606,7 @@ impl BroadPhase for BroadPhaseMultiSap {
prediction_distance,
*handle,
&mut new_proxy_id,
&co,
co,
next_pos.as_ref(),
) {
need_region_propagation = true;

View File

@@ -1,5 +1,4 @@
use crate::geometry::{BroadPhasePairEvent, ColliderHandle, ColliderPair, ColliderSet};
use parry::bounding_volume::BoundingVolume;
use parry::math::Real;
use parry::partitioning::Qbvh;
use parry::partitioning::QbvhUpdateWorkspace;

View File

@@ -1,9 +1,8 @@
use crate::dynamics::{RigidBodyHandle, RigidBodySet};
use crate::geometry::{ColliderHandle, ColliderSet, Contact, ContactManifold};
use crate::math::{Point, Real, TangentImpulse, Vector, ANG_DIM};
use crate::math::{Point, Real, TangentImpulse, Vector};
use crate::pipeline::EventHandler;
use crate::prelude::CollisionEventFlags;
use parry::math::AngVector;
use parry::query::ContactManifoldsWorkspace;
use super::CollisionEvent;
@@ -304,7 +303,9 @@ pub struct SolverContact {
pub tangent_velocity: Vector<Real>,
/// Whether or not this contact existed during the last timestep.
pub is_new: bool,
/// Impulse used to warmstart the solve for the normal constraint.
pub warmstart_impulse: Real,
/// Impulse used to warmstart the solve for the friction constraints.
pub warmstart_tangent_impulse: TangentImpulse<Real>,
}

View File

@@ -166,6 +166,7 @@ pub mod math {
#[cfg(feature = "dim2")]
pub type JacobianViewMut<'a, N> = na::MatrixViewMut3xX<'a, N>;
/// The type of impulse applied for friction constraints.
#[cfg(feature = "dim2")]
pub type TangentImpulse<N> = na::Vector1<N>;
@@ -198,6 +199,7 @@ pub mod math {
#[cfg(feature = "dim3")]
pub type JacobianViewMut<'a, N> = na::MatrixViewMut6xX<'a, N>;
/// The type of impulse applied for friction constraints.
#[cfg(feature = "dim3")]
pub type TangentImpulse<N> = na::Vector2<N>;

View File

@@ -16,7 +16,6 @@ use parry::query::visitors::{
};
use parry::query::{DefaultQueryDispatcher, NonlinearRigidMotion, QueryDispatcher, TOI};
use parry::shape::{FeatureId, Shape, TypedSimdCompositeShape};
use parry::utils::DefaultStorage;
use std::sync::Arc;
/// A pipeline for performing queries on all the colliders of a scene.
@@ -248,7 +247,6 @@ impl<'a> TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'a> {
type PartShape = dyn Shape;
type PartNormalConstraints = dyn NormalConstraints;
type PartId = ColliderHandle;
type QbvhStorage = DefaultStorage;
fn map_typed_part_at(
&self,