aboutsummaryrefslogtreecommitdiff
path: root/benchmarks3d/joint_revolute3.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-01-02 14:47:40 +0100
committerSébastien Crozet <developer@crozet.re>2022-01-02 16:58:36 +0100
commitf74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc (patch)
tree53ac492fea5942a7d466f58a0095f39505674ea4 /benchmarks3d/joint_revolute3.rs
parentb45d4b5ac2b31856c15e802b31e288a58940cbf2 (diff)
downloadrapier-f74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc.tar.gz
rapier-f74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc.tar.bz2
rapier-f74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc.zip
Implement multibody joints and the new solver
Diffstat (limited to 'benchmarks3d/joint_revolute3.rs')
-rw-r--r--benchmarks3d/joint_revolute3.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/benchmarks3d/joint_revolute3.rs b/benchmarks3d/joint_revolute3.rs
index d6dc06c..8bdf0e9 100644
--- a/benchmarks3d/joint_revolute3.rs
+++ b/benchmarks3d/joint_revolute3.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 = 10;
@@ -49,22 +50,21 @@ pub fn init_world(testbed: &mut Testbed) {
colliders.insert_with_parent(collider, handles[k], &mut bodies);
}
- // Setup four joints.
- let o = Point::origin();
+ // Setup four impulse_joints.
let x = Vector::x_axis();
let z = Vector::z_axis();
let revs = [
- RevoluteJoint::new(o, z, point![0.0, 0.0, -shift], z),
- RevoluteJoint::new(o, x, point![-shift, 0.0, 0.0], x),
- RevoluteJoint::new(o, z, point![0.0, 0.0, -shift], z),
- RevoluteJoint::new(o, x, point![shift, 0.0, 0.0], x),
+ RevoluteJoint::new(z).local_anchor2(point![0.0, 0.0, -shift]),
+ RevoluteJoint::new(x).local_anchor2(point![-shift, 0.0, 0.0]),
+ RevoluteJoint::new(z).local_anchor2(point![0.0, 0.0, -shift]),
+ RevoluteJoint::new(x).local_anchor2(point![shift, 0.0, 0.0]),
];
- joints.insert(curr_parent, handles[0], revs[0]);
- joints.insert(handles[0], handles[1], revs[1]);
- joints.insert(handles[1], handles[2], revs[2]);
- joints.insert(handles[2], handles[3], revs[3]);
+ impulse_joints.insert(curr_parent, handles[0], revs[0]);
+ impulse_joints.insert(handles[0], handles[1], revs[1]);
+ impulse_joints.insert(handles[1], handles[2], revs[2]);
+ impulse_joints.insert(handles[2], handles[3], revs[3]);
curr_parent = handles[3];
}
@@ -74,6 +74,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![478.0, 83.0, 228.0], point![134.0, 83.0, -116.0]);
}