diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-05-16 17:49:20 +0200 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-05-16 17:49:20 +0200 |
| commit | 1a84bf2af34176508bdda8d0f2ad2e46dc5c4df9 (patch) | |
| tree | b3f2ccf2ee0490eb59e4b84223446aa494d18c94 /examples3d/sensor3.rs | |
| parent | f350ac35d9889085af3f51a1894e2cc87173cb98 (diff) | |
| download | rapier-1a84bf2af34176508bdda8d0f2ad2e46dc5c4df9.tar.gz rapier-1a84bf2af34176508bdda8d0f2ad2e46dc5c4df9.tar.bz2 rapier-1a84bf2af34176508bdda8d0f2ad2e46dc5c4df9.zip | |
Replace Kiss3d by Bevy for the testbed renderer.
Diffstat (limited to 'examples3d/sensor3.rs')
| -rw-r--r-- | examples3d/sensor3.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/examples3d/sensor3.rs b/examples3d/sensor3.rs index 641e93d..e55bf72 100644 --- a/examples3d/sensor3.rs +++ b/examples3d/sensor3.rs @@ -46,7 +46,7 @@ pub fn init_world(testbed: &mut Testbed) { let collider = ColliderBuilder::cuboid(rad, rad, rad).build(); colliders.insert(collider, handle, &mut bodies); - testbed.set_body_color(handle, Point3::new(0.5, 0.5, 1.0)); + testbed.set_initial_body_color(handle, Point3::new(0.5, 0.5, 1.0)); } } @@ -70,10 +70,10 @@ pub fn init_world(testbed: &mut Testbed) { let sensor_collider = ColliderBuilder::ball(rad * 5.0).sensor(true).build(); colliders.insert(sensor_collider, sensor_handle, &mut bodies); - testbed.set_body_color(sensor_handle, Point3::new(0.5, 1.0, 1.0)); + testbed.set_initial_body_color(sensor_handle, Point3::new(0.5, 1.0, 1.0)); // Callback that will be executed on the main loop to handle proximities. - testbed.add_callback(move |_, mut graphics, physics, events, _| { + 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) @@ -101,8 +101,3 @@ pub fn init_world(testbed: &mut Testbed) { testbed.set_world(bodies, colliders, joints); testbed.look_at(Point3::new(-6.0, 4.0, -6.0), Point3::new(0.0, 1.0, 0.0)); } - -fn main() { - let testbed = Testbed::from_builders(0, vec![("Sensor", init_world)]); - testbed.run() -} |
