pub struct ShotProjectionTracker { /* private fields */ }Expand description
Watches the ball’s free flight after a touch and decides, from the settled
trajectory before the next touch, whether the touch sent the ball goalward —
recovering shots whose touch-frame velocity had not yet finished updating.
Resolutions are applied retroactively to the already-emitted touch event,
mirroring ControlFollowTracker.
At most one window is open at a time: any new touch closes the previous window.
Implementations§
Source§impl ShotProjectionTracker
impl ShotProjectionTracker
Sourcepub fn open(&mut self, touch_index: usize, is_team_0: bool, time: f32)
pub fn open(&mut self, touch_index: usize, is_team_0: bool, time: f32)
Open a projection window for a just-emitted touch event.
Sourcepub fn observe_touch(
&mut self,
next_touch_time: f32,
) -> Option<ShotProjectionResolution>
pub fn observe_touch( &mut self, next_touch_time: f32, ) -> Option<ShotProjectionResolution>
Close the open window because a new touch at next_touch_time ended free
flight, resolving it from a sample taken a guard interval before that
touch so the next touch’s pre-detection impulse can’t skew the read.
Sourcepub fn advance(
&mut self,
frame: &FrameInfo,
ball_position: Option<Vec3>,
ball_velocity: Option<Vec3>,
) -> Option<ShotProjectionResolution>
pub fn advance( &mut self, frame: &FrameInfo, ball_position: Option<Vec3>, ball_velocity: Option<Vec3>, ) -> Option<ShotProjectionResolution>
Record this frame’s free-flight ball sample, or resolve the window once it ages past the shot time-to-goal horizon.
Sourcepub fn flush(&mut self) -> Option<ShotProjectionResolution>
pub fn flush(&mut self) -> Option<ShotProjectionResolution>
Close any open window immediately (live-play boundary or end of replay).