Integrate basic attack script debug.

This commit is contained in:
2026-08-30 14:45:26 +02:00
parent af0e567332
commit 1d5a07324d
19 changed files with 353 additions and 43 deletions
+13 -1
View File
@@ -2,8 +2,9 @@
//! this module is what turns that into a position.
use bevy::prelude::*;
use fixed::types::I16F16;
use crate::math::vec::FGVec2;
use crate::{fighter::{FighterFacingDirection, baked_animation::FixedMat4}, math::{int::FGi32, vec::FGVec2, vec3::FGVec3}};
#[derive(Component, Clone, Copy)]
pub struct Grounded;
@@ -18,6 +19,17 @@ pub struct FighterPreviousTranslation(pub FGVec2);
#[require(FighterPreviousTranslation)]
pub struct FighterTranslation(pub FGVec2);
impl FighterTranslation {
pub fn get_3d_transform(&self, facing_dir: &FighterFacingDirection) -> FixedMat4 {
let mut o = match facing_dir {
FighterFacingDirection::Left => FixedMat4::IDENTITY.rotate_y(3),
FighterFacingDirection::Right => FixedMat4::IDENTITY.rotate_y(1),
};
o.translate(FGVec3::new(self.0.x, self.0.y, FGi32::ZERO));
o
}
}
pub fn apply_air_motion(
fighters: Query<(
&FighterVelocity,