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

Method push

perro_source/api_modules/perro_runtime_api/src/sub_apis/physics.rs:982–994  ·  view source on GitHub ↗
(&mut self, time: f32)

Source from the content-addressed store, hash-verified

980 F: FnMut(f32) -> Option<f32>,
981{
982 let mut roots = LaunchTimeRange::default();
983 let dt = max_time / TRAJECTORY_SCAN_STEPS as f32;
984 let mut prev_time = dt.max(TRAJECTORY_EPS);
985 let mut prev = match f(prev_time) {
986 Some(v) if v.is_finite() => v,
987 _ => return roots,
988 };
989
990 if prev.abs() <= TRAJECTORY_ROOT_EPS {
991 roots.push(prev_time);
992 }
993
994 for step in 2..=TRAJECTORY_SCAN_STEPS {
995 let time = dt * step as f32;
996 let Some(value) = f(time).filter(|value| value.is_finite()) else {
997 prev_time = time;

Callers 2

solve_no_drift_timesFunction · 0.45
find_launch_time_rangeFunction · 0.45

Calls 1

absMethod · 0.45

Tested by

no test coverage detected