Implement multibody joints and the new solver
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user