Initial work on proper character movement

This commit is contained in:
2026-08-24 18:24:20 +02:00
parent a21f24b2d9
commit 91c5c4e05f
30 changed files with 1221 additions and 347 deletions
+14 -11
View File
@@ -1,16 +1,19 @@
use bevy::{color::palettes::css::RED, prelude::*};
use crate::stage::StageLine;
use crate::stage::{StagePoly, line::StageCollision};
pub fn debug_draw_scene(mut gizmos: Gizmos, stage_collision: Res<StageCollision>) {
for poly in stage_collision.stage_polys.iter() {
for segment in poly.segments.iter() {
let from = segment.segment.point1();
let to = segment.segment.point2();
let from_3d = Vec3::new(from.x, from.y, 0.0);
let end_3d = Vec3::new(to.x, to.y, 0.0);
let normal_3d = Vec3::new(segment.normal.x, segment.normal.y, 0.0);
gizmos.line(from_3d, end_3d, RED);
let midpoint = (from_3d + end_3d) * 0.5;
gizmos.arrow(midpoint, midpoint + normal_3d, RED);
}
pub fn debug_draw_scene(mut gizmos: Gizmos, planes: Query<&StageLine>) {
for plane in planes {
let from = plane.segment.point1();
let to = plane.segment.point2();
let from_3d = Vec3::new(from.x, from.y, 0.0);
let end_3d = Vec3::new(to.x, to.y, 0.0);
let normal_3d = Vec3::new(plane.normal.x, plane.normal.y, 0.0);
gizmos.line(from_3d, end_3d, RED);
let midpoint = (from_3d + end_3d) * 0.5;
gizmos.arrow(midpoint, midpoint + normal_3d, RED);
}
}