diff options
Diffstat (limited to 'benchmarks3d/joint_prismatic3.rs')
| -rw-r--r-- | benchmarks3d/joint_prismatic3.rs | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/benchmarks3d/joint_prismatic3.rs b/benchmarks3d/joint_prismatic3.rs index b011662..80839d7 100644 --- a/benchmarks3d/joint_prismatic3.rs +++ b/benchmarks3d/joint_prismatic3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let mut joints = JointSet::new(); + let mut impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); let rad = 0.4; let num = 5; @@ -47,19 +48,10 @@ pub fn init_world(testbed: &mut Testbed) { UnitVector::new_normalize(vector![-1.0, 1.0, 0.0]) }; - let z = Vector::z(); - let mut prism = PrismaticJoint::new( - Point::origin(), - axis, - z, - point![0.0, 0.0, -shift], - axis, - z, - ); - prism.limits_enabled = true; - prism.limits[0] = -2.0; - prism.limits[1] = 2.0; - joints.insert(curr_parent, curr_child, prism); + let prism = PrismaticJoint::new(axis) + .local_anchor2(point![0.0, 0.0, -shift]) + .limit_axis([-2.0, 0.0]); + impulse_joints.insert(curr_parent, curr_child, prism); curr_parent = curr_child; } @@ -70,6 +62,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![262.0, 63.0, 124.0], point![101.0, 4.0, -3.0]); } |
