Add shifting ECB based on bone positions (melee-like)
CI / build-and-test (pull_request) Successful in 1m33s
CI / production-build (pull_request) Successful in 10m48s

This commit is contained in:
2026-09-25 15:45:55 +02:00
parent d521461625
commit 0cb81ec2e9
17 changed files with 317 additions and 115 deletions
+6 -4
View File
@@ -83,9 +83,7 @@ pub fn apply_air_motion(
velocity: &FighterVelocity,
translation: &mut FighterTranslation,
prev_translation: &mut FighterPreviousTranslation,
surface: &mut FighterSurfaceState,
) {
surface.leave_ground();
// Vertical velocity should be 0 on the ground
prev_translation.0 = translation.0;
translation.0 += velocity.0;
@@ -111,7 +109,6 @@ pub fn update_standard_motion(
ctx.velocity,
ctx.translation,
ctx.prev_translation,
ctx.surface,
);
}
@@ -120,7 +117,12 @@ pub fn collision_interrupt(
landing_type: LandingType,
) -> Option<FighterState> {
let res = ctx.air_collide_with_stage()?;
ctx.translation.0 = res.hit_position - ctx.ecb.get_bottom_point();
let diff = res.hit_position - ctx.translation.0;
ctx.ecb.bottom -= diff;
ctx.ecb.top -= diff;
ctx.ecb.left -= diff;
ctx.ecb.right -= diff;
ctx.translation.0 = res.hit_position;
ctx.surface.land(res.line_id);
Some(FighterState::Land(LandingState::create(landing_type)))
}