Compare commits

...
Author SHA1 Message Date
EIREXE 10cad6d944 Add ECB bone markers
CI / build-and-test (pull_request) Successful in 2m48s
CI / production-build (pull_request) Successful in 11m57s
2026-10-12 17:30:02 +02:00
EIREXE 17ba848cd8 Fix one frame visual transform delay 2026-10-12 17:29:49 +02:00
2 changed files with 16 additions and 4 deletions
+13 -2
View File
@@ -171,21 +171,32 @@ pub fn animation_debug(
&FighterTranslation, &FighterTranslation,
&FighterFacingDirection, &FighterFacingDirection,
&FighterBoneMatrices, &FighterBoneMatrices,
&Fighter,
)>, )>,
mut gizmos: Gizmos, mut gizmos: Gizmos,
fighter_manifests: Res<Assets<FighterManifest>>,
) { ) {
for (global_transform, facing_dir, matrices) in query { for (global_transform, facing_dir, matrices, fighter) in query {
let Some(manifest) = fighter_manifests.get(&fighter.manifest) else {
continue;
};
let global_transform = global_transform.get_3d_transform(facing_dir); let global_transform = global_transform.get_3d_transform(facing_dir);
let marker_transform = global_transform.to_mat4(); let marker_transform = global_transform.to_mat4();
for (_, matrix) in matrices.iter() { for (bone_name, matrix) in matrices.iter() {
let pos = marker_transform.transform_point(Vec3::new( let pos = marker_transform.transform_point(Vec3::new(
matrix.cols[3][0].to_num(), matrix.cols[3][0].to_num(),
matrix.cols[3][1].to_num(), matrix.cols[3][1].to_num(),
matrix.cols[3][2].to_num(), matrix.cols[3][2].to_num(),
)); ));
if manifest.ecb_bones.iter().any(|ecb_bone_name| ecb_bone_name == bone_name) {
gizmos.cross(pos, 1.0, bevy::color::palettes::css::GREEN);
} else {
gizmos.cross(pos, 0.5, bevy::color::palettes::css::RED); gizmos.cross(pos, 0.5, bevy::color::palettes::css::RED);
gizmos.axes(marker_transform, 1.0); gizmos.axes(marker_transform, 1.0);
} }
}
} }
} }
+1
View File
@@ -212,6 +212,7 @@ impl Plugin for FighterPlugin {
animation::apply_animation, animation::apply_animation,
) )
.chain() .chain()
.before(bevy::transform::TransformSystems::Propagate)
.run_if(in_state(crate::AppState::InMatch)), .run_if(in_state(crate::AppState::InMatch)),
) )
// Rollback registration lives next to the systems that write these // Rollback registration lives next to the systems that write these