Skip to content

Commit 20d475c

Browse files
committed
Testbed: Fix examples sensor2 and body_status2.
1 parent 3197a75 commit 20d475c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples2d/body_status2.rs

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ fn main() {
181181
*/
182182
let mut testbed = Testbed::new(world);
183183
testbed.add_callback(move |world, _, time| {
184+
let mut world = world.get_mut();
184185
let platform = world.rigid_body_mut(platform_handle).unwrap();
185186
let platform_x = platform.position().translation.vector.x;
186187

examples2d/sensor2.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ fn main() {
8888

8989
// Callback that will be executed on the main loop to handle proximities.
9090
testbed.add_callback(move |world, graphics, _| {
91+
let world = world.get();
9192
for prox in world.proximity_events() {
9293
let color = match prox.new_status {
9394
Proximity::WithinMargin | Proximity::Intersecting => Point3::new(1.0, 1.0, 0.0),
@@ -98,10 +99,10 @@ fn main() {
9899
let body2 = world.collider(prox.collider2).unwrap().data().body();
99100

100101
if !body1.is_ground() && body1 != sensor_body {
101-
graphics.set_body_color(world, body1, color);
102+
graphics.set_body_color(&world, body1, color);
102103
}
103104
if !body2.is_ground() && body2 != sensor_body {
104-
graphics.set_body_color(world, body2, color);
105+
graphics.set_body_color(&world, body2, color);
105106
}
106107
}
107108
});

0 commit comments

Comments
 (0)