flatten component configs

This commit is contained in:
Jonas H
2026-03-05 15:03:55 +01:00
parent d888dc077e
commit 28f8c65571
4 changed files with 38 additions and 87 deletions

View File

@@ -3,22 +3,6 @@ use kurbo::CubicBez;
#[derive(Clone)]
pub struct JumpComponent
{
pub jump_config: JumpConfig,
}
impl JumpComponent
{
pub fn new() -> Self
{
Self {
jump_config: JumpConfig::default(),
}
}
}
#[derive(Clone, Copy)]
pub struct JumpConfig
{
pub jump_height: f32,
pub jump_duration: f32,
@@ -30,7 +14,7 @@ pub struct JumpConfig
pub jump_context: JumpContext,
}
impl Default for JumpConfig
impl Default for JumpComponent
{
fn default() -> Self
{
@@ -56,22 +40,3 @@ pub struct JumpContext
pub origin_height: f32,
pub normal: Vec3,
}
impl JumpContext
{
fn start(time: f32, current_height: f32, surface_normal: Vec3) -> Self
{
Self {
in_progress: false,
duration: 0.0,
execution_time: time,
origin_height: current_height,
normal: surface_normal,
}
}
pub fn stop(&mut self)
{
self.in_progress = false;
}
}