Fix warnings.
This commit is contained in:
@@ -74,20 +74,24 @@ impl BallJoint {
|
||||
self.motor_max_impulse == 0.0 || (self.motor_stiffness == 0.0 && self.motor_damping == 0.0)
|
||||
}
|
||||
|
||||
/// Set the spring-like model used by the motor to reach the desired target velocity and position.
|
||||
pub fn configure_motor_model(&mut self, model: SpringModel) {
|
||||
self.motor_model = model;
|
||||
}
|
||||
|
||||
/// Sets the target velocity and velocity correction factor this motor.
|
||||
#[cfg(feature = "dim2")]
|
||||
pub fn configure_motor_velocity(&mut self, target_vel: Real, factor: Real) {
|
||||
self.configure_motor(self.motor_target_pos, target_vel, 0.0, factor)
|
||||
}
|
||||
|
||||
/// Sets the target velocity and velocity correction factor this motor.
|
||||
#[cfg(feature = "dim3")]
|
||||
pub fn configure_motor_velocity(&mut self, target_vel: Vector<Real>, factor: Real) {
|
||||
self.configure_motor(self.motor_target_pos, target_vel, 0.0, factor)
|
||||
}
|
||||
|
||||
/// Sets the target orientation this motor needs to reach.
|
||||
pub fn configure_motor_position(
|
||||
&mut self,
|
||||
target_pos: Rotation<Real>,
|
||||
@@ -97,6 +101,7 @@ impl BallJoint {
|
||||
self.configure_motor(target_pos, na::zero(), stiffness, damping)
|
||||
}
|
||||
|
||||
/// Sets the target orientation this motor needs to reach.
|
||||
#[cfg(feature = "dim2")]
|
||||
pub fn configure_motor(
|
||||
&mut self,
|
||||
@@ -111,6 +116,7 @@ impl BallJoint {
|
||||
self.motor_damping = damping;
|
||||
}
|
||||
|
||||
/// Configure both the target orientation and target velocity of the motor.
|
||||
#[cfg(feature = "dim3")]
|
||||
pub fn configure_motor(
|
||||
&mut self,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::dynamics::{BallJoint, FixedJoint, PrismaticJoint, RevoluteJoint};
|
||||
use crate::math::{Isometry, Real, SpacialVector, SPATIAL_DIM};
|
||||
use crate::math::{Isometry, Real, SpacialVector};
|
||||
use crate::na::{Rotation3, UnitQuaternion};
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
|
||||
@@ -130,6 +130,7 @@ pub struct Joint {
|
||||
}
|
||||
|
||||
impl Joint {
|
||||
/// Can this joint use SIMD-accelerated constraint formulations?
|
||||
pub fn supports_simd_constraints(&self) -> bool {
|
||||
match &self.params {
|
||||
JointParams::PrismaticJoint(joint) => joint.supports_simd_constraints(),
|
||||
|
||||
@@ -217,18 +217,22 @@ impl PrismaticJoint {
|
||||
Isometry::from_parts(translation, rotation)
|
||||
}
|
||||
|
||||
/// Set the spring-like model used by the motor to reach the desired target velocity and position.
|
||||
pub fn configure_motor_model(&mut self, model: SpringModel) {
|
||||
self.motor_model = model;
|
||||
}
|
||||
|
||||
/// Sets the target velocity this motor needs to reach.
|
||||
pub fn configure_motor_velocity(&mut self, target_vel: Real, factor: Real) {
|
||||
self.configure_motor(self.motor_target_pos, target_vel, 0.0, factor)
|
||||
}
|
||||
|
||||
/// Sets the target position this motor needs to reach.
|
||||
pub fn configure_motor_position(&mut self, target_pos: Real, stiffness: Real, damping: Real) {
|
||||
self.configure_motor(target_pos, 0.0, stiffness, damping)
|
||||
}
|
||||
|
||||
/// Configure both the target position and target velocity of the motor.
|
||||
pub fn configure_motor(
|
||||
&mut self,
|
||||
target_pos: Real,
|
||||
|
||||
@@ -85,18 +85,22 @@ impl RevoluteJoint {
|
||||
self.motor_max_impulse == 0.0 || (self.motor_stiffness == 0.0 && self.motor_damping == 0.0)
|
||||
}
|
||||
|
||||
/// Set the spring-like model used by the motor to reach the desired target velocity and position.
|
||||
pub fn configure_motor_model(&mut self, model: SpringModel) {
|
||||
self.motor_model = model;
|
||||
}
|
||||
|
||||
/// Sets the target velocity this motor needs to reach.
|
||||
pub fn configure_motor_velocity(&mut self, target_vel: Real, factor: Real) {
|
||||
self.configure_motor(self.motor_target_pos, target_vel, 0.0, factor)
|
||||
}
|
||||
|
||||
/// Sets the target angle this motor needs to reach.
|
||||
pub fn configure_motor_position(&mut self, target_pos: Real, stiffness: Real, damping: Real) {
|
||||
self.configure_motor(target_pos, 0.0, stiffness, damping)
|
||||
}
|
||||
|
||||
/// Configure both the target angle and target velocity of the motor.
|
||||
pub fn configure_motor(
|
||||
&mut self,
|
||||
target_pos: Real,
|
||||
|
||||
Reference in New Issue
Block a user