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:
committed by
Sébastien Crozet
parent
5c44d936f7
commit
c785ea4996
@@ -18,9 +18,9 @@ fn create_coupled_joints(
|
||||
colliders.insert_with_parent(ColliderBuilder::cuboid(1.0, 1.0, 1.0), body1, bodies);
|
||||
|
||||
let joint1 = GenericJointBuilder::new(JointAxesMask::empty())
|
||||
.limits(JointAxis::X, [-3.0, 3.0])
|
||||
.limits(JointAxis::Y, [0.0, 3.0])
|
||||
.coupled_axes(JointAxesMask::Y | JointAxesMask::Z);
|
||||
.limits(JointAxis::LinX, [-3.0, 3.0])
|
||||
.limits(JointAxis::LinY, [0.0, 3.0])
|
||||
.coupled_axes(JointAxesMask::LIN_Y | JointAxesMask::LIN_Z);
|
||||
|
||||
if use_articulations {
|
||||
multibody_joints.insert(ground, body1, joint1, true);
|
||||
@@ -416,13 +416,13 @@ fn create_spherical_joints_with_limits(
|
||||
|
||||
let joint1 = SphericalJointBuilder::new()
|
||||
.local_anchor2(Point::from(-shift))
|
||||
.limits(JointAxis::X, [-0.2, 0.2])
|
||||
.limits(JointAxis::Y, [-0.2, 0.2]);
|
||||
.limits(JointAxis::LinX, [-0.2, 0.2])
|
||||
.limits(JointAxis::LinY, [-0.2, 0.2]);
|
||||
|
||||
let joint2 = SphericalJointBuilder::new()
|
||||
.local_anchor2(Point::from(-shift))
|
||||
.limits(JointAxis::X, [-0.3, 0.3])
|
||||
.limits(JointAxis::Y, [-0.3, 0.3]);
|
||||
.limits(JointAxis::LinX, [-0.3, 0.3])
|
||||
.limits(JointAxis::LinY, [-0.3, 0.3]);
|
||||
|
||||
if use_articulations {
|
||||
multibody_joints.insert(ground, ball1, joint1, true);
|
||||
|
||||
@@ -96,15 +96,17 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
wheel_pos_in_car_space - body_position_in_car_space;
|
||||
|
||||
// Suspension between the body and the axle.
|
||||
let mut locked_axes =
|
||||
JointAxesMask::X | JointAxesMask::Z | JointAxesMask::ANG_X | JointAxesMask::ANG_Z;
|
||||
let mut locked_axes = JointAxesMask::LIN_X
|
||||
| JointAxesMask::LIN_Z
|
||||
| JointAxesMask::ANG_X
|
||||
| JointAxesMask::ANG_Z;
|
||||
if !is_front {
|
||||
locked_axes |= JointAxesMask::ANG_Y;
|
||||
}
|
||||
|
||||
let mut suspension_joint = GenericJointBuilder::new(locked_axes)
|
||||
.limits(JointAxis::Y, [0.0, suspension_height])
|
||||
.motor_position(JointAxis::Y, 0.0, 1.0e4, 1.0e3)
|
||||
.limits(JointAxis::LinY, [0.0, suspension_height])
|
||||
.motor_position(JointAxis::LinY, 0.0, 1.0e4, 1.0e3)
|
||||
.local_anchor1(suspension_attachment_in_body_space.into());
|
||||
|
||||
if is_front {
|
||||
|
||||
Reference in New Issue
Block a user