Initial work on rollback and refactor

This commit is contained in:
2026-08-12 12:27:35 +02:00
parent ad6c1e17ac
commit a21f24b2d9
45 changed files with 1451 additions and 717 deletions
+30
View File
@@ -0,0 +1,30 @@
//! Fighter debug views: gizmos and the egui inspector window.
use bevy::{color::palettes::css::YELLOW, prelude::*};
use bevy_egui::{EguiContexts, egui};
use crate::fighter::state::StateNameDebug;
use crate::fighter::{FighterECB, FighterTranslation, FighterVelocity};
use crate::input::FighterInput;
pub fn debug_draw_ecb(ecbs: Query<(&FighterECB, &FighterTranslation)>, mut gizmos: Gizmos) {
for (ecb, trf) in ecbs {
let transformed = ecb.to_3d_lineloop(Transform::from_xyz(trf.x, trf.y, 0.0));
gizmos.lineloop(transformed, YELLOW);
}
}
pub fn fighter_debug(
mut contexts: EguiContexts,
query: Query<(&FighterVelocity, &FighterInput, &StateNameDebug)>,
) -> Result {
for (vel, input, name) in query {
egui::Window::new("Hello").show(contexts.ctx_mut()?, |ui| {
ui.label(format!("State: {}", name.0));
ui.label(format!("{:?}", vel));
ui.label(format!("{:?}", input.get_last_frame()));
});
}
Ok(())
}