MCPcopy Create free account
hub / github.com/PerroEngine/Perro / write

Method write

perro_source/render_stack/perro_app/src/winit_runner.rs:200–221  ·  view source on GitHub ↗
(&mut self, sample: CsvFrameSample)

Source from the content-addressed store, hash-verified

198fn plan_fixed_steps(
199 frame_delta_seconds: f32,
200 fixed_timestep: f32,
201 accumulator: f32,
202 max_steps: u32,
203) -> FixedStepPlan {
204 let max_steps = max_steps.clamp(MIN_FIXED_STEPS_PER_FRAME, MAX_FIXED_STEPS_PER_FRAME);
205 let mut next_accumulator =
206 accumulator + frame_delta_seconds.clamp(0.0, MAX_FRAME_DELTA_SECONDS);
207 let mut steps = 0u32;
208 while next_accumulator >= fixed_timestep && steps < max_steps {
209 next_accumulator -= fixed_timestep;
210 steps += 1;
211 }
212 let dropped_catchup = steps == max_steps && next_accumulator >= fixed_timestep;
213 if dropped_catchup {
214 next_accumulator %= fixed_timestep;
215 }
216 FixedStepPlan {
217 steps,
218 step_seconds: fixed_timestep,
219 accumulator_after: next_accumulator,
220 dropped_catchup,
221 }
222}
223
224#[derive(Clone, Copy, Debug, Default)]

Callers 8

step_startup_frameMethod · 0.45
step_frameMethod · 0.45
send_joycon2_player_lampFunction · 0.45
send_joycon2_rumbleFunction · 0.45
enable_sensorsFunction · 0.45

Calls 1

flushMethod · 0.80

Tested by

no test coverage detected