From 7983c256064b021400a529be01bd092d87ed0e85 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Mon, 8 Mar 2021 15:12:45 +0100 Subject: Start introducing SAP layers. --- examples3d/all_examples3.rs | 2 ++ examples3d/debug_big_colliders3.rs | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 examples3d/debug_big_colliders3.rs (limited to 'examples3d') diff --git a/examples3d/all_examples3.rs b/examples3d/all_examples3.rs index 724aa45..a8c38c6 100644 --- a/examples3d/all_examples3.rs +++ b/examples3d/all_examples3.rs @@ -16,6 +16,7 @@ mod convex_decomposition3; mod convex_polyhedron3; mod damping3; mod debug_add_remove_collider3; +mod debug_big_colliders3; mod debug_boxes3; mod debug_cylinder3; mod debug_dynamic_collider_add3; @@ -95,6 +96,7 @@ pub fn main() { "(Debug) add/rm collider", debug_add_remove_collider3::init_world, ), + ("(Debug) big colliders", debug_big_colliders3::init_world), ("(Debug) boxes", debug_boxes3::init_world), ( "(Debug) dyn. coll. add", diff --git a/examples3d/debug_big_colliders3.rs b/examples3d/debug_big_colliders3.rs new file mode 100644 index 0000000..c2b62e2 --- /dev/null +++ b/examples3d/debug_big_colliders3.rs @@ -0,0 +1,53 @@ +use na::Point3; +use rapier3d::dynamics::{JointSet, RigidBodyBuilder, RigidBodySet}; +use rapier3d::geometry::{ColliderBuilder, ColliderSet}; +use rapier_testbed3d::Testbed; + +pub fn init_world(testbed: &mut Testbed) { + /* + * World + */ + let mut bodies = RigidBodySet::new(); + let mut colliders = ColliderSet::new(); + let joints = JointSet::new(); + + /* + * Ground + */ + let ground_size = 100.0; + let ground_height = 0.1; + + let rigid_body = RigidBodyBuilder::new_static().build(); + let handle = bodies.insert(rigid_body); + let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size) + .friction(1.5) + .build(); + colliders.insert(collider, handle, &mut bodies); + + let mut curr_y = 0.0; + let mut curr_width = 1_000.0; + + for _ in 0..6 { + curr_y += curr_width; + + let rigid_body = RigidBodyBuilder::new_dynamic() + .translation(0.0, curr_y, 0.0) + .build(); + let handle = bodies.insert(rigid_body); + let collider = ColliderBuilder::cuboid(curr_width, curr_width, curr_width).build(); + colliders.insert(collider, handle, &mut bodies); + + curr_width /= 10.0; + } + + /* + * Set up the testbed. + */ + testbed.set_world(bodies, colliders, joints); + testbed.look_at(Point3::new(10.0, 10.0, 10.0), Point3::origin()); +} + +fn main() { + let testbed = Testbed::from_builders(0, vec![("Boxes", init_world)]); + testbed.run() +} -- cgit From 3a1502be74901f3df96a05a7d479f15bd4f8b507 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Sat, 13 Mar 2021 18:00:58 +0100 Subject: First complete implementation of the hierarchical SAP. --- examples3d/debug_infinite_fall3.rs | 21 +++++++++++++++++ examples3d/fountain3.rs | 4 ++++ examples3d/primitives3.rs | 48 ++++++++++++++++++++++++-------------- 3 files changed, 56 insertions(+), 17 deletions(-) (limited to 'examples3d') diff --git a/examples3d/debug_infinite_fall3.rs b/examples3d/debug_infinite_fall3.rs index d1bda45..2a85e37 100644 --- a/examples3d/debug_infinite_fall3.rs +++ b/examples3d/debug_infinite_fall3.rs @@ -10,6 +10,19 @@ pub fn init_world(testbed: &mut Testbed) { let mut colliders = ColliderSet::new(); let joints = JointSet::new(); + /* + * Ground + */ + let ground_size = 100.1; + let ground_height = 2.1; + + let rigid_body = RigidBodyBuilder::new_static() + .translation(0.0, -ground_height, 0.0) + .build(); + let handle = bodies.insert(rigid_body); + let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build(); + colliders.insert(collider, handle, &mut bodies); + let rad = 1.0; // Build the dynamic box rigid body. let rigid_body = RigidBodyBuilder::new_dynamic() @@ -20,6 +33,14 @@ pub fn init_world(testbed: &mut Testbed) { let collider = ColliderBuilder::ball(rad).build(); colliders.insert(collider, handle, &mut bodies); + let rigid_body = RigidBodyBuilder::new_dynamic() + .translation(0.0, 5.0 * rad, 0.0) + .can_sleep(false) + .build(); + let handle = bodies.insert(rigid_body); + let collider = ColliderBuilder::ball(rad).build(); + colliders.insert(collider, handle, &mut bodies); + /* * Set up the testbed. */ diff --git a/examples3d/fountain3.rs b/examples3d/fountain3.rs index caaa21b..e39ff2a 100644 --- a/examples3d/fountain3.rs +++ b/examples3d/fountain3.rs @@ -80,6 +80,10 @@ pub fn init_world(testbed: &mut Testbed) { * Set up the testbed. */ testbed.set_world(bodies, colliders, joints); + testbed + .physics_state_mut() + .integration_parameters + .velocity_based_erp = 0.2; testbed.look_at(Point3::new(-30.0, 4.0, -30.0), Point3::new(0.0, 1.0, 0.0)); } diff --git a/examples3d/primitives3.rs b/examples3d/primitives3.rs index db15341..a9ae176 100644 --- a/examples3d/primitives3.rs +++ b/examples3d/primitives3.rs @@ -11,19 +11,6 @@ pub fn init_world(testbed: &mut Testbed) { let mut colliders = ColliderSet::new(); let joints = JointSet::new(); - /* - * Ground - */ - let ground_size = 100.1; - let ground_height = 2.1; - - let rigid_body = RigidBodyBuilder::new_static() - .translation(0.0, -ground_height, 0.0) - .build(); - let handle = bodies.insert(rigid_body); - let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build(); - colliders.insert(collider, handle, &mut bodies); - /* * Create the cubes */ @@ -39,11 +26,11 @@ pub fn init_world(testbed: &mut Testbed) { let mut offset = -(num as f32) * (rad * 2.0 + rad) * 0.5; - for j in 0usize..20 { - for i in 0..num { - for k in 0usize..num { + for j in 0usize..1 { + for i in 0..1 { + for k in 0usize..1 { let x = i as f32 * shiftx - centerx + offset; - let y = j as f32 * shifty + centery + 3.0; + let y = j as f32 * shifty + centery - rad; let z = k as f32 * shiftz - centerz + offset; // Build the rigid body. @@ -67,10 +54,37 @@ pub fn init_world(testbed: &mut Testbed) { offset -= 0.05 * rad * (num as f32 - 1.0); } + /* + * Ground + */ + testbed.add_callback( + move |mut window, mut graphics, physics, events, run_state| { + if run_state.timestep_id == 10 { + let ground_size = 100.1; + let ground_height = 2.1; + + let rigid_body = RigidBodyBuilder::new_static() + .translation(0.0, -ground_height, 0.0) + .build(); + let handle = physics.bodies.insert(rigid_body); + let collider = + ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build(); + physics + .colliders + .insert(collider, handle, &mut physics.bodies); + + if let (Some(graphics), Some(window)) = (&mut graphics, &mut window) { + graphics.add(window, handle, &physics.bodies, &physics.colliders); + } + } + }, + ); + /* * Set up the testbed. */ testbed.set_world(bodies, colliders, joints); + testbed.physics_state_mut().gravity.fill(0.0); testbed.look_at(Point3::new(100.0, 100.0, 100.0), Point3::origin()); } -- cgit From 326469a1df9d8502903d88fe8e47a67e9e7c9edd Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Wed, 17 Mar 2021 09:34:56 +0100 Subject: Fix the last few bugs and unbounded memory usage. --- examples3d/debug_big_colliders3.rs | 23 ++++++++---------- examples3d/debug_infinite_fall3.rs | 8 ++++--- examples3d/fountain3.rs | 14 ++++------- examples3d/primitives3.rs | 48 ++++++++++++++------------------------ 4 files changed, 37 insertions(+), 56 deletions(-) (limited to 'examples3d') diff --git a/examples3d/debug_big_colliders3.rs b/examples3d/debug_big_colliders3.rs index c2b62e2..956f36a 100644 --- a/examples3d/debug_big_colliders3.rs +++ b/examples3d/debug_big_colliders3.rs @@ -1,6 +1,6 @@ -use na::Point3; +use na::{Point3, Vector3}; use rapier3d::dynamics::{JointSet, RigidBodyBuilder, RigidBodySet}; -use rapier3d::geometry::{ColliderBuilder, ColliderSet}; +use rapier3d::geometry::{ColliderBuilder, ColliderSet, HalfSpace, SharedShape}; use rapier_testbed3d::Testbed; pub fn init_world(testbed: &mut Testbed) { @@ -14,30 +14,27 @@ pub fn init_world(testbed: &mut Testbed) { /* * Ground */ - let ground_size = 100.0; - let ground_height = 0.1; - let rigid_body = RigidBodyBuilder::new_static().build(); let handle = bodies.insert(rigid_body); - let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size) - .friction(1.5) - .build(); + let halfspace = SharedShape::new(HalfSpace::new(Vector3::y_axis())); + let collider = ColliderBuilder::new(halfspace).build(); colliders.insert(collider, handle, &mut bodies); let mut curr_y = 0.0; - let mut curr_width = 1_000.0; + let mut curr_width = 10_000.0; - for _ in 0..6 { - curr_y += curr_width; + for _ in 0..12 { + let curr_height = 0.1f32.min(curr_width); + curr_y += curr_height * 4.0; let rigid_body = RigidBodyBuilder::new_dynamic() .translation(0.0, curr_y, 0.0) .build(); let handle = bodies.insert(rigid_body); - let collider = ColliderBuilder::cuboid(curr_width, curr_width, curr_width).build(); + let collider = ColliderBuilder::cuboid(curr_width, curr_height, curr_width).build(); colliders.insert(collider, handle, &mut bodies); - curr_width /= 10.0; + curr_width /= 5.0; } /* diff --git a/examples3d/debug_infinite_fall3.rs b/examples3d/debug_infinite_fall3.rs index 2a85e37..e70a386 100644 --- a/examples3d/debug_infinite_fall3.rs +++ b/examples3d/debug_infinite_fall3.rs @@ -1,3 +1,4 @@ +use na::Point3; use rapier3d::dynamics::{JointSet, RigidBodyBuilder, RigidBodySet}; use rapier3d::geometry::{ColliderBuilder, ColliderSet}; use rapier_testbed3d::Testbed; @@ -17,7 +18,7 @@ pub fn init_world(testbed: &mut Testbed) { let ground_height = 2.1; let rigid_body = RigidBodyBuilder::new_static() - .translation(0.0, -ground_height, 0.0) + .translation(0.0, 4.0, 0.0) .build(); let handle = bodies.insert(rigid_body); let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build(); @@ -26,7 +27,7 @@ pub fn init_world(testbed: &mut Testbed) { let rad = 1.0; // Build the dynamic box rigid body. let rigid_body = RigidBodyBuilder::new_dynamic() - .translation(0.0, 3.0 * rad, 0.0) + .translation(0.0, 7.0 * rad, 0.0) .can_sleep(false) .build(); let handle = bodies.insert(rigid_body); @@ -34,7 +35,7 @@ pub fn init_world(testbed: &mut Testbed) { colliders.insert(collider, handle, &mut bodies); let rigid_body = RigidBodyBuilder::new_dynamic() - .translation(0.0, 5.0 * rad, 0.0) + .translation(0.0, 2.0 * rad, 0.0) .can_sleep(false) .build(); let handle = bodies.insert(rigid_body); @@ -44,6 +45,7 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ + testbed.look_at(Point3::new(100.0, -10.0, 100.0), Point3::origin()); testbed.set_world(bodies, colliders, joints); } diff --git a/examples3d/fountain3.rs b/examples3d/fountain3.rs index e39ff2a..6c80562 100644 --- a/examples3d/fountain3.rs +++ b/examples3d/fountain3.rs @@ -15,7 +15,7 @@ pub fn init_world(testbed: &mut Testbed) { * Ground */ let ground_size = 100.1; - let ground_height = 2.1; + let ground_height = 2.1; // 16.0; let rigid_body = RigidBodyBuilder::new_static() .translation(0.0, -ground_height, 0.0) @@ -64,10 +64,6 @@ pub fn init_world(testbed: &mut Testbed) { physics .bodies .remove(*handle, &mut physics.colliders, &mut physics.joints); - physics.broad_phase.maintain(&mut physics.colliders); - physics - .narrow_phase - .maintain(&mut physics.colliders, &mut physics.bodies); if let (Some(graphics), Some(window)) = (&mut graphics, &mut window) { graphics.remove_body_nodes(window, *handle); @@ -80,10 +76,10 @@ pub fn init_world(testbed: &mut Testbed) { * Set up the testbed. */ testbed.set_world(bodies, colliders, joints); - testbed - .physics_state_mut() - .integration_parameters - .velocity_based_erp = 0.2; + // testbed + // .physics_state_mut() + // .integration_parameters + // .velocity_based_erp = 0.2; testbed.look_at(Point3::new(-30.0, 4.0, -30.0), Point3::new(0.0, 1.0, 0.0)); } diff --git a/examples3d/primitives3.rs b/examples3d/primitives3.rs index a9ae176..db15341 100644 --- a/examples3d/primitives3.rs +++ b/examples3d/primitives3.rs @@ -11,6 +11,19 @@ pub fn init_world(testbed: &mut Testbed) { let mut colliders = ColliderSet::new(); let joints = JointSet::new(); + /* + * Ground + */ + let ground_size = 100.1; + let ground_height = 2.1; + + let rigid_body = RigidBodyBuilder::new_static() + .translation(0.0, -ground_height, 0.0) + .build(); + let handle = bodies.insert(rigid_body); + let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build(); + colliders.insert(collider, handle, &mut bodies); + /* * Create the cubes */ @@ -26,11 +39,11 @@ pub fn init_world(testbed: &mut Testbed) { let mut offset = -(num as f32) * (rad * 2.0 + rad) * 0.5; - for j in 0usize..1 { - for i in 0..1 { - for k in 0usize..1 { + for j in 0usize..20 { + for i in 0..num { + for k in 0usize..num { let x = i as f32 * shiftx - centerx + offset; - let y = j as f32 * shifty + centery - rad; + let y = j as f32 * shifty + centery + 3.0; let z = k as f32 * shiftz - centerz + offset; // Build the rigid body. @@ -54,37 +67,10 @@ pub fn init_world(testbed: &mut Testbed) { offset -= 0.05 * rad * (num as f32 - 1.0); } - /* - * Ground - */ - testbed.add_callback( - move |mut window, mut graphics, physics, events, run_state| { - if run_state.timestep_id == 10 { - let ground_size = 100.1; - let ground_height = 2.1; - - let rigid_body = RigidBodyBuilder::new_static() - .translation(0.0, -ground_height, 0.0) - .build(); - let handle = physics.bodies.insert(rigid_body); - let collider = - ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build(); - physics - .colliders - .insert(collider, handle, &mut physics.bodies); - - if let (Some(graphics), Some(window)) = (&mut graphics, &mut window) { - graphics.add(window, handle, &physics.bodies, &physics.colliders); - } - } - }, - ); - /* * Set up the testbed. */ testbed.set_world(bodies, colliders, joints); - testbed.physics_state_mut().gravity.fill(0.0); testbed.look_at(Point3::new(100.0, 100.0, 100.0), Point3::origin()); } -- cgit From 97157c9423f3360c5e941b4065377689221014ae Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Fri, 26 Mar 2021 18:16:27 +0100 Subject: First working version of non-linear CCD based on single-substep motion-clamping. --- examples3d/all_examples3.rs | 2 + examples3d/ccd3.rs | 145 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 examples3d/ccd3.rs (limited to 'examples3d') diff --git a/examples3d/all_examples3.rs b/examples3d/all_examples3.rs index a8c38c6..8122583 100644 --- a/examples3d/all_examples3.rs +++ b/examples3d/all_examples3.rs @@ -10,6 +10,7 @@ use inflector::Inflector; use rapier_testbed3d::Testbed; use std::cmp::Ordering; +mod ccd3; mod collision_groups3; mod compound3; mod convex_decomposition3; @@ -77,6 +78,7 @@ pub fn main() { let mut builders: Vec<(_, fn(&mut Testbed))> = vec![ ("Fountain", fountain3::init_world), ("Primitives", primitives3::init_world), + ("CCD", ccd3::init_world), ("Collision groups", collision_groups3::init_world), ("Compound", compound3::init_world), ("Convex decomposition", convex_decomposition3::init_world), diff --git a/examples3d/ccd3.rs b/examples3d/ccd3.rs new file mode 100644 index 0000000..b62427f --- /dev/null +++ b/examples3d/ccd3.rs @@ -0,0 +1,145 @@ +use na::{Isometry3, Point3, Vector3}; +use rapier3d::dynamics::{JointSet, RigidBodyBuilder, RigidBodySet}; +use rapier3d::geometry::{ColliderBuilder, ColliderSet}; +use rapier_testbed3d::Testbed; + +fn create_wall( + testbed: &mut Testbed, + bodies: &mut RigidBodySet, + colliders: &mut ColliderSet, + offset: Vector3, + stack_height: usize, + half_extents: Vector3, +) { + let shift = half_extents * 2.0; + for i in 0usize..stack_height { + for j in i..stack_height { + let fj = j as f32; + let fi = i as f32; + let x = offset.x; + let y = fi * shift.y + offset.y; + let z = (fi * shift.z / 2.0) + (fj - fi) * shift.z + offset.z + - stack_height as f32 * half_extents.z; + + // Build the rigid body. + let rigid_body = RigidBodyBuilder::new_dynamic().translation(x, y, z).build(); + let handle = bodies.insert(rigid_body); + let collider = + ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z).build(); + colliders.insert(collider, handle, bodies); + testbed.set_body_color(handle, Point3::new(218. / 255., 201. / 255., 1.0)); + } + } +} + +pub fn init_world(testbed: &mut Testbed) { + /* + * World + */ + let mut bodies = RigidBodySet::new(); + let mut colliders = ColliderSet::new(); + let joints = JointSet::new(); + + /* + * Ground + */ + let ground_size = 50.0; + let ground_height = 0.1; + + let rigid_body = RigidBodyBuilder::new_static() + .translation(0.0, -ground_height, 0.0) + .build(); + let ground_handle = bodies.insert(rigid_body); + let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build(); + colliders.insert(collider, ground_handle, &mut bodies); + + /* + * Create the pyramids. + */ + let num_z = 8; + let num_x = 5; + let shift_y = ground_height + 0.5; + let shift_z = (num_z as f32 + 2.0) * 2.0; + + for i in 0..num_x { + let x = i as f32 * 6.0; + create_wall( + testbed, + &mut bodies, + &mut colliders, + Vector3::new(x, shift_y, 0.0), + num_z, + Vector3::new(0.5, 0.5, 1.0), + ); + + create_wall( + testbed, + &mut bodies, + &mut colliders, + Vector3::new(x, shift_y, shift_z), + num_z, + Vector3::new(0.5, 0.5, 1.0), + ); + } + + /* + * Create two very fast rigid-bodies. + * The first one has CCD enabled and a sensor collider attached to it. + * The second one has CCD enabled and a collider attached to it. + */ + let collider = ColliderBuilder::ball(1.0) + .density(10.0) + .sensor(true) + .build(); + let mut rigid_body = RigidBodyBuilder::new_dynamic() + .linvel(1000.0, 0.0, 0.0) + .translation(-20.0, shift_y + 2.0, 0.0) + .ccd_enabled(true) + .build(); + let sensor_handle = bodies.insert(rigid_body); + colliders.insert(collider, sensor_handle, &mut bodies); + + // Second rigid-body with CCD enabled. + let collider = ColliderBuilder::ball(1.0).density(10.0).build(); + let mut rigid_body = RigidBodyBuilder::new_dynamic() + .linvel(1000.0, 0.0, 0.0) + .translation(-20.0, shift_y + 2.0, shift_z) + .ccd_enabled(true) + .build(); + let handle = bodies.insert(rigid_body); + colliders.insert(collider.clone(), handle, &mut bodies); + + // Callback that will be executed on the main loop to handle proximities. + testbed.add_callback(move |_, mut graphics, physics, events, _| { + while let Ok(prox) = events.intersection_events.try_recv() { + let color = if prox.intersecting { + Point3::new(1.0, 1.0, 0.0) + } else { + Point3::new(0.5, 0.5, 1.0) + }; + + let parent_handle1 = physics.colliders.get(prox.collider1).unwrap().parent(); + let parent_handle2 = physics.colliders.get(prox.collider2).unwrap().parent(); + + if let Some(graphics) = &mut graphics { + if parent_handle1 != ground_handle && parent_handle1 != sensor_handle { + graphics.set_body_color(parent_handle1, color); + } + if parent_handle2 != ground_handle && parent_handle2 != sensor_handle { + graphics.set_body_color(parent_handle2, color); + } + } + } + }); + + /* + * Set up the testbed. + */ + testbed.set_world(bodies, colliders, joints); + testbed.look_at(Point3::new(100.0, 100.0, 100.0), Point3::origin()); +} + +fn main() { + let testbed = Testbed::from_builders(0, vec![("Boxes", init_world)]); + testbed.run() +} -- cgit From e9f6384081e7f3722976b9fefda6926f5206e0a2 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Wed, 31 Mar 2021 10:53:44 +0200 Subject: Fix the parallel solver to work properly with CCD. --- examples3d/Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'examples3d') diff --git a/examples3d/Cargo.toml b/examples3d/Cargo.toml index b27b97c..1f84857 100644 --- a/examples3d/Cargo.toml +++ b/examples3d/Cargo.toml @@ -3,6 +3,7 @@ name = "rapier-examples-3d" version = "0.1.0" authors = [ "Sébastien Crozet " ] edition = "2018" +default-run = "all_examples3" [features] parallel = [ "rapier3d/parallel", "rapier_testbed3d/parallel" ] -- cgit From 3412e9ddbf1e23a39d7de2efdc8449244ee5f92a Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Wed, 31 Mar 2021 12:35:54 +0200 Subject: Fix some warnings. --- examples3d/ccd3.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples3d') diff --git a/examples3d/ccd3.rs b/examples3d/ccd3.rs index b62427f..19381fd 100644 --- a/examples3d/ccd3.rs +++ b/examples3d/ccd3.rs @@ -1,4 +1,4 @@ -use na::{Isometry3, Point3, Vector3}; +use na::{Point3, Vector3}; use rapier3d::dynamics::{JointSet, RigidBodyBuilder, RigidBodySet}; use rapier3d::geometry::{ColliderBuilder, ColliderSet}; use rapier_testbed3d::Testbed; @@ -91,7 +91,7 @@ pub fn init_world(testbed: &mut Testbed) { .density(10.0) .sensor(true) .build(); - let mut rigid_body = RigidBodyBuilder::new_dynamic() + let rigid_body = RigidBodyBuilder::new_dynamic() .linvel(1000.0, 0.0, 0.0) .translation(-20.0, shift_y + 2.0, 0.0) .ccd_enabled(true) @@ -101,7 +101,7 @@ pub fn init_world(testbed: &mut Testbed) { // Second rigid-body with CCD enabled. let collider = ColliderBuilder::ball(1.0).density(10.0).build(); - let mut rigid_body = RigidBodyBuilder::new_dynamic() + let rigid_body = RigidBodyBuilder::new_dynamic() .linvel(1000.0, 0.0, 0.0) .translation(-20.0, shift_y + 2.0, shift_z) .ccd_enabled(true) -- cgit