use glam::Vec3;
use kurbo::CubicBez;

#[derive(Clone)]
pub struct JumpComponent
{
    pub jump_height: f32,
    pub jump_duration: f32,
    pub air_control_force: f32,
    pub max_air_momentum: f32,
    pub air_damping_active: f32,
    pub air_damping_passive: f32,
    pub jump_curve: CubicBez,
    pub jump_context: JumpContext,
}

impl Default for JumpComponent
{
    fn default() -> Self
    {
        Self {
            jump_height: 2.0,
            jump_duration: 0.15,
            air_control_force: 10.0,
            max_air_momentum: 8.0,
            air_damping_active: 0.4,
            air_damping_passive: 0.9,
            jump_curve: CubicBez::new((0.0, 0.0), (0.4, 0.75), (0.7, 0.9), (1.0, 1.0)),
            jump_context: JumpContext::default(),
        }
    }
}

#[derive(Default, Clone, Copy)]
pub struct JumpContext
{
    pub in_progress: bool,
    pub duration: f32,
    pub execution_time: f32,
    pub origin_height: f32,
    pub normal: Vec3,
}
