reaction 0.2.0

Universal low-latency input handling for game engines
Documentation
pub enum DeadzoneType {
    Axial,
    Radial,
}

pub fn apply_deadzone(x: f32, y: f32, threshold: f32, dz_type: DeadzoneType) -> (f32, f32) {
    match dz_type {
        DeadzoneType::Axial => {
            let new_x = if x.abs() < threshold { 0.0 } else { x };
            let new_y = if y.abs() < threshold { 0.0 } else { y };
            (new_x, new_y)
        }
        DeadzoneType::Radial => {
            let magnitude = (x * x + y * y).sqrt();
            if magnitude < threshold {
                (0.0, 0.0)
            } else {
                // Optional: Rescale to avoid jump at threshold
                // For simple implementation, just pass through if above threshold
                (x, y)
            }
        }
    }
}