feat: rename JointAxesMask::X/Y/Z by ::LIN_X/LIN_Y/LIN_Z and JointAxis::X/Y/Z by ::LinX/LinY/LinZ

This commit is contained in:
Sébastien Crozet
2024-05-26 18:12:26 +02:00
committed by Sébastien Crozet
parent 5c44d936f7
commit c785ea4996
7 changed files with 61 additions and 59 deletions

View File

@@ -92,19 +92,19 @@ impl PrismaticJoint {
/// The motor affecting the joints translational degree of freedom.
#[must_use]
pub fn motor(&self) -> Option<&JointMotor> {
self.data.motor(JointAxis::X)
self.data.motor(JointAxis::LinX)
}
/// Set the spring-like model used by the motor to reach the desired target velocity and position.
pub fn set_motor_model(&mut self, model: MotorModel) -> &mut Self {
self.data.set_motor_model(JointAxis::X, model);
self.data.set_motor_model(JointAxis::LinX, model);
self
}
/// Sets the target velocity this motor needs to reach.
pub fn set_motor_velocity(&mut self, target_vel: Real, factor: Real) -> &mut Self {
self.data
.set_motor_velocity(JointAxis::X, target_vel, factor);
.set_motor_velocity(JointAxis::LinX, target_vel, factor);
self
}
@@ -116,7 +116,7 @@ impl PrismaticJoint {
damping: Real,
) -> &mut Self {
self.data
.set_motor_position(JointAxis::X, target_pos, stiffness, damping);
.set_motor_position(JointAxis::LinX, target_pos, stiffness, damping);
self
}
@@ -129,25 +129,25 @@ impl PrismaticJoint {
damping: Real,
) -> &mut Self {
self.data
.set_motor(JointAxis::X, target_pos, target_vel, stiffness, damping);
.set_motor(JointAxis::LinX, target_pos, target_vel, stiffness, damping);
self
}
/// Sets the maximum force the motor can deliver.
pub fn set_motor_max_force(&mut self, max_force: Real) -> &mut Self {
self.data.set_motor_max_force(JointAxis::X, max_force);
self.data.set_motor_max_force(JointAxis::LinX, max_force);
self
}
/// The limit distance attached bodies can translate along the joints principal axis.
#[must_use]
pub fn limits(&self) -> Option<&JointLimits<Real>> {
self.data.limits(JointAxis::X)
self.data.limits(JointAxis::LinX)
}
/// Sets the `[min,max]` limit distances attached bodies can translate along the joints principal axis.
pub fn set_limits(&mut self, limits: [Real; 2]) -> &mut Self {
self.data.set_limits(JointAxis::X, limits);
self.data.set_limits(JointAxis::LinX, limits);
self
}
}