Fix warnings.
This commit is contained in:
@@ -210,7 +210,8 @@ impl BallVelocityConstraint {
|
||||
let new_impulse = self.motor_impulse + motor_inv_lhs.transform_vector(dangvel);
|
||||
|
||||
#[cfg(feature = "dim2")]
|
||||
let clamped_impulse = na::clamp(new_impulse, -motor_max_impulse, motor_max_impulse);
|
||||
let clamped_impulse =
|
||||
na::clamp(new_impulse, -self.motor_max_impulse, self.motor_max_impulse);
|
||||
#[cfg(feature = "dim3")]
|
||||
let clamped_impulse = new_impulse.cap_magnitude(self.motor_max_impulse);
|
||||
|
||||
@@ -418,7 +419,8 @@ impl BallVelocityGroundConstraint {
|
||||
let new_impulse = self.motor_impulse + motor_inv_lhs.transform_vector(dangvel);
|
||||
|
||||
#[cfg(feature = "dim2")]
|
||||
let clamped_impulse = na::clamp(new_impulse, -motor_max_impulse, motor_max_impulse);
|
||||
let clamped_impulse =
|
||||
na::clamp(new_impulse, -self.motor_max_impulse, self.motor_max_impulse);
|
||||
#[cfg(feature = "dim3")]
|
||||
let clamped_impulse = new_impulse.cap_magnitude(self.motor_max_impulse);
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ use super::{
|
||||
WFixedPositionGroundConstraint, WPrismaticPositionConstraint,
|
||||
WPrismaticPositionGroundConstraint,
|
||||
};
|
||||
use crate::dynamics::solver::DeltaVel;
|
||||
use crate::dynamics::{IntegrationParameters, Joint, JointParams, RigidBodySet};
|
||||
#[cfg(feature = "simd-is-enabled")]
|
||||
use crate::math::SIMD_WIDTH;
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::dynamics::{
|
||||
IntegrationParameters, JointGraphEdge, JointIndex, JointParams, PrismaticJoint, RigidBody,
|
||||
};
|
||||
use crate::math::{AngularInertia, Real, Vector};
|
||||
use crate::utils::{WAngularInertia, WCross, WCrossMatrix};
|
||||
use crate::utils::{WAngularInertia, WCross, WCrossMatrix, WDot};
|
||||
#[cfg(feature = "dim3")]
|
||||
use na::{Cholesky, Matrix3x2, Matrix5, Vector5, U2, U3};
|
||||
#[cfg(feature = "dim2")]
|
||||
@@ -148,7 +148,6 @@ impl PrismaticVelocityConstraint {
|
||||
*/
|
||||
let mut motor_rhs = 0.0;
|
||||
let mut motor_inv_lhs = 0.0;
|
||||
let mut motor_max_impulse = joint.motor_max_impulse;
|
||||
|
||||
let (stiffness, damping, gamma, keep_lhs) = joint.motor_model.combine_coefficients(
|
||||
params.dt,
|
||||
@@ -171,7 +170,11 @@ impl PrismaticVelocityConstraint {
|
||||
motor_rhs /= gamma;
|
||||
}
|
||||
|
||||
let motor_impulse = na::clamp(joint.motor_impulse, -motor_max_impulse, motor_max_impulse);
|
||||
let motor_impulse = na::clamp(
|
||||
joint.motor_impulse,
|
||||
-joint.motor_max_impulse,
|
||||
joint.motor_max_impulse,
|
||||
);
|
||||
|
||||
/*
|
||||
* Setup limit constraint.
|
||||
@@ -202,8 +205,8 @@ impl PrismaticVelocityConstraint {
|
||||
let gcross2 = r2.gcross(*axis2);
|
||||
limits_inv_lhs = crate::utils::inv(
|
||||
im1 + im2
|
||||
+ gcross1.dot(&ii1.transform_vector(gcross1))
|
||||
+ gcross2.dot(&ii2.transform_vector(gcross2)),
|
||||
+ gcross1.gdot(ii1.transform_vector(gcross1))
|
||||
+ gcross2.gdot(ii2.transform_vector(gcross2)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -226,7 +229,7 @@ impl PrismaticVelocityConstraint {
|
||||
motor_impulse,
|
||||
motor_axis1: *axis1,
|
||||
motor_axis2: *axis2,
|
||||
motor_max_impulse,
|
||||
motor_max_impulse: joint.motor_max_impulse,
|
||||
basis1,
|
||||
inv_lhs,
|
||||
rhs,
|
||||
@@ -530,7 +533,6 @@ impl PrismaticVelocityGroundConstraint {
|
||||
*/
|
||||
let mut motor_rhs = 0.0;
|
||||
let mut motor_inv_lhs = 0.0;
|
||||
let mut motor_max_impulse = joint.motor_max_impulse;
|
||||
|
||||
let (stiffness, damping, gamma, keep_lhs) = joint.motor_model.combine_coefficients(
|
||||
params.dt,
|
||||
@@ -553,7 +555,11 @@ impl PrismaticVelocityGroundConstraint {
|
||||
motor_rhs /= gamma;
|
||||
}
|
||||
|
||||
let motor_impulse = na::clamp(joint.motor_impulse, -motor_max_impulse, motor_max_impulse);
|
||||
let motor_impulse = na::clamp(
|
||||
joint.motor_impulse,
|
||||
-joint.motor_max_impulse,
|
||||
joint.motor_max_impulse,
|
||||
);
|
||||
|
||||
/*
|
||||
* Setup limit constraint.
|
||||
@@ -590,7 +596,7 @@ impl PrismaticVelocityGroundConstraint {
|
||||
motor_rhs,
|
||||
motor_inv_lhs,
|
||||
motor_impulse,
|
||||
motor_max_impulse,
|
||||
motor_max_impulse: joint.motor_max_impulse,
|
||||
basis1,
|
||||
inv_lhs,
|
||||
rhs,
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::dynamics::{
|
||||
use crate::math::{
|
||||
AngVector, AngularInertia, Isometry, Point, Real, SimdBool, SimdReal, Vector, SIMD_WIDTH,
|
||||
};
|
||||
use crate::utils::{WAngularInertia, WCross, WCrossMatrix};
|
||||
use crate::utils::{WAngularInertia, WCross, WCrossMatrix, WDot};
|
||||
#[cfg(feature = "dim3")]
|
||||
use na::{Cholesky, Matrix3x2, Matrix5, Vector5, U2, U3};
|
||||
#[cfg(feature = "dim2")]
|
||||
@@ -223,8 +223,8 @@ impl WPrismaticVelocityConstraint {
|
||||
limits_inv_lhs = SimdReal::splat(1.0)
|
||||
/ (im1
|
||||
+ im2
|
||||
+ gcross1.dot(&ii1.transform_vector(gcross1))
|
||||
+ gcross2.dot(&ii2.transform_vector(gcross2)));
|
||||
+ gcross1.gdot(ii1.transform_vector(gcross1))
|
||||
+ gcross2.gdot(ii2.transform_vector(gcross2)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::dynamics::{IntegrationParameters, RevoluteJoint, RigidBody};
|
||||
use crate::math::{AngularInertia, Isometry, Point, Real, Rotation, Vector};
|
||||
use crate::utils::{WAngularInertia, WCross, WCrossMatrix};
|
||||
use na::{Matrix3x2, Matrix5, Unit};
|
||||
use na::Unit;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct RevolutePositionConstraint {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
use crate::dynamics::solver::{AnyJointVelocityConstraint, AnyVelocityConstraint, DeltaVel};
|
||||
use crate::dynamics::solver::{AnyJointVelocityConstraint, DeltaVel};
|
||||
use crate::dynamics::{
|
||||
IntegrationParameters, JointGraphEdge, JointIndex, JointParams, RevoluteJoint, RigidBody,
|
||||
};
|
||||
use crate::math::{AngularInertia, Real, Rotation, Vector};
|
||||
use crate::na::UnitQuaternion;
|
||||
use crate::utils::{WAngularInertia, WCross, WCrossMatrix};
|
||||
use downcast_rs::Downcast;
|
||||
use na::{Cholesky, Matrix3, Matrix3x2, Matrix5, RealField, Vector5, U2, U3};
|
||||
use na::{Cholesky, Matrix3x2, Matrix5, Vector5, U2, U3};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct RevoluteVelocityConstraint {
|
||||
@@ -93,7 +92,7 @@ impl RevoluteVelocityConstraint {
|
||||
|
||||
let lin_rhs = (rb2.linvel + rb2.angvel.gcross(r2)) - (rb1.linvel + rb1.angvel.gcross(r1));
|
||||
let ang_rhs = basis2.tr_mul(&rb2.angvel) - basis1.tr_mul(&rb1.angvel);
|
||||
let mut rhs = Vector5::new(lin_rhs.x, lin_rhs.y, lin_rhs.z, ang_rhs.x, ang_rhs.y);
|
||||
let rhs = Vector5::new(lin_rhs.x, lin_rhs.y, lin_rhs.z, ang_rhs.x, ang_rhs.y);
|
||||
|
||||
/*
|
||||
* Motor.
|
||||
@@ -102,8 +101,8 @@ impl RevoluteVelocityConstraint {
|
||||
let motor_axis2 = rb2.position * *joint.local_axis2;
|
||||
let mut motor_rhs = 0.0;
|
||||
let mut motor_inv_lhs = 0.0;
|
||||
let mut motor_max_impulse = joint.motor_max_impulse;
|
||||
let mut motor_angle = 0.0;
|
||||
let motor_max_impulse = joint.motor_max_impulse;
|
||||
|
||||
let (stiffness, damping, gamma, keep_lhs) = joint.motor_model.combine_coefficients(
|
||||
params.dt,
|
||||
@@ -381,8 +380,8 @@ impl RevoluteVelocityGroundConstraint {
|
||||
*/
|
||||
let mut motor_rhs = 0.0;
|
||||
let mut motor_inv_lhs = 0.0;
|
||||
let mut motor_max_impulse = joint.motor_max_impulse;
|
||||
let mut motor_angle = 0.0;
|
||||
let motor_max_impulse = joint.motor_max_impulse;
|
||||
|
||||
let (stiffness, damping, gamma, keep_lhs) = joint.motor_model.combine_coefficients(
|
||||
params.dt,
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::math::{
|
||||
AngVector, AngularInertia, Isometry, Point, Real, Rotation, SimdReal, Vector, SIMD_WIDTH,
|
||||
};
|
||||
use crate::utils::{WAngularInertia, WCross, WCrossMatrix};
|
||||
use na::{Cholesky, Matrix3, Matrix3x2, Matrix5, Vector5, U2, U3};
|
||||
use na::{Cholesky, Matrix3x2, Matrix5, Vector5, U2, U3};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct WRevoluteVelocityConstraint {
|
||||
|
||||
Reference in New Issue
Block a user