factor ou projectile components and systems

This commit is contained in:
nquidox 2026-04-19 22:18:40 +03:00
parent eeebdbd272
commit 67ddcb0c65
6 changed files with 426 additions and 293 deletions

View file

@ -0,0 +1,33 @@
use bevy::math::Vec2;
use bevy::prelude::Component;
use crate::states::linear::RoundBallType;
#[derive(Component)]
pub struct RoundBallProjectile {
pub velocity: Vec2,
pub direction: Vec2,
pub previous_position: Vec2,
pub ball_type: RoundBallType,
pub hit_result: Option<ProjectileHit>,
pub target_position: Option<Vec2>,
}
#[derive(Copy, Clone)]
pub struct ProjectileHit {
pub hit_progress: f32,
pub hit_position: Vec2,
pub segment_index: usize,
}
#[derive(Component)]
pub struct IntersectMarker;
pub struct Intersection {
pub t: f32,
pub world_pos: Vec2,
pub segment_index: usize,
}
#[derive(Component)]
pub struct InsertMarker;