Initial work on ledge & improved baking of root motion. (#90)
Reviewed-on: #90 Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #90.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::fighter::state::jump::{self};
|
||||
use crate::fighter::state::land::{LandingState, LandingType};
|
||||
use crate::fighter::state::ledge_wait::LedgeWaitState;
|
||||
use crate::fighter::state::{
|
||||
CollisionContext, FighterState, InterruptContext, air_attack, air_dodge,
|
||||
};
|
||||
@@ -126,6 +127,15 @@ pub fn collision_interrupt(
|
||||
landing_type: LandingType,
|
||||
can_ignore_soft_platforms: bool,
|
||||
) -> Option<FighterState> {
|
||||
if ctx.velocity.y <= FGi32::ZERO {
|
||||
if let Some(ledge_result) = ctx.air_collide_with_ledges() {
|
||||
return Some(FighterState::LedgeWait(LedgeWaitState {
|
||||
airborne_state_common: AirborneStateCommon::default(),
|
||||
ledge_id: ledge_result.ledge,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
let res = ctx.air_collide_with_stage(can_ignore_soft_platforms)?;
|
||||
let diff = res.hit_position - ctx.translation.0;
|
||||
ctx.ecb.bottom -= diff;
|
||||
|
||||
Reference in New Issue
Block a user