continuous_circle_circle_collision

Function continuous_circle_circle_collision 

Source
pub fn continuous_circle_circle_collision(
    circle1: &Circle,
    velocity1: &[f64; 2],
    circle2: &Circle,
    time_step: f64,
) -> Option<f64>
Expand description

Tests if a moving circle will collide with a static circle within a time step

§Arguments

  • circle1 - The moving circle
  • velocity1 - The velocity of the moving circle [vx, vy]
  • circle2 - The static circle
  • time_step - The time step to check for collision

§Returns

Some(time) if the circles will collide within the time step, None otherwise