Skip to content

Commit da2b0a8

Browse files
fix snapshots in 2d examples (#875)
1 parent 9450721 commit da2b0a8

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

src_testbed/testbed.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,21 +1248,17 @@ fn update_testbed(
12481248
state
12491249
.action_flags
12501250
.set(TestbedActionFlags::TAKE_SNAPSHOT, false);
1251-
// FIXME
1252-
println!(
1253-
"!!!!!!!!! Snapshots are not working any more. Requires broad-phase serialization."
1254-
);
1255-
// state.snapshot = PhysicsSnapshot::new(
1256-
// harness.state.timestep_id,
1257-
// &*harness.physics.broad_phase,
1258-
// &harness.physics.narrow_phase,
1259-
// &harness.physics.islands,
1260-
// &harness.physics.bodies,
1261-
// &harness.physics.colliders,
1262-
// &harness.physics.impulse_joints,
1263-
// &harness.physics.multibody_joints,
1264-
// )
1265-
// .ok();
1251+
state.snapshot = PhysicsSnapshot::new(
1252+
harness.state.timestep_id,
1253+
&harness.physics.broad_phase,
1254+
&harness.physics.narrow_phase,
1255+
&harness.physics.islands,
1256+
&harness.physics.bodies,
1257+
&harness.physics.colliders,
1258+
&harness.physics.impulse_joints,
1259+
&harness.physics.multibody_joints,
1260+
)
1261+
.ok();
12661262

12671263
if let Some(snap) = &state.snapshot {
12681264
snap.print_snapshot_len();

src_testbed/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ Hashes at frame: {}
411411
serialization_time.as_secs_f64() * 1000.0,
412412
timestep_id,
413413
bf.len() as f32 / 1000.0,
414-
format!("{:?}", hash_bf).split_at(10).0,
414+
format!("{hash_bf:?}").split_at(10).0,
415415
nf.len() as f32 / 1000.0,
416416
format!("{hash_nf:?}").split_at(10).0,
417417
bs.len() as f32 / 1000.0,

0 commit comments

Comments
 (0)