diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-01-21 14:58:40 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-01-21 14:58:40 +0100 |
| commit | 8f330b2a00610e5b68c1acd9208120e8f750c7aa (patch) | |
| tree | 9526425839601340953ebe2b94bd2bbb36161579 /examples3d | |
| parent | d69b5876f35a6d67e164e5e6dc5719413f53c4f5 (diff) | |
| download | rapier-8f330b2a00610e5b68c1acd9208120e8f750c7aa.tar.gz rapier-8f330b2a00610e5b68c1acd9208120e8f750c7aa.tar.bz2 rapier-8f330b2a00610e5b68c1acd9208120e8f750c7aa.zip | |
Rotation locking: apply filter only to the world inertia properties to fix the multi-collider case.
Diffstat (limited to 'examples3d')
| -rw-r--r-- | examples3d/locked_rotations3.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples3d/locked_rotations3.rs b/examples3d/locked_rotations3.rs index a39895a..c626925 100644 --- a/examples3d/locked_rotations3.rs +++ b/examples3d/locked_rotations3.rs @@ -33,7 +33,7 @@ pub fn init_world(testbed: &mut Testbed) { let rigid_body = RigidBodyBuilder::new_dynamic() .translation(0.0, 3.0, 0.0) .lock_translations() - .principal_angular_inertia(Vector3::zeros(), Vector3::new(true, false, false)) + .restrict_rotations(true, false, false) .build(); let handle = bodies.insert(rigid_body); let collider = ColliderBuilder::cuboid(0.2, 0.6, 2.0).build(); @@ -50,6 +50,8 @@ pub fn init_world(testbed: &mut Testbed) { let handle = bodies.insert(rigid_body); let collider = ColliderBuilder::capsule_y(0.6, 0.4).build(); colliders.insert(collider, handle, &mut bodies); + let collider = ColliderBuilder::capsule_x(0.6, 0.4).build(); + colliders.insert(collider, handle, &mut bodies); /* * Set up the testbed. |
