diff options
Diffstat (limited to 'examples2d/sensor2.rs')
| -rw-r--r-- | examples2d/sensor2.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples2d/sensor2.rs b/examples2d/sensor2.rs index e5a95df..6415f5d 100644 --- a/examples2d/sensor2.rs +++ b/examples2d/sensor2.rs @@ -68,15 +68,15 @@ pub fn init_world(testbed: &mut Testbed) { // 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 { + while let Ok(prox) = events.events.try_recv() { + let color = if prox.started() { [1.0, 1.0, 0.0] } else { [0.5, 0.5, 1.0] }; - let parent_handle1 = physics.colliders[prox.collider1].parent().unwrap(); - let parent_handle2 = physics.colliders[prox.collider2].parent().unwrap(); + let parent_handle1 = physics.colliders[prox.collider1()].parent().unwrap(); + let parent_handle2 = physics.colliders[prox.collider2()].parent().unwrap(); if let Some(graphics) = &mut graphics { if parent_handle1 != ground_handle && parent_handle1 != sensor_handle { |
