@@ -208,7 +208,6 @@ impl FixedMain {
208208 task_to_render_time. diff += clock. delta ( ) . as_secs_f64 ( ) ;
209209 if task_to_render_time. diff < timestep. timestep . as_secs_f64 ( ) {
210210 // Task is too far ahead, we should not read the simulation.
211- info ! ( "Task is too far ahead, we should not read the simulation." ) ;
212211 return ;
213212 }
214213 let simulated_time = {
@@ -217,25 +216,14 @@ impl FixedMain {
217216 task_result. map ( |task_result| task_result. result_raw . simulated_time )
218217 } ;
219218 let Some ( simulated_time) = simulated_time else {
220- info ! ( "No task result found." ) ;
221219 return ;
222220 } ;
223221 let mut query = world. query :: < & mut TaskToRenderTime > ( ) ;
224222 let mut task_to_render_time = query. single_mut ( world) ;
225223 task_to_render_time. diff -= simulated_time. as_secs_f64 ( ) ;
226224 let _ = world. try_schedule_scope ( FixedMain , |world, schedule| {
227225 // Advance simulation.
228- info ! ( "Running FixedMain schedule" ) ;
229226 schedule. run ( world) ;
230-
231- // If physics is paused, reset delta time to stop simulation
232- // unless users manually advance `Time<Physics>`.
233- /*if is_paused {
234- world
235- .resource_mut::<Time<Physics>>()
236- .advance_by(Duration::ZERO);
237- }
238- */
239227 } ) ;
240228 }
241229}
@@ -282,26 +270,16 @@ pub fn extract<T: TaskWorkerTrait>(world: &mut World) {
282270/// frames/ticks, and use the results to spawn cubes
283271pub fn spawn_task < T : TaskWorkerTrait > (
284272 mut commands : Commands ,
285- q_context : Query < (
286- Entity ,
287- & TaskToRenderTime ,
288- & TaskWorker < T > ,
289- & Timestep ,
290- & T :: TaskExtractedData ,
291- Has < WorkTask < T > > ,
292- ) > ,
273+ q_context : Query < ( Entity , & TaskWorker < T > , & Timestep , & T :: TaskExtractedData ) > ,
293274 virtual_time : Res < Time < Virtual > > ,
294275) {
295- let Ok ( ( entity_ctx, task_to_render_time, worker, timestep, extracted_data, has_work) ) =
296- q_context. get_single ( )
297- else {
298- info ! ( "No correct entity found." ) ;
276+ let Ok ( ( entity_ctx, worker, timestep, extracted_data) ) = q_context. get_single ( ) else {
299277 return ;
300278 } ;
301279 let timestep = timestep. timestep ;
302280
303281 // TODO: tweak this on user side, to allow the simulation to catch up with the render time.
304- let mut substep_count = 1 ;
282+ let substep_count = 1 ;
305283
306284 let ( sender, recv) = crossbeam_channel:: unbounded ( ) ;
307285
@@ -311,11 +289,6 @@ pub fn spawn_task<T: TaskWorkerTrait>(
311289 thread_pool
312290 . spawn ( async move {
313291 let simulated_time = timestep * substep_count;
314-
315- info ! (
316- "Let's spawn a simulation task for time: {:?}" ,
317- simulated_time
318- ) ;
319292 profiling:: scope!( "Rapier physics simulation" ) ;
320293 let transforms_to_move =
321294 worker
@@ -355,12 +328,10 @@ pub(crate) fn finish_task_and_store_result<T: TaskWorkerTrait>(
355328 commands. entity ( e) . remove :: < WorkTask < T > > ( ) ;
356329 results. results . push_back ( TaskResult :: < T > {
357330 result_raw : task_result_raw,
358- render_time_elapsed_during_the_simulation : dbg ! ( time. elapsed( ) )
359- - dbg ! ( task. started_at_render_time) ,
331+ render_time_elapsed_during_the_simulation : time. elapsed ( ) - task. started_at_render_time ,
360332 started_at_render_time : task. started_at_render_time ,
361333 update_frames_elapsed : task. update_frames_elapsed ,
362334 } ) ;
363- info ! ( "Task finished!" ) ;
364335 } ;
365336 // TODO: configure this somehow.
366337 if task. update_frames_elapsed > 60 {
@@ -386,10 +357,6 @@ pub(crate) fn handle_task<T: TaskWorkerTrait>(world: &mut World) {
386357 } ;
387358 task_to_render. last_task_frame_count = task. update_frames_elapsed ;
388359 // Apply transform changes.
389- info ! (
390- "handle_task: simulated_time: {:?}" ,
391- task. result_raw. simulated_time
392- ) ;
393360 tasks_to_handle. push ( ( worker. clone ( ) , task) ) ;
394361 }
395362
0 commit comments